SYSTEMD-RESOLVED.SERVICE(8) systemd-resolved.service systemd-resolved.service systemd-resolved - systemd-resolved.service /usr/lib/systemd/systemd-resolved systemd-resolved . (stub resolver) DNS/DNSSEC LLMNR MulticastDNS. : o systemd-resolved D-Bus org.freedesktop.resolve1(5) org.freedesktop.LogControl1(5) . ( DNSSEC ). o systemd-resolved Varlink /run/systemd/resolve/io.systemd.Resolve AF_UNIX. D-Bus D-Bus . o getaddrinfo(3) glibc RFC3493[1] gethostbyname(3). Linux. DNSSEC . (nss(5)) glibc. NSS glibc nss-resolve(8) NSS glibc systemd-resolved. o systemd-resolved DNS stub IP 127.0.0.53 127.0.0.54 . DNS stub systemd-resolved. glibc NSS ( ) ( Unicode LLMNR) DNS . DNS (stub resolver) 127.0.0.53 LLMNR/MulticastDNS. DNS 127.0.0.54 "" DNS DNS DNSSEC LLMNR/MulticastDNS. ( DNS-over-TLS .) DNS /etc/systemd/resolved.conf /etc/systemd/network/*.network ( systemd-networkd.service(8)) DHCP resolvectl(1) DNS . resolved.conf(5) systemd.network(5) systemd DNS. /etc/resolv.conf DNS /run/systemd/resolve/stub-resolv.conf /usr/lib/systemd/resolv.conf /run/systemd/resolve/resolv.conf ( ). systemd-resolved DNS (RRs) : o IP -- -- IPv4 127.0.0.2 ( ) IPv6 ::1 ( ). o "localhost" "localhost.localdomain" ".localhost" ".localhost.localdomain" IP 127.0.0.1 ::1. o "_gateway" (metric) . . o "_outbound" IPv4 IPv6 . IP . . IP . o "_localdnsstub" IP 127.0.0.53 DNS stub ( ). o "_localdnsproxy" IP 127.0.0.54 DNS ( ). o /etc/hosts ( MX). /etc/hosts ReadEtcHosts=no resolved.conf(5). systemd-resolved.service DNS LLMNR MulticastDNS : o ( "localhost" "localdomain" ) /etc/hosts . o LLMNR LLMNR . IPv4 LLMNR IPv4 IPv6 LLMNR IPv6. LLMNR MulticastDNS DNS . o (A AAAA) DNS . . . . DNS ResolveUnicastSingleLabel=yes. . DNS . o ".local" MulticastDNS MulticastDNS . LLMNR IPv4 IPv4 IPv6 IPv6. o DNS DNS DNS . . ".local" DNS DNS . ".local" DNS DNS . ".local" DNS RFC6762[2] MulticastDNS . o ( ) DNS LLMNR MulticastDNS ( ). ( ). . ( ) . systemd.network(5) resolvectl(1) Domains= resolved.conf(5) DNS . DNS systemd-resolved.service: o (: ) ( ) DNS " ": . DNS DNS " ". ( " " ). . . glibc . o ( ) DNS DNS . o DNS DNS DNS . o DNS DNS . resolvectl default-route DNSDefaultRoute= .network. DNS : "~." . : . DNS "~." . ( ). DNS "~." . DNS . org.freedesktop.resolve1(5) D-Bus systemd-resolved. GLIBC STUB nss-resolve(8) systemd-resolved nss-dns. o ( ). nss-files /etc/hosts. . nss-dns systemd-resolved [3]. o A AAAA DNS ( ResolveUnicastSingleLabel= resolved.conf(5)). no-tld-query resolv.conf(5). o . ( .) (FQDN). nss-dns ( ) FQDN . . ndots /etc/resolv.conf . : FQDN.[4] o ".local" MulticastDNS DNS . DNS . o /etc/hosts . ( nss-resolve nss-files nss-dns). /etc/hosts . o LLMNR MulticastDNS DNS LLMNR ( ) ".local" MulticastDNS ( ). o $LOCALDOMAIN $RES_OPTIONS resolv.conf(5) . o nss-dns DNS DNS /etc/resolv.conf . systemd-resolved . . DNS DNS . /ETC/RESOLV.CONF /etc/resolv.conf ( resolv.conf(5)) : o systemd-resolved /run/systemd/resolve/stub-resolv.conf Linux . DNS stub 127.0.0.53 ( ) DNS . systemd-resolved. . /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf. /etc/resolv.conf DNS systemd-resolved . . o /usr/lib/systemd/resolv.conf DNS stub 127.0.0.53 ( ) DNS . /etc/resolv.conf DNS systemd-resolved. . o systemd-resolved /run/systemd/resolve/resolv.conf Linux . /etc/resolv.conf DNS . : DNS DNS . /run/systemd/resolve/resolv.conf /etc/resolv.conf. DNS systemd-resolved DNS . o /etc/resolv.conf systemd-resolved DNS. systemd-resolved . /etc/resolv.conf /run/systemd/resolve/resolv.conf 127.0.0.53 DNS. SIGUSR1 SIGUSR1 systemd-resolved DNS DNS . 231. SIGUSR2 SIGUSR2 systemd-resolved . u0628] u0625] systemd-resolved . systemd-resolved resolvectl flush-caches . 231. SIGRTMIN+1 SIGRTMIN+1 systemd-resolved DNS . . u0628] u0625] systemd-resolved DNS. systemd-resolved resolvectl reset-server-features . 235. SIGHUP SIGHUP systemd-resolved TCP ( ) . 256. systemd-resolved ImportCredential=/LoadCredential=/SetCredential= ( systemd.exec(5) ). : network.dns network.search_domains IP DNS DNS. /etc/systemd/resolved.conf /etc/resolv.conf . 253. systemd-resolved : nameserver= domain= IP DNS ( nameserver=) DNS ( domain=). DNS/ . /etc/resolv.conf DNS= Domains= resolved.conf(5). . 253. IP systemd-resolved IP : o 53 IPv4 127.0.0.53 127.0.0.54 ( "lo"). DNS stub . UDP TCP. o 5353 IPv4 IPv6 (0.0.0.0 ::0) MulticastDNS UDP. IP "" MulticastDNS MulticastDNS . o 5355 IPv4 IPv6 (0.0.0.0 ::0) LLMNR TCP UDP. MulticastDNS . systemd(1), resolved.conf(5), systemd.dns-delegate(5), systemd.dnssd(5), dnssec-trust-anchors.d(5), nss-resolve(8), resolvectl(1), resolv.conf(5), hosts(5), systemd.network(5), systemd-networkd.service(8), org.freedesktop.resolve1(5) 1. RFC3493 https://tools.ietf.org/html/rfc3493 2. RFC6762 https://tools.ietf.org/html/rfc6762 3. /etc/resolv.conf nameserver 127.0.0.53 search foobar.com barbar.com "localhost" nss-dns systemd-resolved 127.0.0.53:53: "localhost.foobar.com" "localhost.barbar.com" "localhost". ( ) systemd-resolved . nss-dns nss-files . 4. 1500 "" . : . . 3 . . : . systemd 260.2 SYSTEMD-RESOLVED.SERVICE(8)