Skip to content
Search

Systemd-resolved

lastmod 2026-02-05created 2020-07-1817 edits

systemd-resolved is a systemd service that provides network name resolution to local applications via a D-Bus interface, the resolve NSS service (nss-resolve(8)), and a local DNS stub listener on 127.0.0.53. See systemd-resolved(8) for the usage.

Start/Enable

$ systemctl start systemd-resolved.service
$ systemctl enable systemd-resolved.service

DNS query structure

DNS_query_order.png

  • /etc/host.conf
  • /etc/hosts.allow
  • /etc/hosts.deny
  • /etc/hosts
  • /lib/systemd/system/systemd-resolved.service

/etc/resolv.conf

This file determines where to look up the address when finding the IP address for a given domain. The file looks like this:

order hosts,bind
multi on
order hosts,bind
Specifies the order of the services responsible for resolving IP addresses.
  • hosts - Refers to the /etc/hosts file.
  • bind - Refers to DNS. That is, the nameserver defined in /etc/resolv.conf.
  • nis - Refers to domain queries via NIS.
multi on
A configuration option that allows the /etc/hosts file to have multiple IP addresses (multiple ethN interfaces). A host with more than one IP address is called Multihomed, because having multiple IP addresses usually means the host has that many network interfaces.

/etc/systemd/resolved.conf

These configuration files control local DNS and LLMNR name resolution.

127.0.0.53

systemd-resolved runs an internal DNS server at 127.0.0.53 and uses it to resolve and cache domain names.

Setting DNS addresses manually

Edit the file:

sudo nano /etc/systemd/resolved.conf

Edit the settings

[Resolve]
DNS=8.8.8.8 1.1.1.1
FallbackDNS=

Restart:

sudo systemctl restart systemd-resolved

Check the settings:

resolvectl status
# 또는
cat /etc/resolv.conf

systemd-resolved vs dnsmasq

Resolving conflicts with Dnsmasq

See Dnsmasq#Resolving conflicts with systemd-resolved.

See also

Favorite site

author Zer0 sitemap