Difference between revisions of "Systemd-resolved"

From ArchWiki
Jump to: navigation, search
(Resolver services: add section intro)
(add mDNS)
Line 1: Line 1:
 
{{Lowercase title}}
 
{{Lowercase title}}
 
[[:Category:Domain Name System]]
 
[[:Category:Domain Name System]]
 +
[[:Category:Multicast DNS]]
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|systemd}}
 
{{Related|systemd}}
 
{{Related|resolv.conf}}
 
{{Related|resolv.conf}}
 +
{{Related|Avahi}}
 
{{Related articles end}}
 
{{Related articles end}}
 
{{man|8|systemd-resolved}} is a [[systemd]] service that provides network name resolution to local applications via a [[D-Bus]] interface, the {{ic|resolve}} NSS service ({{man|8|nss-resolve}}), and a local DNS stub listener on {{ic|127.0.0.53}}.  
 
{{man|8|systemd-resolved}} is a [[systemd]] service that provides network name resolution to local applications via a [[D-Bus]] interface, the {{ic|resolve}} NSS service ({{man|8|nss-resolve}}), and a local DNS stub listener on {{ic|127.0.0.53}}.  
Line 41: Line 43:
 
* The mode of operation of ''systemd-resolved'' is detected automatically, depending on whether {{ic|/etc/resolv.conf}} is a symlink to the local stub DNS resolver file or contains server names.
 
* The mode of operation of ''systemd-resolved'' is detected automatically, depending on whether {{ic|/etc/resolv.conf}} is a symlink to the local stub DNS resolver file or contains server names.
 
}}
 
}}
 +
 +
=== mDNS ===
 +
 +
''systemd-resolved''is capable of working as a multicast DNS listener and responder. Neither are enabled by default.

Revision as of 15:03, 15 July 2018

Category:Domain Name System Category:Multicast DNS

systemd-resolved(8) 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.

Installation

systemd-resolved is a part of the systemd package that is installed by default.

Resolver services

systemd-resolved provides resolver services for Domain Name System (DNS), Multicast DNS (mDNS) and Link-Local Multicast Name Resolution (LLMNR).

DNS

systemd-resolved has four different modes for handling the resolv.conf (described in systemd-resolved(8)). We will focus here on the two most relevant modes.

  1. The mode in which systemd-resolved is a client of the /etc/resolv.conf. This mode preserves /etc/resolv.conf and is compatible with the procedures described in this page.
  2. The systemd-resolved's recommended mode of operation: the DNS stub file /run/systemd/resolve/stub-resolv.conf contains both the local stub 127.0.0.53 as the only DNS servers and a list of search domains.

The service users are advised to redirect the /etc/resolv.conf file to the local stub DNS resolver file /run/systemd/resolve/stub-resolv.conf managed by systemd-resolved. This propagates the systemd managed configuration to all the clients. This can be done by replacing /etc/resolv.conf with a symbolic link to the systemd stub:

# ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

In this mode, the DNS servers are provided in the resolved.conf(5) file:

/etc/systemd/resolved.conf.d/dns_servers.conf
[Resolve]
DNS=91.239.100.100 89.233.43.71

In order to check the DNS actually used by systemd-resolved, the command to use is:

$ resolvectl status
Tip:
  • To understand the context around the DNS choices and switches, one can turn on detailed debug information for systemd-resolved as described in Systemd#Diagnosing a service.
  • The mode of operation of systemd-resolved is detected automatically, depending on whether /etc/resolv.conf is a symlink to the local stub DNS resolver file or contains server names.

mDNS

systemd-resolvedis capable of working as a multicast DNS listener and responder. Neither are enabled by default.