systemd-resolved.service
systemd
Developer
Tom
Gundersen
teg@jklm.no
systemd-resolved.service
8
systemd-resolved.service
systemd-resolved
Network Name Resolution manager
systemd-resolved.service
/usr/lib/systemd/systemd-resolved
Description
systemd-resolved is a system service that
manages network name resolution. It implements a caching DNS stub
resolver and an LLMNR resolver and responder. It also generates
/run/systemd/resolve/resolv.conf for
compatibility which may be symlinked from
/etc/resolv.conf. The glibc NSS module
nss-resolve8
is necessary to allow libc's NSS resolver functions to resolve
host names via systemd-resolved.
The DNS servers contacted are determined from the global
settings in /etc/systemd/resolved.conf, the
per-link static settings in /etc/systemd/network/*.network files,
and the per-link dynamic settings received over DHCP. See
resolved.conf5
and
systemd.network5
for details. To improve compatibility,
/etc/resolv.conf is read in order to discover
configured system DNS servers, however only if it is not a symlink
to /run/systemd/resolve/resolv.conf (see above).
systemd-resolved synthesizes DNS RRs for the following cases:
The local, configured hostname is resolved to
all locally configured IP addresses ordered by their scope, or
— if none are configured — the IPv4 address 127.0.0.2 (which
is on the local loopback) and the IPv6 address ::1 (which is the
local host).
The hostname localhost is
resolved to the IP addresses 127.0.0.1 and
::1.
The hostname gateway is
resolved to all current default routing gateway addresses,
ordered by their metric. This assigns a stable hostname to the
current gateway, useful for referencing it independently of the
current network configuration state.
Lookup requests are routed to the available DNS servers
and LLMNR interfaces according to the following rules:
Lookups for the special hostname
localhost are never routed to the
network.
Single-label names are routed to all local
interfaces capable of IP multicasting, using the LLMNR
protocol. Lookups for IPv4 addresses are only sent via LLMNR on
IPv4, and lookups for IPv6 addresses are only sent via LLMNR on
IPv6. Lookups for the locally configured host name and the
gateway host name are never routed to
LLMNR.
Multi-label names are routed to all local
interfaces that have a DNS sever configured, plus the globally
configured DNS server if there is one. Address lookups from the
link-local addres range are never routed to
DNS.
If lookups are routed to multiple interfaces, the first
successful response is returned (thus effectively merging the
lookup zones on all matching interfaces). If the lookup failed on
all interfaces, the last failing response is returned.
Routing of lookups may be influenced by configuring
per-interface domain names. See
systemd.network5
for details. Lookups for a hostname ending in one of the
per-interface domains are exclusively routed to the matching
interfaces.
Note that
/run/systemd/resolve/resolv.conf should not
be used directly, but only through a symlink from
/etc/resolv.conf.
See Also
systemd1,
resolved.conf5,
nss-resolve8,
systemd.network5,
systemd-networkd.service8