User Tools

Site Tools


linux:system:systemd-resolved

This is an old revision of the document!


Systemd-resolved

Systemd-resolved provides resolver services for Domain Name System (DNS).

Status

To check the DNS currently in use by systemd-resolved, run resolvectl status.

# resolvectl status
-----------------------------------------------
Global
       Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub

Link 2 (eth0)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: fdaa:66:67:a::1
       DNS Servers: fdaa:66:67:a::1
-----------------------------------------------

Configure

Supporting /etc/resolv.conf

To provide domain name resolution for software that reads /etc/resolv.conf directly, such as web browsers, systemd-resolved has four different modes for handling the file—stub, static, uplink and foreign. They are described in systemd-resolved(8). The recommended mode, is the stub mode which uses /run/systemd/resolve/stub-resolv.conf. /run/systemd/resolve/stub-resolv.conf contains the local stub 127.0.0.53 as the only DNS server and a list of search domains. This is the recommended mode of operation that propagates the systemd-resolved managed configuration to all clients.

# ls -al resolv.conf 

    lrwxrwxrwx 1 root root 37 aug 13 07:27 resolv.conf -> /run/systemd/resolve/stub-resolv.conf

# cat /run/systemd/resolve/stub-resolv.conf

    nameserver 127.0.0.53
    options edns0 trust-ad
    search .

Automatically

systemd-resolved will work out of the box with a network manager using /etc/resolv.conf. No particular configuration is required since systemd-resolved will be detected by following the /etc/resolv.conf symlink.

Manually

The resolver can be configured by editing /etc/systemd/resolved.conf and/or drop-in .conf files in /etc/systemd/resolved.conf.d/

linux/system/systemd-resolved.1692109721.txt.gz · Last modified: by oscar