Open eubnara opened 5 years ago
$ man 8 systemd-resolved
$ man 5 resolved.conf
$ man 5 systemd.network
$ man 5 resolv.conf
$ man 5 networkmanager.conf
dns
Set the DNS (resolv.conf) processing mode. If the key is unspecified, default is used, unless /etc/resolv.conf is a symlink to
/run/systemd/resolve/resolv.conf, /lib/systemd/resolv.conf or /usr/lib/systemd/resolv.conf. In that case, systemd-resolved is chosen
automatically.
default: NetworkManager will update /etc/resolv.conf to reflect the nameservers provided by currently active connections.
dnsmasq: NetworkManager will run dnsmasq as a local caching nameserver, using a "split DNS" configuration if you are connected to a
VPN, and then update resolv.conf to point to the local nameserver. It is possible to pass custom options to the dnsmasq instance by
adding them to files in the "/etc/NetworkManager/dnsmasq.d/" directory. Note that when multiple upstream servers are available,
dnsmasq will initially contact them in parallel and then use the fastest to respond, probing again other servers after some time.
This behavior can be modified passing the 'all-servers' or 'strict-order' options to dnsmasq (see the manual page for more details).
unbound: NetworkManager will talk to unbound and dnssec-triggerd, providing a "split DNS" configuration with DNSSEC support.
/etc/resolv.conf will be managed by dnssec-trigger daemon.
systemd-resolved: NetworkManager will push the DNS configuration to systemd-resolved
none: NetworkManager will not modify resolv.conf. This implies rc-manager unmanaged
rc-manager
Set the resolv.conf management mode. The default value depends on NetworkManager
build options, and this version of NetworkManager was build with a default of
"symlink". Regardless of this setting, NetworkManager will always write
resolv.conf to its runtime state directory /run/NetworkManager/resolv.conf.
symlink: If /etc/resolv.conf is a regular file, NetworkManager will replace the
file on update. If /etc/resolv.conf is instead a symlink, NetworkManager will
leave it alone. Unless the symlink points to the internal file
/run/NetworkManager/resolv.conf, in which case the symlink will be updated to
emit an inotify notification. This allows the user to conveniently instruct
NetworkManager not to manage /etc/resolv.conf by replacing it with a symlink.
file: NetworkManager will write /etc/resolv.conf as file. If it finds a symlink,
it will follow the symlink and update the target instead.
resolvconf: NetworkManager will run resolvconf to update the DNS configuration.
netconfig: NetworkManager will run netconfig to update the DNS configuration.
unmanaged: don't touch /etc/resolv.conf.
none: deprecated alias for symlink.
$ cat /usr/lib/NetworkManager/conf.d/10-dns-resolved.conf
[main]
# We need to specify "dns=systemd-resolved" as for the time being our
# /etc/resolv.conf points to resolvconf's generated file instead of
# systemd-resolved's, so the auto-detection does not work.
dns=systemd-resolved
$ man systemd-resolved
/ETC/RESOLV.CONF
Four modes of handling /etc/resolv.conf (see resolv.conf(5)) are
supported:
· systemd-resolved maintains the
/run/systemd/resolve/stub-resolv.conf file for compatibility with
traditional Linux programs. This file may be symlinked from
/etc/resolv.conf. This file lists the 127.0.0.53 DNS stub (see
above) as the only DNS server. It also contains a list of search
domains that are in use by systemd-resolved. The list of search
domains is always kept up-to-date. Note that
/run/systemd/resolve/stub-resolv.conf should not be used directly
by applications, but only through a symlink from /etc/resolv.conf.
This file may be symlinked from /etc/resolv.conf in order to
connect all local clients that bypass local DNS APIs to
systemd-resolved with correct search domains settings. This mode of
operation is recommended.
· A static file /usr/lib/systemd/resolv.conf is provided that lists
the 127.0.0.53 DNS stub (see above) as only DNS server. This file
may be symlinked from /etc/resolv.conf in order to connect all
local clients that bypass local DNS APIs to systemd-resolved. This
file does not contain any search domains.
· systemd-resolved maintains the /run/systemd/resolve/resolv.conf
file for compatibility with traditional Linux programs. This file
may be symlinked from /etc/resolv.conf and is always kept
up-to-date, containing information about all known DNS servers.
Note the file format's limitations: it does not know a concept of
per-interface DNS servers and hence only contains system-wide DNS
server definitions. Note that /run/systemd/resolve/resolv.conf
should not be used directly by applications, but only through a
symlink from /etc/resolv.conf. If this mode of operation is used
local clients that bypass any local DNS API will also bypass
systemd-resolved and will talk directly to the known DNS servers.
· Alternatively, /etc/resolv.conf may be managed by other packages,
in which case systemd-resolved will read it for DNS configuration
data. In this mode of operation systemd-resolved is consumer rather
than provider of this configuration file.
Note that the selected mode of operation for this file is detected
fully automatically, depending on whether /etc/resolv.conf is a symlink
to /run/systemd/resolve/resolv.conf or lists 127.0.0.53 as DNS server.
TL;DR
In my ubuntu 18.04.2, systemd-resolved just reads /etc/resolv.conf
.
NetworkManager changes /etc/resolv.conf
.
I'm curious about what makes changes in
/etc/resolv.conf
.https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/