Skip to content

Commit 73e7827

Browse files
authored
Merge pull request #45373 from ahardin-rh/DNS-over-TLS
NE-703, Added config details for TLS for forwarded DNS queries
2 parents bfeed2e + 2513ae6 commit 73e7827

File tree

1 file changed

+58
-18
lines changed

1 file changed

+58
-18
lines changed

modules/nw-dns-forward.adoc

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ A DNS forwarding configuration for the default domain can have both the default
2626
$ oc edit dns.operator/default
2727
----
2828
+
29-
This allows the Operator to create and update the ConfigMap named `dns-default` with additional server configuration blocks based on `Server`. If none of the servers has a zone that matches the query, then name resolution falls back to the upstream DNS servers.
29+
This allows the Operator to create and update the config map named `dns-default` with additional server configuration blocks based on `Server`. If none of the servers have a zone that matches the query, then name resolution falls back to the upstream DNS servers.
3030
+
31-
.Sample DNS
31+
.Configuring DNS forwarding
3232
[source,yaml]
3333
----
3434
apiVersion: operator.openshift.io/v1
@@ -37,23 +37,14 @@ metadata:
3737
name: default
3838
spec:
3939
servers:
40-
- name: foo-server <1>
40+
- name: example-server <1>
4141
zones: <2>
4242
- example.com
4343
forwardPlugin:
4444
policy: Random <3>
4545
upstreams: <4>
4646
- 1.1.1.1
4747
- 2.2.2.2:5353
48-
- name: bar-server
49-
zones:
50-
- bar.com
51-
- example.com
52-
forwardPlugin:
53-
policy: Random
54-
upstreams:
55-
- 3.3.3.3
56-
- 4.4.4.4:5454
5748
upstreamResolvers: <5>
5849
policy: Random <6>
5950
upstreams: <7>
@@ -63,22 +54,71 @@ spec:
6354
port: 53 <10>
6455
----
6556
<1> Must comply with the `rfc6335` service name syntax.
66-
<2> Must conform to the definition of a `subdomain` in `rfc1123`. The cluster domain, `cluster.local`, is an invalid `subdomain` for `zones`.
67-
<3> Defines the policy to select upstream resolvers. Default value is `Random`. You can also use `RoundRobin`, and `Sequential`.
57+
<2> Must conform to the definition of a subdomain in the `rfc1123` service name syntax. The cluster domain, `cluster.local`, is an invalid subdomain for the `zones` field.
58+
<3> Defines the policy to select upstream resolvers. Default value is `Random`. You can also use the values `RoundRobin`, and `Sequential`.
6859
<4> A maximum of 15 `upstreams` is allowed per `forwardPlugin`.
6960
<5> Optional. You can use it to override the default policy and forward DNS resolution to the specified DNS resolvers (upstream resolvers) for the default domain. If you do not provide any upstream resolvers, the DNS name queries go to the servers in `/etc/resolv.conf`.
7061
<6> Determines the order in which upstream servers are selected for querying. You can specify one of these values: `Random`, `RoundRobin`, or `Sequential`. The default value is `Sequential`.
7162
<7> Optional. You can use it to provide upstream resolvers.
7263
<8> You can specify two types of `upstreams` - `SystemResolvConf` and `Network`. `SystemResolvConf` configures the upstream to use `/etc/resolv.conf` and `Network` defines a `Networkresolver`. You can specify one or both.
73-
<9> If the specified type is `Network`, you must provide an IP address. `address` must be a valid IPv4 or IPv6 address.
74-
<10> If the specified type is `Network`, you can optionally provide a port. `port` must be between 1 and 65535.
64+
<9> If the specified type is `Network`, you must provide an IP address. The `address` field must be a valid IPv4 or IPv6 address.
65+
<10> If the specified type is `Network`, you can optionally provide a port. The `port` field must have a value between `1` and `65535`. If you do not specify a port for the upstream, by default port 853 is tried.
66+
+
67+
When working in a highly regulated environment, you might need the ability to secure DNS traffic when forwarding requests to upstream resolvers so that you can ensure additional DNS traffic and data privacy. Cluster administrators can configure transport layer security (TLS) for forwarded DNS queries.
68+
+
69+
.Configuring DNS forwarding with TLS
70+
[source,yaml]
71+
----
72+
apiVersion: operator.openshift.io/v1
73+
kind: DNS
74+
metadata:
75+
name: default
76+
spec:
77+
servers:
78+
- name: example-server <1>
79+
zones: <2>
80+
- example.com
81+
forwardPlugin:
82+
transportConfig:
83+
transport: TLS <3>
84+
tls:
85+
caBundle:
86+
name: mycacert
87+
serverName: dnstls.example.com <4>
88+
policy: Random <5>
89+
upstreams: <6>
90+
- 1.1.1.1
91+
- 2.2.2.2:5353
92+
upstreamResolvers: <7>
93+
transportConfig:
94+
transport: TLS
95+
tls:
96+
caBundle:
97+
name: mycacert
98+
serverName: dnstls.example.com
99+
upstreams:
100+
- type: Network <8>
101+
address: 1.2.3.4 <9>
102+
port: 53 <10>
103+
----
104+
<1> Must comply with the `rfc6335` service name syntax.
105+
<2> Must conform to the definition of a subdomain in the `rfc1123` service name syntax. The cluster domain, `cluster.local`, is an invalid subdomain for the `zones` field. The cluster domain, `cluster.local`, is an invalid `subdomain` for `zones`.
106+
<3> When configuring TLS for forwarded DNS queries, set the `transport` field to have the value `TLS`.
107+
By default, CoreDNS caches forwarded connections for 10 seconds. CoreDNS will hold a TCP connection open for those 10 seconds if no request is issued. With large clusters, ensure that your DNS server is aware that it might get many new connections to hold open because you can initiate a connection per node. Set up your DNS hierarchy accordingly to avoid performance issues.
108+
<4> When configuring TLS for forwarded DNS queries, this is a mandatory server name used as part of the server name indication (SNI) to validate the upstream TLS server certificate.
109+
<5> Defines the policy to select upstream resolvers. Default value is `Random`. You can also use the values `RoundRobin`, and `Sequential`.
110+
<6> Required. You can use it to provide upstream resolvers. A maximum of 15 `upstreams` entries are allowed per `forwardPlugin` entry.
111+
<7> Optional. You can use it to override the default policy and forward DNS resolution to the specified DNS resolvers (upstream resolvers) for the default domain. If you do not provide any upstream resolvers, the DNS name queries go to the servers in `/etc/resolv.conf`.
112+
<8> `Network` type indicates that this upstream resolver should handle forwarded requests separately from the upstream resolvers listed in `/etc/resolv.conf`. Only the `Network` type is allowed when using TLS and you must provide an IP address.
113+
<9> The `address` field must be a valid IPv4 or IPv6 address.
114+
<10> You can optionally provide a port. The `port` must have a value between `1` and `65535`. If you do not specify a port for the upstream, by default port 853 is tried.
75115
+
76116
[NOTE]
77117
====
78-
If `servers` is undefined or invalid, the ConfigMap only contains the default server.
118+
If `servers` is undefined or invalid, the config map only contains the default server.
79119
====
80120
+
81-
. View the ConfigMap:
121+
. View the config map:
82122
+
83123
[source,terminal]
84124
----

0 commit comments

Comments
 (0)