systemd-resolved.service, systemd-resolved — Network Name Resolution manager
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
compatibility which may be symlinked from
/etc/resolv.conf. The glibc NSS module
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
per-link static settings in
and the per-link dynamic settings received over DHCP. See
for details. To improve compatibility,
/etc/resolv.conf is read in order to discover
configured system DNS servers, but only if it is not a symlink
/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 "
resolved to the IP addresses 127.0.0.1 and
The hostname "
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
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
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.network(5) for details. Lookups for a hostname ending in one of the per-interface domains are exclusively routed to the matching interfaces.
/run/systemd/resolve/resolv.conf should not
be used directly, but only through a symlink from