Debian Codegraph @

upstream/debian-unstable/man8/systemd-resolved.service.8

raw
1 '\" t
2 .TH "SYSTEMD\-RESOLVED\&.SERVICE" "8" "" "systemd 261~rc3" "systemd-resolved.service"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-resolved.service, systemd-resolved \- Network Name Resolution manager
24 .SH "SYNOPSIS"
25 .PP
26 systemd\-resolved\&.service
27 .PP
28 /usr/lib/systemd/systemd\-resolved
29 .SH "DESCRIPTION"
30 .PP
31 \fBsystemd\-resolved\fR
32 is a system service that provides network name resolution to local applications\&. It implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR and MulticastDNS resolver and responder\&. Local applications may submit network name resolution requests via three interfaces:
33 .sp
34 .RS 4
35 .ie n \{\
36 \h'-04'\(bu\h'+03'\c
37 .\}
38 .el \{\
39 .sp -1
40 .IP \(bu 2.3
41 .\}
42 The native, fully\-featured API
43 \fBsystemd\-resolved\fR
44 exposes via D\-Bus, see
45 \fBorg.freedesktop.resolve1\fR(5)
46 and
47 \fBorg.freedesktop.LogControl1\fR(5)
48 for details\&. Usage of this API is generally recommended to clients as it is asynchronous and fully featured (for example, properly returns DNSSEC validation status and interface scope for addresses as necessary for supporting link\-local networking)\&.
49 .RE
50 .sp
51 .RS 4
52 .ie n \{\
53 \h'-04'\(bu\h'+03'\c
54 .\}
55 .el \{\
56 .sp -1
57 .IP \(bu 2.3
58 .\}
59 The native API
60 \fBsystemd\-resolved\fR
61 exposes via Varlink on the
62 /run/systemd/resolve/io\&.systemd\&.Resolve
63 AF_UNIX socket\&. This provides similar functionality as the D\-Bus interface, but is available during the entire runtime, without requiring a running D\-Bus system bus broker service\&.
64 .RE
65 .sp
66 .RS 4
67 .ie n \{\
68 \h'-04'\(bu\h'+03'\c
69 .\}
70 .el \{\
71 .sp -1
72 .IP \(bu 2.3
73 .\}
74 The glibc
75 \fBgetaddrinfo\fR(3)
76 API as defined by
77 \m[blue]\fBRFC3493\fR\m[]\&\s-2\u[1]\d\s+2
78 and its related resolver functions, including
79 \fBgethostbyname\fR(3)\&. This API is widely supported, including beyond the Linux platform\&. In its current form it does not expose DNSSEC validation status information however, and is synchronous only\&. This API is backed by the glibc Name Service Switch (\fBnss\fR(5))\&. Usage of the glibc NSS module
80 \fBnss-resolve\fR(8)
81 is required in order to allow glibc\*(Aqs NSS resolver functions to resolve hostnames via
82 \fBsystemd\-resolved\fR\&.
83 .RE
84 .sp
85 .RS 4
86 .ie n \{\
87 \h'-04'\(bu\h'+03'\c
88 .\}
89 .el \{\
90 .sp -1
91 .IP \(bu 2.3
92 .\}
93 Additionally,
94 \fBsystemd\-resolved\fR
95 provides a local DNS stub listener on the IP addresses 127\&.0\&.0\&.53 and 127\&.0\&.0\&.54 on the local loopback interface\&. Programs issuing DNS requests directly, bypassing any local API may be directed to this stub, in order to connect them to
96 \fBsystemd\-resolved\fR\&. Note however that it is strongly recommended that local programs use the glibc NSS or bus APIs instead (as described above), as various network resolution concepts (such as link\-local addressing, or LLMNR Unicode domains) cannot be mapped to the unicast DNS protocol\&.
97 .sp
98 The DNS stub resolver on 127\&.0\&.0\&.53 provides the full feature set of the local resolver, which includes offering LLMNR/MulticastDNS resolution\&. The DNS stub resolver on 127\&.0\&.0\&.54 provides a more limited resolver, that operates in "proxy" mode only, i\&.e\&. it will pass most DNS messages relatively unmodified to the current upstream DNS servers and back, but not try to process the messages locally, and hence does not validate DNSSEC, or offer up LLMNR/MulticastDNS\&. (It will translate to DNS\-over\-TLS communication if needed however\&.)
99 .RE
100 .PP
101 The DNS servers contacted are determined from the global settings in
102 /etc/systemd/resolved\&.conf, the per\-link static settings in
103 /etc/systemd/network/*\&.network
104 files (in case
105 \fBsystemd-networkd.service\fR(8)
106 is used), the per\-link dynamic settings received over DHCP, information provided via
107 \fBresolvectl\fR(1), and any DNS server information made available by other system services\&. See
108 \fBresolved.conf\fR(5)
109 and
110 \fBsystemd.network\fR(5)
111 for details about systemd\*(Aqs own configuration files for DNS servers\&. To improve compatibility,
112 /etc/resolv\&.conf
113 is read in order to discover configured system DNS servers, but only if it is not a symlink to
114 /run/systemd/resolve/stub\-resolv\&.conf,
115 /usr/lib/systemd/resolv\&.conf
116 or
117 /run/systemd/resolve/resolv\&.conf
118 (see below)\&.
119 .SH "SYNTHETIC RECORDS"
120 .PP
121 \fBsystemd\-resolved\fR
122 synthesizes DNS resource records (RRs) for the following cases:
123 .sp
124 .RS 4
125 .ie n \{\
126 \h'-04'\(bu\h'+03'\c
127 .\}
128 .el \{\
129 .sp -1
130 .IP \(bu 2.3
131 .\}
132 The local, configured hostname is resolved to all locally configured IP addresses ordered by their scope, or \(em if none are configured \(em the IPv4 address 127\&.0\&.0\&.2 (which is on the local loopback interface) and the IPv6 address ::1 (which is the local host)\&.
133 .RE
134 .sp
135 .RS 4
136 .ie n \{\
137 \h'-04'\(bu\h'+03'\c
138 .\}
139 .el \{\
140 .sp -1
141 .IP \(bu 2.3
142 .\}
143 The hostnames
144 "localhost"
145 and
146 "localhost\&.localdomain"
147 as well as any hostname ending in
148 "\&.localhost"
149 or
150 "\&.localhost\&.localdomain"
151 are resolved to the IP addresses 127\&.0\&.0\&.1 and ::1\&.
152 .RE
153 .sp
154 .RS 4
155 .ie n \{\
156 \h'-04'\(bu\h'+03'\c
157 .\}
158 .el \{\
159 .sp -1
160 .IP \(bu 2.3
161 .\}
162 The hostname
163 "_gateway"
164 is 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\&.
165 .RE
166 .sp
167 .RS 4
168 .ie n \{\
169 \h'-04'\(bu\h'+03'\c
170 .\}
171 .el \{\
172 .sp -1
173 .IP \(bu 2.3
174 .\}
175 The hostname
176 "_outbound"
177 is resolved to the local IPv4 and IPv6 addresses that are most likely used for communication with other hosts\&. This is the preferred source addresses of default gateways if specified, or determined by requesting a routing decision to the configured default gateways from the kernel and then using the local IP addresses selected by this decision\&. This hostname is only available if there is at least one local default gateway configured\&. This assigns a stable hostname to the local outbound IP addresses, useful for referencing them independently of the current network configuration state\&.
178 .RE
179 .sp
180 .RS 4
181 .ie n \{\
182 \h'-04'\(bu\h'+03'\c
183 .\}
184 .el \{\
185 .sp -1
186 .IP \(bu 2.3
187 .\}
188 The hostname
189 "_localdnsstub"
190 is resolved to the IP address 127\&.0\&.0\&.53, i\&.e\&. the address the local DNS stub (see above) is listening on\&.
191 .RE
192 .sp
193 .RS 4
194 .ie n \{\
195 \h'-04'\(bu\h'+03'\c
196 .\}
197 .el \{\
198 .sp -1
199 .IP \(bu 2.3
200 .\}
201 The hostname
202 "_localdnsproxy"
203 is resolved to the IP address 127\&.0\&.0\&.54, i\&.e\&. the address the local DNS proxy (see above) is listening on\&.
204 .RE
205 .sp
206 .RS 4
207 .ie n \{\
208 \h'-04'\(bu\h'+03'\c
209 .\}
210 .el \{\
211 .sp -1
212 .IP \(bu 2.3
213 .\}
214 The files matching
215 /etc/systemd/resolve/static\&.d/*\&.rr,
216 /run/systemd/resolve/static\&.d/*\&.rr,
217 /usr/local/lib/systemd/resolve/static\&.d/*\&.rr,
218 /usr/lib/systemd/resolve/static\&.d/*\&.rr
219 may be used to define arbitrary records\&. See
220 \fBsystemd.rr\fR(5)
221 for details\&. Support for this may be disabled with
222 \fIReadStaticRecords=no\fR, see
223 \fBresolved.conf\fR(5)\&.
224 .RE
225 .sp
226 .RS 4
227 .ie n \{\
228 \h'-04'\(bu\h'+03'\c
229 .\}
230 .el \{\
231 .sp -1
232 .IP \(bu 2.3
233 .\}
234 The mappings defined in
235 /etc/hosts
236 are resolved to their configured addresses and back, but they will not affect lookups for non\-address types (like MX)\&. Support for
237 /etc/hosts
238 may be disabled with
239 \fIReadEtcHosts=no\fR, see
240 \fBresolved.conf\fR(5)\&.
241 .RE
242 .SH "PROTOCOLS AND ROUTING"
243 .PP
244 The lookup requests that
245 systemd\-resolved\&.service
246 receives are routed to the available DNS servers, LLMNR, and MulticastDNS interfaces according to the following rules:
247 .sp
248 .RS 4
249 .ie n \{\
250 \h'-04'\(bu\h'+03'\c
251 .\}
252 .el \{\
253 .sp -1
254 .IP \(bu 2.3
255 .\}
256 Names for which synthetic records are generated (the local hostname,
257 "localhost"
258 and
259 "localdomain", local gateway, as listed in the previous section) and addresses configured in
260 /etc/hosts
261 are never routed to the network and a reply is sent immediately\&.
262 .RE
263 .sp
264 .RS 4
265 .ie n \{\
266 \h'-04'\(bu\h'+03'\c
267 .\}
268 .el \{\
269 .sp -1
270 .IP \(bu 2.3
271 .\}
272 Single\-label names are resolved using LLMNR on all local interfaces where LLMNR is enabled\&. Lookups for IPv4 addresses are only sent via LLMNR on IPv4, and lookups for IPv6 addresses are only sent via LLMNR on IPv6\&. Note that lookups for single\-label synthesized names are not routed to LLMNR, MulticastDNS or unicast DNS\&.
273 .RE
274 .sp
275 .RS 4
276 .ie n \{\
277 \h'-04'\(bu\h'+03'\c
278 .\}
279 .el \{\
280 .sp -1
281 .IP \(bu 2.3
282 .\}
283 Queries for the address records (A and AAAA) of single\-label non\-synthesized names are resolved via unicast DNS using search domains\&. For any interface which defines search domains, such look\-ups are routed to the servers defined for that interface, suffixed with each of those search domains\&. When global search domains are defined, such look\-ups are routed to the global servers\&. For each search domain, queries are performed by suffixing the name with each of the search domains in turn\&. Additionally, lookup of single\-label names via unicast DNS may be enabled with the
284 \fIResolveUnicastSingleLabel=yes\fR
285 setting\&. The details of which servers are queried and how the final reply is chosen are described below\&. Note that this means that address queries for single\-label names are never sent out to remote DNS servers by default, and resolution is only possible if search domains are defined\&.
286 .RE
287 .sp
288 .RS 4
289 .ie n \{\
290 \h'-04'\(bu\h'+03'\c
291 .\}
292 .el \{\
293 .sp -1
294 .IP \(bu 2.3
295 .\}
296 Multi\-label names with the domain suffix
297 "\&.local"
298 are resolved using MulticastDNS on all local interfaces where MulticastDNS is enabled\&. As with LLMNR, IPv4 address lookups are sent via IPv4 and IPv6 address lookups are sent via IPv6\&.
299 .RE
300 .sp
301 .RS 4
302 .ie n \{\
303 \h'-04'\(bu\h'+03'\c
304 .\}
305 .el \{\
306 .sp -1
307 .IP \(bu 2.3
308 .\}
309 Queries for multi\-label names are routed via unicast DNS on local interfaces that have a DNS server configured, plus the globally configured DNS servers if there are any\&. Which interfaces are used is determined by the routing logic based on search and route\-only domains, described below\&. Note that by default, lookups for domains with the
310 "\&.local"
311 suffix are not routed to DNS servers, unless the domain is specified explicitly as routing or search domain for the DNS server and interface\&. This means that on networks where the
312 "\&.local"
313 domain is defined in a site\-specific DNS server, explicit search or routing domains need to be configured to make lookups work within this DNS domain\&. Note that these days, it is generally recommended to avoid defining
314 "\&.local"
315 in a DNS server, as
316 \m[blue]\fBRFC6762\fR\m[]\&\s-2\u[2]\d\s+2
317 reserves this domain for exclusive MulticastDNS use\&.
318 .RE
319 .sp
320 .RS 4
321 .ie n \{\
322 \h'-04'\(bu\h'+03'\c
323 .\}
324 .el \{\
325 .sp -1
326 .IP \(bu 2.3
327 .\}
328 Address lookups (reverse lookups) are routed similarly to multi\-label names, with the exception that addresses from the link\-local address range are never routed to unicast DNS and are only resolved using LLMNR and MulticastDNS (when enabled)\&.
329 .RE
330 .PP
331 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\&.
332 .PP
333 Routing of lookups is determined by the per\-interface routing domains (search and route\-only) and global search domains\&. See
334 \fBsystemd.network\fR(5)
335 and
336 \fBresolvectl\fR(1)
337 for a description how those settings are set dynamically and the discussion of
338 \fIDomains=\fR
339 in
340 \fBresolved.conf\fR(5)
341 for a description of globally configured DNS settings\&.
342 .PP
343 The following query routing logic applies for unicast DNS lookups initiated by
344 systemd\-resolved\&.service:
345 .sp
346 .RS 4
347 .ie n \{\
348 \h'-04'\(bu\h'+03'\c
349 .\}
350 .el \{\
351 .sp -1
352 .IP \(bu 2.3
353 .\}
354 If a name to look up matches (that is: is equal to or has as suffix) any of the configured routing domains (search or route\-only) of any link, or the globally configured DNS settings, "best matching" routing domain is determined: the matching one with the most labels\&. The query is then sent to all DNS servers of any links or the globally configured DNS servers associated with this "best matching" routing domain\&. (Note that more than one link might have this same "best matching" routing domain configured, in which case the query is sent to all of them in parallel)\&.
355 .sp
356 In case of single\-label names, when search domains are defined, the same logic applies, except that the name is first suffixed by each of the search domains in turn\&. Note that this search logic does not apply to any names with at least one dot\&. Also see the discussion about compatibility with the traditional glibc resolver below\&.
357 .RE
358 .sp
359 .RS 4
360 .ie n \{\
361 \h'-04'\(bu\h'+03'\c
362 .\}
363 .el \{\
364 .sp -1
365 .IP \(bu 2.3
366 .\}
367 If a query does not match any configured routing domain (either per\-link or global), it is sent to all DNS servers that are configured on links configured as the default route, as well as the globally configured DNS server\&.
368 .RE
369 .sp
370 .RS 4
371 .ie n \{\
372 \h'-04'\(bu\h'+03'\c
373 .\}
374 .el \{\
375 .sp -1
376 .IP \(bu 2.3
377 .\}
378 If there are no DNS servers configured on any link also configured as the default route and no global DNS server configured, one of the compiled\-in fallback DNS servers is used\&.
379 .RE
380 .sp
381 .RS 4
382 .ie n \{\
383 \h'-04'\(bu\h'+03'\c
384 .\}
385 .el \{\
386 .sp -1
387 .IP \(bu 2.3
388 .\}
389 Otherwise, the unicast DNS query fails, as no suitable DNS servers can be determined\&.
390 .RE
391 .PP
392 Whether a link is the default route or not can be configured with
393 \fBresolvectl default\-route\fR
394 command or
395 \fIDNSDefaultRoute=\fR
396 setting in
397 \&.network
398 files\&. If not configured explicitly, it is implicitly determined based on the configured DNS domains for a link: if there\*(Aqs a route\-only domain other than
399 "~\&.", it defaults to false, otherwise to true\&.
400 .PP
401 Effectively this means: in order to support single\-label non\-synthesized names, define appropriate search domains\&. In order to preferably route all DNS queries not explicitly matched by routing domain configuration to a specific link, configure a
402 "~\&."
403 route\-only domain on it\&. This will ensure that other links will not be considered for these queries (unless they too carry such a routing domain)\&. In order to route all such DNS queries to a specific link only if no other link is preferred, configure the link as the default route and do not configure a
404 "~\&."
405 route\-only domain on it\&. Finally, in order to avoid a specific link receiving any DNS traffic not matching any of its configured routing domains, do not make it a default route\&.
406 .PP
407 See
408 \fBorg.freedesktop.resolve1\fR(5)
409 for information about the D\-Bus APIs
410 \fBsystemd\-resolved\fR
411 provides\&.
412 .SH "COMPATIBILITY WITH THE TRADITIONAL GLIBC STUB RESOLVER"
413 .PP
414 This section provides a short summary of differences in the resolver implemented by
415 \fBnss-resolve\fR(8)
416 together with
417 \fBsystemd\-resolved\fR
418 and the traditional stub resolver implemented in
419 nss\-dns\&.
420 .sp
421 .RS 4
422 .ie n \{\
423 \h'-04'\(bu\h'+03'\c
424 .\}
425 .el \{\
426 .sp -1
427 .IP \(bu 2.3
428 .\}
429 Some names are always resolved internally (see Synthetic Records above)\&. Traditionally they would be resolved by
430 nss\-files
431 if provided in
432 /etc/hosts\&. But note that the details of how a query is constructed are under the control of the client library\&.
433 nss\-dns
434 will first try to resolve names using search domains and even if those queries are routed to
435 systemd\-resolved, it will send them out over the network using the usual rules for multi\-label name routing
436 \&\s-2\u[3]\d\s+2\&.
437 .RE
438 .sp
439 .RS 4
440 .ie n \{\
441 \h'-04'\(bu\h'+03'\c
442 .\}
443 .el \{\
444 .sp -1
445 .IP \(bu 2.3
446 .\}
447 Single\-label names are not resolved for A and AAAA records using unicast DNS (unless overridden with
448 \fIResolveUnicastSingleLabel=\fR, see
449 \fBresolved.conf\fR(5))\&. This is similar to the
450 \fBno\-tld\-query\fR
451 option being set in
452 \fBresolv.conf\fR(5)\&.
453 .RE
454 .sp
455 .RS 4
456 .ie n \{\
457 \h'-04'\(bu\h'+03'\c
458 .\}
459 .el \{\
460 .sp -1
461 .IP \(bu 2.3
462 .\}
463 Search domains are not used for
464 \fIsuffixing\fR
465 of multi\-label names\&. (Search domains are nevertheless used for lookup
466 \fIrouting\fR, for names that were originally specified as single\-label or multi\-label\&.) Any name with at least one dot is always interpreted as a FQDN\&.
467 nss\-dns
468 would resolve names both as relative (using search domains) and absolute FQDN names\&. Some names would be resolved as relative first, and after that query has failed, as absolute, while other names would be resolved in opposite order\&. The
469 \fIndots\fR
470 option in
471 /etc/resolv\&.conf
472 was used to control how many dots the name needs to have to be resolved as relative first\&. This stub resolver does not implement this at all: multi\-label names are only resolved as FQDNs\&.\&\s-2\u[4]\d\s+2
473 .RE
474 .sp
475 .RS 4
476 .ie n \{\
477 \h'-04'\(bu\h'+03'\c
478 .\}
479 .el \{\
480 .sp -1
481 .IP \(bu 2.3
482 .\}
483 This resolver has a notion of the special
484 "\&.local"
485 domain used for MulticastDNS, and will not route queries with that suffix to unicast DNS servers unless explicitly configured, see above\&. Also, reverse lookups for link\-local addresses are not sent to unicast DNS servers\&.
486 .RE
487 .sp
488 .RS 4
489 .ie n \{\
490 \h'-04'\(bu\h'+03'\c
491 .\}
492 .el \{\
493 .sp -1
494 .IP \(bu 2.3
495 .\}
496 This resolver reads and caches
497 /etc/hosts
498 internally\&. (In other words,
499 nss\-resolve
500 replaces
501 nss\-files
502 in addition to
503 nss\-dns)\&. Entries in
504 /etc/hosts
505 have highest priority\&.
506 .RE
507 .sp
508 .RS 4
509 .ie n \{\
510 \h'-04'\(bu\h'+03'\c
511 .\}
512 .el \{\
513 .sp -1
514 .IP \(bu 2.3
515 .\}
516 This resolver also implements LLMNR and MulticastDNS in addition to the classic unicast DNS protocol, and will resolve single\-label names using LLMNR (when enabled) and names ending in
517 "\&.local"
518 using MulticastDNS (when enabled)\&.
519 .RE
520 .sp
521 .RS 4
522 .ie n \{\
523 \h'-04'\(bu\h'+03'\c
524 .\}
525 .el \{\
526 .sp -1
527 .IP \(bu 2.3
528 .\}
529 Environment variables
530 \fI$LOCALDOMAIN\fR
531 and
532 \fI$RES_OPTIONS\fR
533 described in
534 \fBresolv.conf\fR(5)
535 are not supported currently\&.
536 .RE
537 .sp
538 .RS 4
539 .ie n \{\
540 \h'-04'\(bu\h'+03'\c
541 .\}
542 .el \{\
543 .sp -1
544 .IP \(bu 2.3
545 .\}
546 The
547 nss\-dns
548 resolver maintains little state between subsequent DNS queries, and for each query always talks to the first listed DNS server from
549 /etc/resolv\&.conf
550 first, and on failure continues with the next until reaching the end of the list which is when the query fails\&. The resolver in
551 \fBsystemd\-resolved\fR
552 however maintains state, and will continuously talk to the same server for all queries in a particular lookup scope until some form of error is seen at which point it will switch to the next server, and then stay with it for all queries on the scope until the next failure, and so on, eventually returning to the first configured server\&. This is done to optimize lookup times, in particular given that the resolver typically must first probe server feature sets when talking to a server, which takes time\&. This different behaviour implies that listed DNS servers per lookup scope must be equivalent in the zones they serve, so that sending a query to one of them will yield the same results as sending it to another configured DNS server\&.
553 .RE
554 .SH "/ETC/RESOLV\&.CONF"
555 .PP
556 Four modes of handling
557 /etc/resolv\&.conf
558 (see
559 \fBresolv.conf\fR(5)) are supported:
560 .sp
561 .RS 4
562 .ie n \{\
563 \h'-04'\(bu\h'+03'\c
564 .\}
565 .el \{\
566 .sp -1
567 .IP \(bu 2.3
568 .\}
569 \fBsystemd\-resolved\fR
570 maintains the
571 /run/systemd/resolve/stub\-resolv\&.conf
572 file for compatibility with traditional Linux programs\&. This file lists the 127\&.0\&.0\&.53 DNS stub (see above) as the only DNS server\&. It also contains a list of search domains that are in use by
573 \fBsystemd\-resolved\fR\&. The list of search domains is always kept up\-to\-date\&. Note that
574 /run/systemd/resolve/stub\-resolv\&.conf
575 should not be used directly by applications, but only through a symlink from
576 /etc/resolv\&.conf\&. This file may be symlinked from
577 /etc/resolv\&.conf
578 in order to connect all local clients that bypass local DNS APIs to
579 \fBsystemd\-resolved\fR
580 with correct search domains settings\&. This mode of operation is recommended\&.
581 .RE
582 .sp
583 .RS 4
584 .ie n \{\
585 \h'-04'\(bu\h'+03'\c
586 .\}
587 .el \{\
588 .sp -1
589 .IP \(bu 2.3
590 .\}
591 A static file
592 /usr/lib/systemd/resolv\&.conf
593 is provided that lists the 127\&.0\&.0\&.53 DNS stub (see above) as only DNS server\&. This file may be symlinked from
594 /etc/resolv\&.conf
595 in order to connect all local clients that bypass local DNS APIs to
596 \fBsystemd\-resolved\fR\&. This file does not contain any search domains\&.
597 .RE
598 .sp
599 .RS 4
600 .ie n \{\
601 \h'-04'\(bu\h'+03'\c
602 .\}
603 .el \{\
604 .sp -1
605 .IP \(bu 2.3
606 .\}
607 \fBsystemd\-resolved\fR
608 maintains the
609 /run/systemd/resolve/resolv\&.conf
610 file for compatibility with traditional Linux programs\&. This file may be symlinked from
611 /etc/resolv\&.conf
612 and is always kept up\-to\-date, containing information about all known DNS servers\&. Note the file format\*(Aqs limitations: it does not know a concept of per\-interface DNS servers and hence only contains system\-wide DNS server definitions\&. Note that
613 /run/systemd/resolve/resolv\&.conf
614 should not be used directly by applications, but only through a symlink from
615 /etc/resolv\&.conf\&. If this mode of operation is used local clients that bypass any local DNS API will also bypass
616 \fBsystemd\-resolved\fR
617 and will talk directly to the known DNS servers\&.
618 .RE
619 .sp
620 .RS 4
621 .ie n \{\
622 \h'-04'\(bu\h'+03'\c
623 .\}
624 .el \{\
625 .sp -1
626 .IP \(bu 2.3
627 .\}
628 Alternatively,
629 /etc/resolv\&.conf
630 may be managed by other packages, in which case
631 \fBsystemd\-resolved\fR
632 will read it for DNS configuration data\&. In this mode of operation
633 \fBsystemd\-resolved\fR
634 is consumer rather than provider of this configuration file\&.
635 .RE
636 .PP
637 Note that the selected mode of operation for this file is detected fully automatically, depending on whether
638 /etc/resolv\&.conf
639 is a symlink to
640 /run/systemd/resolve/resolv\&.conf
641 or lists 127\&.0\&.0\&.53 as DNS server\&.
642 .SH "SIGNALS"
643 .PP
644 \fBSIGUSR1\fR
645 .RS 4
646 Upon reception of the
647 \fBSIGUSR1\fR
648 process signal
649 \fBsystemd\-resolved\fR
650 will dump the contents of all DNS resource record caches it maintains, as well as all feature level information it learnt about configured DNS servers into the system logs\&.
651 .sp
652 Added in version 231\&.
653 .RE
654 .PP
655 \fBSIGUSR2\fR
656 .RS 4
657 Upon reception of the
658 \fBSIGUSR2\fR
659 process signal
660 \fBsystemd\-resolved\fR
661 will flush all caches it maintains\&. Note that it should normally not be necessary to request this explicitly \(en except for debugging purposes \(en as
662 \fBsystemd\-resolved\fR
663 flushes the caches automatically anyway any time the host\*(Aqs network configuration changes\&. Sending this signal to
664 \fBsystemd\-resolved\fR
665 is equivalent to the
666 \fBresolvectl flush\-caches\fR
667 command, however the latter is recommended since it operates in a synchronous way\&.
668 .sp
669 Added in version 231\&.
670 .RE
671 .PP
672 \fBSIGRTMIN+1\fR
673 .RS 4
674 Upon reception of the
675 \fBSIGRTMIN+1\fR
676 process signal
677 \fBsystemd\-resolved\fR
678 will forget everything it learnt about the configured DNS servers\&. Specifically any information about server feature support is flushed out, and the server feature probing logic is restarted on the next request, starting with the most fully featured level\&. Note that it should normally not be necessary to request this explicitly \(en except for debugging purposes \(en as
679 \fBsystemd\-resolved\fR
680 automatically forgets learnt information any time the DNS server configuration changes\&. Sending this signal to
681 \fBsystemd\-resolved\fR
682 is equivalent to the
683 \fBresolvectl reset\-server\-features\fR
684 command, however the latter is recommended since it operates in a synchronous way\&.
685 .sp
686 Added in version 235\&.
687 .RE
688 .PP
689 \fBSIGHUP\fR
690 .RS 4
691 Upon reception of the
692 \fBSIGHUP\fR
693 process signal
694 \fBsystemd\-resolved\fR
695 will flush all caches it maintains, drop all open TCP connections (if any), and reload its configuration files\&.
696 .sp
697 Added in version 256\&.
698 .RE
699 .SH "CREDENTIALS"
700 .PP
701 \fBsystemd\-resolved\fR
702 supports the service credentials logic as implemented by
703 \fIImportCredential=\fR/\fILoadCredential=\fR/\fISetCredential=\fR
704 (see
705 \fBsystemd.exec\fR(5)
706 for details)\&. The following credentials are used when passed in:
707 .PP
708 \fInetwork\&.dns\fR, \fInetwork\&.search_domains\fR
709 .RS 4
710 May contain a space separated list of DNS server IP addresses and DNS search domains\&. This information is only used when no explicit configuration via
711 /etc/systemd/resolved\&.conf,
712 /etc/resolv\&.conf
713 or the kernel command line has been provided\&.
714 .sp
715 Added in version 253\&.
716 .RE
717 .SH "KERNEL COMMAND LINE"
718 .PP
719 \fBsystemd\-resolved\fR
720 also honours two kernel command line options:
721 .PP
722 \fInameserver=\fR, \fIdomain=\fR
723 .RS 4
724 Takes the IP address of a DNS server (in case of
725 \fInameserver=\fR), and a DNS search domain (in case of
726 \fIdomain=\fR)\&. May be used multiple times, to define multiple DNS servers/search domains\&. If either of these options are specified
727 /etc/resolv\&.conf
728 will not be read and the
729 \fIDNS=\fR
730 and
731 \fIDomains=\fR
732 settings of
733 \fBresolved.conf\fR(5)
734 will be ignored\&. These two kernel command line options hence override system configuration\&.
735 .sp
736 Added in version 253\&.
737 .RE
738 .SH "IP PORTS"
739 .PP
740 The
741 \fBsystemd\-resolved\fR
742 service listens on the following IP ports:
743 .sp
744 .RS 4
745 .ie n \{\
746 \h'-04'\(bu\h'+03'\c
747 .\}
748 .el \{\
749 .sp -1
750 .IP \(bu 2.3
751 .\}
752 Port 53 on IPv4 addresses 127\&.0\&.0\&.53 and 127\&.0\&.0\&.54 (both are on the local loopback interface
753 "lo")\&. This is the local DNS stub, as discussed above\&. Both UDP and TCP are covered\&.
754 .RE
755 .sp
756 .RS 4
757 .ie n \{\
758 \h'-04'\(bu\h'+03'\c
759 .\}
760 .el \{\
761 .sp -1
762 .IP \(bu 2.3
763 .\}
764 Port 5353 on all local addresses, both IPv4 and IPv6 (0\&.0\&.0\&.0 and ::0), for MulticastDNS on UDP\&. Note that even though the socket is bound to all local interfaces via the selected "wildcard" IP addresses, the incoming datagrams are filtered by the network interface they are coming in on, and separate MulticastDNS link\-local scopes are maintained for each, taking into consideration whether MulticastDNS is enabled for the interface or not\&.
765 .RE
766 .sp
767 .RS 4
768 .ie n \{\
769 \h'-04'\(bu\h'+03'\c
770 .\}
771 .el \{\
772 .sp -1
773 .IP \(bu 2.3
774 .\}
775 Port 5355 on all local addresses, both IPv4 and IP6 (0\&.0\&.0\&.0 and ::0), for LLMNR, on both TCP and UDP\&. As with MulticastDNS filtering by incoming network interface is applied\&.
776 .RE
777 .SH "SEE ALSO"
778 .PP
779 \fBsystemd\fR(1), \fBresolved.conf\fR(5), \fBsystemd.dns-delegate\fR(5), \fBsystemd.rr\fR(5), \fBsystemd.dnssd\fR(5), \fBdnssec-trust-anchors.d\fR(5), \fBnss-resolve\fR(8), \fBresolvectl\fR(1), \fBresolv.conf\fR(5), \fBhosts\fR(5), \fBsystemd.network\fR(5), \fBsystemd-networkd.service\fR(8), \fBorg.freedesktop.resolve1\fR(5)
780 .SH "NOTES"
781 .IP " 1." 4
782 RFC3493
783 .RS 4
784 \%https://tools.ietf.org/html/rfc3493
785 .RE
786 .IP " 2." 4
787 RFC6762
788 .RS 4
789 \%https://tools.ietf.org/html/rfc6762
790 .RE
791 .IP " 3." 4
792 For example, if
793 /etc/resolv.conf
794 has
795 .sp
796 .RS 4
797 .if n \{\
798 .RS 4
799 .\}
800 .nf
801 nameserver 127.0.0.53
802 search foobar.com barbar.com
803 .fi
804 .if n \{\
805 .RE
806 .\}
807 .sp
808 and we look up
809 "localhost",
810 nss-dns
811 will send the following queries to
812 systemd-resolved
813 listening on 127.0.0.53:53: first
814 "localhost.foobar.com", then
815 "localhost.barbar.com", and finally
816 "localhost". If (hopefully) the first two queries fail,
817 systemd-resolved
818 will synthesize an answer for the third query.
819 .RE
820 .sp
821 .RS 4n
822 When using
823 nss-dns
824 with any search domains, it is thus crucial to always configure
825 nss-files
826 with higher priority and provide mappings for names that should not be resolved using search domains.
827 .RE
828 .IP " 4." 4
829 There are currently more than 1500 top-level domain names defined, and new ones are added regularly, often using "attractive" names that are also likely to be used locally. Not looking up multi-label names in this fashion avoids fragility in both directions: a valid global name could be obscured by a local name, and resolution of a relative local name could suddenly break when a new top-level domain is created, or when a new subdomain of a top-level domain in registered. Resolving any given name as either relative or absolute avoids this ambiguity.
830