NetworkManager/man
Íñigo Huguet f92a2bfd1f dns: make [global-dns] to overwrite configs from connections
According to the documentation, settings from [global-dns] (searches and
options) are always merged with those from connections. However this was
not happening if no [global-dns-domain-*] exists, in which case
connections were ignored. This happened because in the past both global
sections must de defined or undefined. When this was changed to allow
defining only [global-dns], allowing it in the function that generates
the resolv.conf file was forgotten. Fix that now.

Anyway, merging these configs doesn't make much sense. The searches and
options defined in connections probably make sense only for the nameservers
defined in that same connection.

Because of this, make the following change: if global nameservers are
defined, use searches and options from [global-dns] only, because those
defined in connections may not make sense for the global nameservers. If
[global-dns] is missing, assume an empty [global-dns] section.

Also, if no global nameservers are defined, but [global-dns] is, make
that it overwrites the searches and options defined in connections. This
is not ideal, but none of the alternatives is better and at least this
is easy to remember.

So, the resulting rules from above are:
- If [global-dns] is defined, it always overwrite searches and options
  from connections.
- If [global-dns-domain-*] is defined, it always overwrite nameservers
  from connections. It overwrites searches and options too.

Fixes: 1f0d1d78d2 ('dns-manager: always apply options from [global-dns]')
Fixes: f57a848da5 ('man: update documentation about global DNS configuration')
(cherry picked from commit 1cba0a3cca)
2025-09-12 13:20:13 +02:00
..
common.ent.in man: document which DHCP clients are enabled in this build 2025-01-20 19:02:06 +01:00
meson.build meson: remove deprecated ExternalProgram.path 2024-04-04 08:13:38 +00:00
NetworkManager-dispatcher.xml man/NetworkManager-dispatcher: document /{etc,usr} precedence 2025-01-16 16:11:09 +00:00
NetworkManager-wait-online.service.xml update DocBook DTD version to latest stable 4.5 2024-04-22 12:06:16 +00:00
NetworkManager.conf.xml dns: make [global-dns] to overwrite configs from connections 2025-09-12 13:20:13 +02:00
NetworkManager.xml update DocBook DTD version to latest stable 4.5 2024-04-22 12:06:16 +00:00
nm-cloud-setup.xml Rephrase certain expressions to avoid the usage of the term "allows to" 2025-03-27 09:44:07 +01:00
nm-initrd-generator.xml initrd: add new NBFT parser 2025-04-28 16:09:54 +00:00
nm-online.xml update DocBook DTD version to latest stable 4.5 2024-04-22 12:06:16 +00:00
nm-openvswitch.xml src: drop most slave references from the code 2024-08-09 15:47:32 +02:00
nm-settings-dbus.xsl update DocBook DTD version to latest stable 4.5 2024-04-22 12:06:16 +00:00
nm-settings-ifcfg-rh.xsl src: drop most slave references from the code 2024-08-09 15:47:32 +02:00
nm-settings-keyfile.xsl src: drop most slave references from the code 2024-08-09 15:47:32 +02:00
nm-settings-nmcli.xsl ip-config: Fix the nmcli docs for the renamed dhcp-send-hostname 2024-10-24 17:03:10 -04:00
nmcli-examples.xml src: drop most slave references from the code 2024-08-09 15:47:32 +02:00
nmcli.xml src: drop most master references from the code 2024-08-09 15:47:32 +02:00
nmtui.xml update DocBook DTD version to latest stable 4.5 2024-04-22 12:06:16 +00:00