Dear Maintainer,
I'm whether this might be a usability bug with the documentation or a
fuctional buf with the software itself:
According to 'man NetworkManager.conf', I expected that creating a
configuration file /etc/NetworkManager/conf.d/deeperpurpose.conf with contents
[global-dns]
searches=example.org
would result in /etc/resolv.conf in a line like
search example.org
However, adding that configuration file has proved ineffective (i.e. it
does not result in any change to /etc/resolv.conf), although it appears
that NetworkManager reads it.
[Syslog entry:
Jan 30 20:19:22 quill NetworkManager[806]: <info> [1643570362.0630] Read config
: /etc/NetworkManager/NetworkManager.conf (lib: no-mac-addr-change.conf) (etc: d
eeperpurpose.conf)
]
The /etc/resolv.conf file which NetworkManager generates is exactly the
same independently of whether or not that configuration file is added:
# Generated by NetworkManager
search home
nameserver 192.168.1.1
nameserver fe80::125a:f7ff:fe4f:1417%enp14s0
By contrast, I have found that the following are effective ways for adding
a domain name to the "search" line in /etc/resolv.conf or adding to it:
- adding it to /etc/hostname (that adds it to the "search" line after
the "home" — found out about through taking a look at the source code of
NetworkManager, see line 1263 and following in
NetworkManager-1.30.0/src/core/dns/nm-dns-manager.c — is that
behavior documented at all in the man pages for NetworkMananger?)
- using nm-connection-editor (putting the domain name I want in the
"additonal search domains" field actually *replaces* the "home"
which is precisely what I wanted, even though that does not quite
correspond to the "additonal search domains" field description.)
The issue came up during a fresh install of Debian 11.2 on a laptop
computer. I have also tested (using a separate test system) the
version 1.34.0-2 which is in testing and unstable and found the exact
same behavior.
I suggest that at the very least, the man pages should be updated
with information that explains how to get a desired domain name into
the "search" line of /etc/resolv.conf .
Best regards,