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.