global-dns: unexpected behaviour on lack of `[global-dns-domain-*]`
man NetworkManager.conf
says:
global-dns section: This section specifies global DNS settings that override connection-specific configuration.
searches: A list of search domains to be used during hostname lookup.
options: A list of options to be passed to the hostname resolver.
As an administrator who wants to set up a global DNS search path for all NM connections to reach a particular nameservers, it seems like having a following snippet should do exactly that:
[global-dns]
search=corp.example.com
[global-dns-domain-corp.example.com]
servers=203.0.113.1
However, this does not work without having the following snippet in addition:
[global-dns-domain-*]
servers=8.8.8.8
This is confusing. The manual makes a short mention in the [global-dns-domain]
section about this, namely:
A default domain section is mandatory.
However, there is no clear reference in the global-dns section documentation about this requirement, and even reading this line doesn't make it obvious what it means with regards to global-dns setings, or what a 'default domain section' even is. There is a log statement for when global-dns is ignored due to a lack of a global-dns-domain-*
server, however, it's a debug log that is not by default visible to a system operator, and as such I didn't notice it until I started reading source code.
In addition to seemingly being poorly documented and silent about misconfiguration, this behaviour also doesn't seem to allow my (I would argue not uncommon) usecase: setting a DNS search path to point at a specific DNS nameserver while using a DHCP-received nameserver for everything else. The configuration format hints at the possibility of such use, and that might've been what also set me on a path of further confusion when debugging this. Thus, I'm not sure if this is just a documentation bug but maybe a larger issue concerning how this part of NetworkManager is supposed to behave.