Skip to content

Commit 30ed34f

Browse files
authored
Merge pull request #80756 from dfitzmau/OSDOCS-11753
OSDOCS-11753: Update the Networking DNS documentation with more accur…
2 parents 1aa0469 + 6d9348f commit 30ed34f

File tree

1 file changed

+34
-35
lines changed

1 file changed

+34
-35
lines changed

modules/virt-example-nmstate-IP-management.adoc

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="virt-example-nmstate-IP-management_{context}"]
77
= Examples: IP management
88

9-
The following example configuration snippets demonstrate different methods of IP management.
9+
The following example configuration snippets show different methods of IP management.
1010

1111
These examples use the `ethernet` interface type to simplify the example while showing the related context in the policy configuration. These IP management examples can be used with the other interface types.
1212

@@ -109,8 +109,9 @@ For more information, see "Creating a manifest object that includes a customized
109109

110110
The following example shows a default situation that stores DNS values globally:
111111

112-
* Configure a static DNS without a network interface. Note that when updating the `/etc/resolv.conf` file on a host node, you do not need to specify an interface (IPv4 or IPv6) in the `NodeNetworkConfigurationPolicy` (NNCP) manifest.
112+
* Configure a static DNS without a network interface. Note that when updating the `/etc/resolv.conf` file on a host node, you do not need to specify an interface, IPv4 or IPv6, in the `NodeNetworkConfigurationPolicy` (NNCP) manifest.
113113
+
114+
.Example of a DNS configuration for a network interface that globally stores DNS values
114115
[source,yaml]
115116
----
116117
apiVersion: nmstate.io/v1
@@ -134,81 +135,79 @@ spec:
134135

135136
The following examples show situations that require configuring a network interface to store DNS values:
136137

137-
* Configure a static DNS for a network interface with an automatic IP configuration. Note that for this configuration, you must set the `auto-dns` parameter to `false`, so that the Kubernetes NMState Operator can store custom DNS settings for the network interface.
138+
* If you want to rank a static DNS name server over a dynamic DNS name server, define the interface that runs either the Dynamic Host Configuration Protocol (DHCP) or the IPv6 Autoconfiguration (`autoconf`) mechanism in the network interface YAML configuration file.
138139
+
140+
.Example configuration that adds `192.0.2.1` to DNS name servers retrieved from the DHCPv4 network protocol
139141
[source,yaml]
140142
----
143+
# ...
141144
dns-resolver:
142145
config:
143-
search:
144-
- example.com
145-
- example.org
146146
server:
147-
- 2001:db8:f::1
148-
- 192.0.2.251
147+
- 192.0.2.1
149148
interfaces:
150149
- name: eth1
151150
type: ethernet
152151
state: up
153152
ipv4:
154153
enabled: true
155154
dhcp: true
156-
auto-dns: false
157-
ipv6:
158-
enabled: true
159-
dhcp: true
160-
autoconf: true
161-
auto-dns: false
155+
auto-dns: true
162156
# ...
163157
----
164158

165-
* Configure a static DNS for a network interface with a static IP configuration. Note that for this configuration, you must set the `dhcp` parameter to `false` and the `autoconf` parameter to `false`.
159+
* If you need to configure a network interface to store DNS values instead of adopting the default method, which uses the `nmstate` API to store DNS values globally, you can set static DNS values and static IP addresses in the network interface YAML file.
166160
+
161+
[IMPORTANT]
162+
====
163+
Storing DNS values at the network interface level might cause name resolution issues after you attach the interface to network components, such as an Open vSwitch (OVS) bridge, a Linux bridge, or a bond.
164+
====
165+
+
166+
.Example configuration that stores DNS values at the interface level
167167
[source,yaml]
168168
----
169+
# ...
169170
dns-resolver:
170171
config:
171-
# ...
172+
search:
173+
- example.com
174+
- example.org
172175
server:
173-
- 2001:4860:4860::8844
174-
- 192.0.2.251
176+
- 2001:db8:1::d1
177+
- 2001:db8:1::d2
178+
- 192.0.2.1
175179
interfaces:
176180
- name: eth1
177181
type: ethernet
178182
state: up
179183
ipv4:
180-
enabled: true
181-
dhcp: false
182184
address:
183185
- ip: 192.0.2.251
184186
prefix-length: 24
185-
ipv6:
186-
enabled: true
187187
dhcp: false
188-
autoconf: false
188+
enabled: true
189+
ipv6:
189190
address:
190191
- ip: 2001:db8:1::1
191192
prefix-length: 64
192-
routes:
193-
config:
194-
- destination: 0.0.0.0/0
195-
next-hop-address: 192.0.2.1
196-
next-hop-interface: eth1
197-
- destination: ::/0
198-
next-hop-address: 2001:db8:1::3
199-
next-hop-interface: eth1
193+
dhcp: false
194+
enabled: true
195+
autoconf: false
200196
# ...
201197
----
202198

203-
* Configure a static DNS name server to append to Dynamic Host Configuration Protocol (DHCP) and IPv6 Stateless Address AutoConfiguration (SLAAC) servers.
199+
* If you want to set static DNS search domains and dynamic DNS name servers for your network interface, define the dynamic interface that runs either the Dynamic Host Configuration Protocol (DHCP) or the IPv6 Autoconfiguration (`autoconf`) mechanism in the network interface YAML configuration file.
204200
+
201+
.Example configuration that sets `example.com` and `example.org` static DNS search domains along with dynamic DNS name server settings
205202
[source,yaml]
206203
----
204+
# ...
207205
dns-resolver:
208206
config:
209-
# ...
210-
server:
211-
- 192.0.2.251
207+
search:
208+
- example.com
209+
- example.org
210+
server: []
212211
interfaces:
213212
- name: eth1
214213
type: ethernet

0 commit comments

Comments
 (0)