Debian Codegraph @

upstream/debian-trixie/man5/org.freedesktop.resolve1.5

raw
1 '\" t
2 .TH "ORG\&.FREEDESKTOP\&.RESOLVE1" "5" "" "systemd 257.13" "org.freedesktop.resolve1"
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 org.freedesktop.resolve1 \- The D\-Bus interface of systemd\-resolved
24 .SH "INTRODUCTION"
25 .PP
26 \fBsystemd-resolved.service\fR(8)
27 is a system service that provides hostname resolution and caching using DNS, LLMNR, and mDNS\&. It also does DNSSEC validation\&. This page describes the resolve semantics and the D\-Bus interface\&.
28 .PP
29 This page contains an API reference only\&. If you are looking for a longer explanation how to use this API, please consult
30 \m[blue]\fBWriting Network Configuration Managers\fR\m[]\&\s-2\u[1]\d\s+2
31 and
32 \m[blue]\fBWriting Resolver Clients\fR\m[]\&\s-2\u[2]\d\s+2\&.
33 .SH "THE MANAGER OBJECT"
34 .PP
35 The service exposes the following interfaces on the Manager object on the bus:
36 .sp
37 .if n \{\
38 .RS 4
39 .\}
40 .nf
41 node /org/freedesktop/resolve1 {
42 interface org\&.freedesktop\&.resolve1\&.Manager {
43 methods:
44 ResolveHostname(in i ifindex,
45 in s name,
46 in i family,
47 in t flags,
48 out a(iiay) addresses,
49 out s canonical,
50 out t flags);
51 ResolveAddress(in i ifindex,
52 in i family,
53 in ay address,
54 in t flags,
55 out a(is) names,
56 out t flags);
57 ResolveRecord(in i ifindex,
58 in s name,
59 in q class,
60 in q type,
61 in t flags,
62 out a(iqqay) records,
63 out t flags);
64 ResolveService(in i ifindex,
65 in s name,
66 in s type,
67 in s domain,
68 in i family,
69 in t flags,
70 out a(qqqsa(iiay)s) srv_data,
71 out aay txt_data,
72 out s canonical_name,
73 out s canonical_type,
74 out s canonical_domain,
75 out t flags);
76 GetLink(in i ifindex,
77 out o path);
78 SetLinkDNS(in i ifindex,
79 in a(iay) addresses);
80 SetLinkDNSEx(in i ifindex,
81 in a(iayqs) addresses);
82 SetLinkDomains(in i ifindex,
83 in a(sb) domains);
84 SetLinkDefaultRoute(in i ifindex,
85 in b enable);
86 SetLinkLLMNR(in i ifindex,
87 in s mode);
88 SetLinkMulticastDNS(in i ifindex,
89 in s mode);
90 SetLinkDNSOverTLS(in i ifindex,
91 in s mode);
92 SetLinkDNSSEC(in i ifindex,
93 in s mode);
94 SetLinkDNSSECNegativeTrustAnchors(in i ifindex,
95 in as names);
96 RevertLink(in i ifindex);
97 RegisterService(in s id,
98 in s name_template,
99 in s type,
100 in q service_port,
101 in q service_priority,
102 in q service_weight,
103 in aa{say} txt_datas,
104 out o service_path);
105 UnregisterService(in o service_path);
106 ResetStatistics();
107 FlushCaches();
108 ResetServerFeatures();
109 properties:
110 readonly s LLMNRHostname = \*(Aq\&.\&.\&.\*(Aq;
111 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
112 readonly s LLMNR = \*(Aq\&.\&.\&.\*(Aq;
113 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
114 readonly s MulticastDNS = \*(Aq\&.\&.\&.\*(Aq;
115 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
116 readonly s DNSOverTLS = \*(Aq\&.\&.\&.\*(Aq;
117 readonly a(iiay) DNS = [\&.\&.\&.];
118 readonly a(iiayqs) DNSEx = [\&.\&.\&.];
119 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
120 readonly a(iiay) FallbackDNS = [\&.\&.\&.];
121 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
122 readonly a(iiayqs) FallbackDNSEx = [\&.\&.\&.];
123 readonly (iiay) CurrentDNSServer = \&.\&.\&.;
124 readonly (iiayqs) CurrentDNSServerEx = \&.\&.\&.;
125 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
126 readonly a(isb) Domains = [\&.\&.\&.];
127 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
128 readonly (tt) TransactionStatistics = \&.\&.\&.;
129 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
130 readonly (ttt) CacheStatistics = \&.\&.\&.;
131 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
132 readonly s DNSSEC = \*(Aq\&.\&.\&.\*(Aq;
133 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
134 readonly (tttt) DNSSECStatistics = \&.\&.\&.;
135 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
136 readonly b DNSSECSupported = \&.\&.\&.;
137 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
138 readonly as DNSSECNegativeTrustAnchors = [\*(Aq\&.\&.\&.\*(Aq, \&.\&.\&.];
139 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
140 readonly s DNSStubListener = \*(Aq\&.\&.\&.\*(Aq;
141 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
142 readonly s ResolvConfMode = \*(Aq\&.\&.\&.\*(Aq;
143 };
144 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
145 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
146 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
147 };
148 .fi
149 .if n \{\
150 .RE
151 .\}
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192 .SS "Methods"
193 .PP
194 \fBResolveHostname()\fR
195 takes a hostname and resolves it to one or more IP addresses\&. As parameters it takes the Linux network interface index to execute the query on, or 0 if it may be done on any suitable interface\&. The
196 \fIname\fR
197 parameter specifies the hostname to resolve\&. Note that if required, IDNA conversion is applied to this name unless it is resolved via LLMNR or MulticastDNS\&. The
198 \fIfamily\fR
199 parameter limits the results to a specific address family\&. It may be
200 \fBAF_INET\fR,
201 \fBAF_INET6\fR
202 or
203 \fBAF_UNSPEC\fR\&. If
204 \fBAF_UNSPEC\fR
205 is specified (recommended), both kinds are retrieved, subject to local network configuration (i\&.e\&. if no local, routable IPv6 address is found, no IPv6 address is retrieved; and similarly for IPv4)\&. A 64\-bit
206 \fIflags\fR
207 field may be used to alter the behaviour of the resolver operation (see below)\&. The method returns an array of address records\&. Each address record consists of the interface index the address belongs to, an address family as well as a byte array with the actual IP address data (which either has 4 or 16 elements, depending on the address family)\&. The returned address family will be one of
208 \fBAF_INET\fR
209 or
210 \fBAF_INET6\fR\&. For IPv6, the returned address interface index should be used to initialize the \&.sin6_scope_id field of a
211 struct\ \&sockaddr_in6
212 instance to permit support for resolution to link\-local IP addresses\&. The address array is followed by the canonical name of the host, which may or may not be identical to the resolved hostname\&. Finally, a 64\-bit
213 \fIflags\fR
214 field is returned that is defined similarly to the
215 \fIflags\fR
216 field that was passed in, but contains information about the resolved data (see below)\&. If the hostname passed in is an IPv4 or IPv6 address formatted as string, it is parsed, and the result is returned\&. In this case, no network communication is done\&.
217 .PP
218 \fBResolveAddress()\fR
219 executes the reverse operation: it takes an IP address and acquires one or more hostnames for it\&. As parameters it takes the interface index to execute the query on, or
220 \fB0\fR
221 if all suitable interfaces are OK\&. The
222 \fIfamily\fR
223 parameter indicates the address family of the IP address to resolve\&. It may be either
224 \fBAF_INET\fR
225 or
226 \fBAF_INET6\fR\&. The
227 \fIaddress\fR
228 parameter takes the raw IP address data (as either a 4 or 16 byte array)\&. The
229 \fIflags\fR
230 input parameter may be used to alter the resolver operation (see below)\&. The method returns an array of name records, each consisting of an interface index and a hostname\&. The
231 \fIflags\fR
232 output field contains additional information about the resolver operation (see below)\&.
233 .PP
234 \fBResolveRecord()\fR
235 takes a DNS resource record (RR) type, class and name, and retrieves the full resource record set (RRset), including the RDATA, for it\&. As parameter it takes the Linux network interface index to execute the query on, or
236 \fB0\fR
237 if it may be done on any suitable interface\&. The
238 \fIname\fR
239 parameter specifies the RR domain name to look up (no IDNA conversion is applied), followed by the 16\-bit class and type fields (which may be ANY)\&. Finally, a
240 \fIflags\fR
241 field may be passed in to alter behaviour of the look\-up (see below)\&. On completion, an array of RR items is returned\&. Each array entry consists of the network interface index the RR was discovered on, the class and type field of the RR found, and a byte array of the raw RR discovered\&. The raw RR data starts with the RR\*(Aqs domain name, in the original casing, followed by the RR type, class, TTL and RDATA, in the binary format documented in
242 \m[blue]\fBRFC\ \&1035\fR\m[]\&\s-2\u[3]\d\s+2\&. For RRs that support name compression in the payload (such as MX or PTR), the compression is expanded in the returned data\&.
243 .PP
244 Note that currently, the class field has to be specified as IN or ANY\&. Specifying a different class will return an error indicating that look\-ups of this kind are unsupported\&. Similarly, some special types are not supported either (AXFR, OPT, \&...)\&. While
245 systemd\-resolved
246 parses and validates resource records of many types, it is crucial that clients using this API understand that the RR data originates from the network and should be thoroughly validated before use\&.
247 .PP
248 \fBResolveService()\fR
249 may be used to resolve a DNS
250 \fBSRV\fR
251 service record, as well as the hostnames referenced in it, and possibly an accompanying DNS\-SD
252 \fBTXT\fR
253 record containing additional service metadata\&. The primary benefit of using this method over
254 \fBResolveRecord()\fR
255 specifying the
256 \fBSRV\fR
257 type is that it will resolve the
258 \fBSRV\fR
259 and
260 \fBTXT\fR
261 RRs as well as the hostnames referenced in the SRV in a single operation\&. As parameters it takes a Linux network interface index, a service name, a service type and a service domain\&. This method may be invoked in three different modes:
262 .sp
263 .RS 4
264 .ie n \{\
265 \h'-04' 1.\h'+01'\c
266 .\}
267 .el \{\
268 .sp -1
269 .IP " 1." 4.2
270 .\}
271 To resolve a DNS\-SD service, specify the service name (e\&.g\&.
272 "Lennart\*(Aqs Files"), the service type (e\&.g\&.
273 "_webdav\&._tcp") and the domain to search in (e\&.g\&.
274 "local") as the three service parameters\&. The service name must be in UTF\-8 format, and no IDNA conversion is applied to it in this mode (as mandated by the DNS\-SD specifications)\&. However, if necessary, IDNA conversion is applied to the domain parameter\&.
275 .RE
276 .sp
277 .RS 4
278 .ie n \{\
279 \h'-04' 2.\h'+01'\c
280 .\}
281 .el \{\
282 .sp -1
283 .IP " 2." 4.2
284 .\}
285 To resolve a plain
286 \fBSRV\fR
287 record, set the service name parameter to the empty string and set the service type and domain properly\&. (IDNA conversion is applied to the domain, if necessary\&.)
288 .RE
289 .sp
290 .RS 4
291 .ie n \{\
292 \h'-04' 3.\h'+01'\c
293 .\}
294 .el \{\
295 .sp -1
296 .IP " 3." 4.2
297 .\}
298 Alternatively, leave both the service name and type empty and specify the full domain name of the
299 \fBSRV\fR
300 record (i\&.e\&. prefixed with the service type) in the domain parameter\&. (No IDNA conversion is applied in this mode\&.)
301 .RE
302 .PP
303 The
304 \fIfamily\fR
305 parameter of the
306 \fBResolveService()\fR
307 method encodes the desired family of the addresses to resolve (use
308 \fBAF_INET\fR,
309 \fBAF_INET6\fR, or
310 \fBAF_UNSPEC\fR)\&. If this is enabled (Use the
311 \fBNO_ADDRESS\fR
312 flag to turn address resolution off, see below)\&. The
313 \fIflags\fR
314 parameter takes a couple of flags that may be used to alter the resolver operation\&.
315 .PP
316 On completion,
317 \fBResolveService()\fR
318 returns an array of
319 \fBSRV\fR
320 record structures\&. Each items consisting of the priority, weight and port fields as well as the hostname to contact, as encoded in the
321 \fBSRV\fR
322 record\&. Immediately following is an array of the addresses of this hostname, with each item consisting of the interface index, the address family and the address data in a byte array\&. This address array is followed by the canonicalized hostname\&. After this array of
323 \fBSRV\fR
324 record structures an array of byte arrays follows that encodes the TXT RR strings, in case DNS\-SD look\-ups are enabled\&. The next parameters are the canonical service name, type and domain\&. This may or may not be identical to the parameters passed in\&. Finally, a
325 \fIflags\fR
326 field is returned that contains information about the resolver operation performed\&.
327 .PP
328 The
329 \fBResetStatistics()\fR
330 method resets the various statistics counters that
331 systemd\-resolved
332 maintains to zero\&. (For details, see the statistics properties below\&.)
333 .PP
334 The
335 \fBGetLink()\fR
336 method takes a network interface index and returns the object path to the
337 org\&.freedesktop\&.resolve1\&.Link
338 object corresponding to it\&.
339 .PP
340 The
341 \fBSetLinkDNS()\fR
342 method sets the DNS servers to use on a specific interface\&. This method (and the following ones) may be used by network management software to configure per\-interface DNS settings\&. It takes a network interface index as well as an array of DNS server IP address records\&. Each array item consists of an address family (either
343 \fBAF_INET\fR
344 or
345 \fBAF_INET6\fR), followed by a 4\-byte or 16\-byte array with the raw address data\&. This method is a one\-step shortcut for retrieving the Link object for a network interface using
346 \fBGetLink()\fR
347 (see above) and then invoking the
348 \fBSetDNS()\fR
349 method (see below) on it\&.
350 .PP
351 \fBSetLinkDNSEx()\fR
352 is similar to
353 \fBSetLinkDNS()\fR, but allows an IP port (instead of the default 53) and DNS name to be specified for each DNS server\&. The server name is used for Server Name Indication (SNI), which is useful when DNS\-over\-TLS is used\&. C\&.f\&.
354 \fIDNS=\fR
355 in
356 \fBresolved.conf\fR(5)\&.
357 .PP
358 \fBSetLinkDefaultRoute()\fR
359 specifies whether the link shall be used as the default route for name queries\&. See the description of name routing in
360 \fBsystemd-resolved.service\fR(8)
361 for details\&.
362 .PP
363 The
364 \fBSetLinkDomains()\fR
365 method sets the search and routing domains to use on a specific network interface for DNS look\-ups\&. It takes a network interface index and an array of domains, each with a boolean parameter indicating whether the specified domain shall be used as a search domain (false), or just as a routing domain (true)\&. Search domains are used for qualifying single\-label names into FQDN when looking up hostnames, as well as for making routing decisions on which interface to send queries ending in the domain to\&. Routing domains are only used for routing decisions and not used for single\-label name qualification\&. Pass the search domains in the order they should be used\&.
366 .PP
367 The
368 \fBSetLinkLLMNR()\fR
369 method enables or disables LLMNR support on a specific network interface\&. It takes a network interface index as well as a string that may either be empty or one of
370 "yes",
371 "no"
372 or
373 "resolve"\&. If empty, the systemd\-wide default LLMNR setting is used\&. If
374 "yes", LLMNR is used for resolution of single\-label names and the local hostname is registered on all local LANs for LLMNR resolution by peers\&. If
375 "no", LLMNR is turned off fully on this interface\&. If
376 "resolve", LLMNR is only enabled for resolving names, but the local hostname is not registered for other peers to use\&.
377 .PP
378 Similarly, the
379 \fBSetLinkMulticastDNS()\fR
380 method enables or disables MulticastDNS support on a specific interface\&. It takes the same parameters as
381 \fBSetLinkLLMNR()\fR
382 described above\&.
383 .PP
384 The
385 \fBSetLinkDNSSEC()\fR
386 method enables or disables DNSSEC validation on a specific network interface\&. It takes a network interface index as well as a string that may either be empty or one of
387 "yes",
388 "no", or
389 "allow\-downgrade"\&. When empty, the system\-wide default DNSSEC setting is used\&. If
390 "yes", full DNSSEC validation is done for all look\-ups\&. If the selected DNS server does not support DNSSEC, look\-ups will fail if this mode is used\&. If
391 "no", DNSSEC validation is fully disabled\&. If
392 "allow\-downgrade", DNSSEC validation is enabled, but is turned off automatically if the selected server does not support it (thus opening up behaviour to downgrade attacks)\&. Note that DNSSEC only applies to traditional DNS, not to LLMNR or MulticastDNS\&.
393 .PP
394 The
395 \fBSetLinkDNSSECNegativeTrustAnchors()\fR
396 method may be used to configure DNSSEC Negative Trust Anchors (NTAs) for a specific network interface\&. It takes a network interface index and a list of domains as arguments\&.
397 .PP
398 The
399 \fBSetLinkDNSOverTLS()\fR
400 method enables or disables DNS\-over\-TLS\&. C\&.f\&.
401 \fIDNSOverTLS=\fR
402 in
403 \fBsystemd-resolved.service\fR(8)
404 for details\&.
405 .PP
406 Network management software integrating with
407 systemd\-resolved
408 should call
409 \fBSetLinkDNS()\fR
410 or
411 \fBSetLinkDNSEx()\fR,
412 \fBSetLinkDefaultRoute()\fR,
413 \fBSetLinkDomains()\fR
414 and others after the interface appeared in the kernel (and thus after a network interface index has been assigned), but before the network interfaces is activated (\fBIFF_UP\fR
415 set) so that all settings take effect during the full time the network interface is up\&. It is safe to alter settings while the interface is up, however\&. Use
416 \fBRevertLink()\fR
417 (described below) to reset all per\-interface settings\&.
418 .PP
419 The
420 \fBRevertLink()\fR
421 method may be used to revert all per\-link settings described above to the defaults\&.
422 .PP
423 The
424 \fBFlushCaches()\fR
425 flushes all resource record caches maintained by the resolver, and ensures that any subsequent lookups re\-request their responses from their sources\&.
426 .PP
427 The
428 \fBResetServerFeatures()\fR
429 flushes any feature information learned about remote DNS servers\&. This ensures that subsequent lookups will be initially attempted at the highest DNS protocol feature level again, possibly requiring a (potentially slow) downgrade cycle to recognize the supported feature level again\&.
430 .PP
431 The
432 \fBRegisterService()\fR
433 method may be used to register a DNS\-SD service on the host\&. This functionality is closely related to the functionality provided by
434 \fBsystemd.dnssd\fR(5)
435 files\&. It takes a server identifier string as first parameter (this is just a local identifier, and should be chosen so that it neither collides with the basename of
436 *\&.dnssd
437 files nor with names chosen by other IPC clients)\&. It also takes a name template string for the DNS\-SD service name visible on the network\&. This string is subject to specifier expansation, as documented for the
438 \fIName=\fR
439 setting in
440 *\&.dnssd
441 files\&. It also takes a service type string containing the DNS\-SD service type, as well as an IP port, a priority/weight pair for the DNS\-SD SRV record\&. Finally, it takes an array of TXT record data\&. It returns an object path which may be used as handle to the registered service\&.
442 .PP
443 The
444 \fBUnregisterService()\fR
445 method undoes the effect of
446 \fBRegisterService()\fR
447 and deletes a DNS\-SD service previously created via IPC again\&.
448 .sp
449 .it 1 an-trap
450 .nr an-no-space-flag 1
451 .nr an-break-flag 1
452 .br
453 .ps +1
454 \fBThe Flags Parameter\fR
455 .RS 4
456 .PP
457 The four methods above accept and return a 64\-bit flags value\&. In most cases passing 0 is sufficient and recommended\&. However, the following flags are defined to alter the look\-up:
458 .sp
459 .if n \{\
460 .RS 4
461 .\}
462 .nf
463 /* Input+Output: Protocol/scope */
464 #define SD_RESOLVED_DNS (UINT64_C(1) << 0)
465 #define SD_RESOLVED_LLMNR_IPV4 (UINT64_C(1) << 1)
466 #define SD_RESOLVED_LLMNR_IPV6 (UINT64_C(1) << 2)
467 #define SD_RESOLVED_MDNS_IPV4 (UINT64_C(1) << 3)
468 #define SD_RESOLVED_MDNS_IPV6 (UINT64_C(1) << 4)
469
470 /* Input: Restrictions */
471 #define SD_RESOLVED_NO_CNAME (UINT64_C(1) << 5)
472 #define SD_RESOLVED_NO_TXT (UINT64_C(1) << 6)
473 #define SD_RESOLVED_NO_ADDRESS (UINT64_C(1) << 7)
474 #define SD_RESOLVED_NO_SEARCH (UINT64_C(1) << 8)
475 #define SD_RESOLVED_NO_VALIDATE (UINT64_C(1) << 10)
476 #define SD_RESOLVED_NO_SYNTHESIZE (UINT64_C(1) << 11)
477 #define SD_RESOLVED_NO_CACHE (UINT64_C(1) << 12)
478 #define SD_RESOLVED_NO_ZONE (UINT64_C(1) << 13)
479 #define SD_RESOLVED_NO_TRUST_ANCHOR (UINT64_C(1) << 14)
480 #define SD_RESOLVED_NO_NETWORK (UINT64_C(1) << 15)
481 #define SD_RESOLVED_NO_STALE (UINT64_C(1) << 24)
482 #define SD_RESOLVED_RELAX_SINGLE_LABEL (UINT64_C(1) << 25)
483
484 /* Output: Security */
485 #define SD_RESOLVED_AUTHENTICATED (UINT64_C(1) << 9)
486 #define SD_RESOLVED_CONFIDENTIAL (UINT64_C(1) << 18)
487
488 /* Output: Origin */
489 #define SD_RESOLVED_SYNTHETIC (UINT64_C(1) << 19)
490 #define SD_RESOLVED_FROM_CACHE (UINT64_C(1) << 20)
491 #define SD_RESOLVED_FROM_ZONE (UINT64_C(1) << 21)
492 #define SD_RESOLVED_FROM_TRUST_ANCHOR (UINT64_C(1) << 22)
493 #define SD_RESOLVED_FROM_NETWORK (UINT64_C(1) << 23)
494 .fi
495 .if n \{\
496 .RE
497 .\}
498 .PP
499 On input, the first five flags control the protocols to use for the look\-up\&. They refer to classic unicast DNS, LLMNR via IPv4/UDP and IPv6/UDP respectively, as well as MulticastDNS via IPv4/UDP and IPv6/UDP\&. If all of these five bits are off on input (which is strongly recommended) the look\-up will be done via all suitable protocols for the specific look\-up\&. Note that these flags operate as filter only, but cannot force a look\-up to be done via a protocol\&. Specifically,
500 systemd\-resolved
501 will only route look\-ups within the \&.local TLD to MulticastDNS (plus some reverse look\-up address domains), and single\-label names to LLMNR (plus some reverse address lookup domains)\&. It will route neither of these to Unicast DNS servers\&. Also, it will do LLMNR and Multicast DNS only on interfaces suitable for multicast\&.
502 .PP
503 On output, these five flags indicate which protocol was used to execute the operation, and hence where the data was found\&.
504 .PP
505 The primary use cases for these five flags are follow\-up look\-ups based on DNS data retrieved earlier\&. In this case, it is often a good idea to limit the follow\-up look\-up to the protocol that was used to discover the first DNS result\&.
506 .PP
507 The NO_CNAME flag controls whether CNAME/DNAME resource records shall be followed during the look\-up\&. This flag is only available at input, none of the functions will return it on output\&. If a CNAME/DNAME RR is discovered while resolving a hostname, an error is returned instead\&. By default, when the flag is off, CNAME/DNAME RRs are followed\&.
508 .PP
509 The NO_TXT and NO_ADDRESS flags only influence operation of the
510 \fBResolveService()\fR
511 method\&. They are only defined for input, not output\&. If NO_TXT is set, the DNS\-SD TXT RR look\-up is not done in the same operation\&. If NO_ADDRESS is set, the discovered hostnames are not implicitly translated to their addresses\&.
512 .PP
513 The NO_SEARCH flag turns off the search domain logic\&. It is only defined for input in
514 \fBResolveHostname()\fR\&. When specified, single\-label hostnames are not qualified using defined search domains, if any are configured\&. Note that
515 \fBResolveRecord()\fR
516 will never qualify single\-label domain names using search domains\&. Also note that multi\-label hostnames are never subject to search list expansion\&.
517 .PP
518 NO_VALIDATE can be set to disable validation via DNSSEC even if it would normally be used\&.
519 .PP
520 The next six flags allow disabling certain sources during resolution\&. NO_SYNTHESIZE disables synthetic records, e\&.g\&. the local host name, see section SYNTHETIC RECORDS in
521 \fBsystemd-resolved.service\fR(8)
522 for more information\&. NO_CACHE disables the use of the cache of previously resolved records\&. NO_ZONE disables answers using locally registered public LLMNR/mDNS resource records\&. NO_TRUST_ANCHOR disables answers using locally configured trust anchors\&. NO_NETWORK requires all answers to be provided without using the network, i\&.e\&. either from local sources or the cache\&. NO_STALE flag can be set to disable answering request with stale records\&.
523 .PP
524 The AUTHENTICATED bit is defined only in the output flags of the four functions\&. If set, the returned data has been fully authenticated\&. Specifically, this bit is set for all DNSSEC\-protected data for which a full trust chain may be established to a trusted domain anchor\&. It is also set for locally synthesized data, such as
525 "localhost"
526 or data from
527 /etc/hosts\&. Moreover, it is set for all LLMNR or mDNS RRs which originate from the local host\&. Applications that require authenticated RR data for operation should check this flag before trusting the data\&. Note that
528 systemd\-resolved
529 will never return invalidated data, hence this flag simply allows one to discern the cases where data is known to be trusted, or where there is proof that the data is "rightfully" unauthenticated (which includes cases where the underlying protocol or server does not support authenticating data)\&.
530 .PP
531 CONFIDENTIAL means the query was resolved via encrypted channels or never left this system\&.
532 .PP
533 The next five bits flags are used in output and provide information about the origin of the answer\&. FROM_SYNTHETIC means the query was (at least partially) synthesized locally\&. FROM_CACHE means the query was answered (at least partially) using the cache\&. FROM_ZONE means the query was answered (at least partially) based on public, locally registered records\&. FROM_TRUST_ANCHOR means the query was answered (at least partially) using local trust anchors\&. FROM_NETWORK means the query was answered (at least partially) using the network\&.
534 .RE
535 .SS "Properties"
536 .PP
537 The
538 \fILLMNR\fR
539 and
540 \fIMulticastDNS\fR
541 properties report whether LLMNR and MulticastDNS are (globally) enabled\&. Each may be one of
542 "yes",
543 "no", and
544 "resolve"\&. See
545 \fBSetLinkLLMNR()\fR
546 and
547 \fBSetLinkMulticastDNS()\fR
548 above\&.
549 .PP
550 \fILLMNRHostname\fR
551 contains the hostname currently exposed on the network via LLMNR\&. It usually follows the system hostname as may be queried via
552 \fBgethostname\fR(3), but may differ if a conflict is detected on the network\&.
553 .PP
554 \fIDNS\fR
555 and
556 \fIDNSEx\fR
557 contain arrays of all DNS servers currently used by
558 systemd\-resolved\&.
559 \fIDNS\fR
560 contains information similar to the DNS server data in
561 /run/systemd/resolve/resolv\&.conf\&. Each structure in the array consists of a numeric network interface index, an address family, and a byte array containing the DNS server address (either 4 bytes in length for IPv4 or 16 bytes in lengths for IPv6)\&.
562 \fIDNSEx\fR
563 is similar, but additionally contains the IP port and server name (used for Server Name Indication, SNI)\&. Both arrays contain DNS servers configured system\-wide, including those possibly read from a foreign
564 /etc/resolv\&.conf
565 or the
566 \fIDNS=\fR
567 setting in
568 /etc/systemd/resolved\&.conf, as well as per\-interface DNS server information either retrieved from
569 \fBsystemd-networkd\fR(8), or configured by external software via
570 \fBSetLinkDNS()\fR
571 or
572 \fBSetLinkDNSEx()\fR
573 (see above)\&. The network interface index will be 0 for the system\-wide configured services and non\-zero for the per\-link servers\&.
574 .PP
575 \fIFallbackDNS\fR
576 and
577 \fIFallbackDNSEx\fR
578 contain arrays of all DNS servers configured as fallback servers, if any, using the same format as
579 \fIDNS\fR
580 and
581 \fIDNSEx\fR
582 described above\&. See the description of
583 \fIFallbackDNS=\fR
584 in
585 \fBresolved.conf\fR(5)
586 for the description of when those servers are used\&.
587 .PP
588 \fICurrentDNSServer\fR
589 and
590 \fICurrentDNSServerEx\fR
591 specify the server that is currently used for query resolution, in the same format as a single entry in the
592 \fIDNS\fR
593 and
594 \fIDNSEx\fR
595 arrays described above\&.
596 .PP
597 Similarly, the
598 \fIDomains\fR
599 property contains an array of all search and routing domains currently used by
600 systemd\-resolved\&. Each entry consists of a network interface index (again, 0 encodes system\-wide entries), the actual domain name, and whether the entry is used only for routing (true) or for both routing and searching (false)\&.
601 .PP
602 The
603 \fITransactionStatistics\fR
604 property contains information about the number of transactions
605 systemd\-resolved
606 has processed\&. It contains a pair of unsigned 64\-bit counters, the first containing the number of currently ongoing transactions, the second the number of total transactions
607 systemd\-resolved
608 is processing or has processed\&. The latter value may be reset using the
609 \fBResetStatistics()\fR
610 method described above\&. Note that the number of transactions does not directly map to the number of issued resolver bus method calls\&. While simple look\-ups usually require a single transaction only, more complex look\-ups might result in more, for example when CNAMEs or DNSSEC are in use\&.
611 .PP
612 The
613 \fICacheStatistics\fR
614 property contains information about the executed cache operations so far\&. It exposes three 64\-bit counters: the first being the total number of current cache entries (both positive and negative), the second the number of cache hits, and the third the number of cache misses\&. The latter counters may be reset using
615 \fBResetStatistics()\fR
616 (see above)\&.
617 .PP
618 The
619 \fIDNSSEC\fR
620 property specifies current status of DNSSEC validation\&. It is one of
621 "yes"
622 (validation is enforced),
623 "no"
624 (no validation is done),
625 "allow\-downgrade"
626 (validation is done if the current DNS server supports it)\&. See the description of
627 \fIDNSSEC=\fR
628 in
629 \fBresolved.conf\fR(5)\&.
630 .PP
631 The
632 \fIDNSSECStatistics\fR
633 property contains information about the DNSSEC validations executed so far\&. It contains four 64\-bit counters: the number of secure, insecure, bogus, and indeterminate DNSSEC validations so far\&. The counters are increased for each validated RRset, and each non\-existence proof\&. The secure counter is increased for each operation that successfully verified a signed reply, the insecure counter is increased for each operation that successfully verified that an unsigned reply is rightfully unsigned\&. The bogus counter is increased for each operation where the validation did not check out and the data is likely to have been tempered with\&. Finally, the indeterminate counter is increased for each operation which did not complete because the necessary keys could not be acquired or the cryptographic algorithms were unknown\&.
634 .PP
635 The
636 \fIDNSSECSupported\fR
637 boolean property reports whether DNSSEC is enabled and the selected DNS servers support it\&. It combines information about system\-wide and per\-link DNS settings (see below), and only reports true if DNSSEC is enabled and supported on every interface for which DNS is configured and for the system\-wide settings if there are any\&. Note that
638 systemd\-resolved
639 assumes DNSSEC is supported by DNS servers until it verifies that this is not the case\&. Thus, the reported value may initially be true, until the first transactions are executed\&.
640 .PP
641 The
642 \fIDNSOverTLS\fR
643 boolean property reports whether DNS\-over\-TLS is enabled\&.
644 .PP
645 The
646 \fIResolvConfMode\fR
647 property exposes how
648 /etc/resolv\&.conf
649 is managed on the host\&. Currently, the values
650 "uplink",
651 "stub",
652 "static"
653 (these three correspond to the three different files
654 systemd\-resolved\&.service
655 provides),
656 "foreign"
657 (the file is managed by admin or another service,
658 systemd\-resolved\&.service
659 just consumes it),
660 "missing"
661 (/etc/resolv\&.conf
662 is missing)\&.
663 .PP
664 The
665 \fIDNSStubListener\fR
666 property reports whether the stub listener on port 53 is enabled\&. Possible values are
667 "yes"
668 (enabled),
669 "no"
670 (disabled),
671 "udp"
672 (only the UDP listener is enabled), and
673 "tcp"
674 (only the TCP listener is enabled)\&.
675 .PP
676 The
677 \fIDNSSECNegativeTrustAnchors\fR
678 property contains a list of recognized DNSSEC negative trust anchors and contains a list of domains\&.
679 .SH "LINK OBJECT"
680 .sp
681 .if n \{\
682 .RS 4
683 .\}
684 .nf
685 node /org/freedesktop/resolve1/link/_1 {
686 interface org\&.freedesktop\&.resolve1\&.Link {
687 methods:
688 SetDNS(in a(iay) addresses);
689 SetDNSEx(in a(iayqs) addresses);
690 SetDomains(in a(sb) domains);
691 SetDefaultRoute(in b enable);
692 SetLLMNR(in s mode);
693 SetMulticastDNS(in s mode);
694 SetDNSOverTLS(in s mode);
695 SetDNSSEC(in s mode);
696 SetDNSSECNegativeTrustAnchors(in as names);
697 Revert();
698 properties:
699 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
700 readonly t ScopesMask = \&.\&.\&.;
701 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
702 readonly a(iay) DNS = [\&.\&.\&.];
703 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
704 readonly a(iayqs) DNSEx = [\&.\&.\&.];
705 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
706 readonly (iay) CurrentDNSServer = \&.\&.\&.;
707 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
708 readonly (iayqs) CurrentDNSServerEx = \&.\&.\&.;
709 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
710 readonly a(sb) Domains = [\&.\&.\&.];
711 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
712 readonly b DefaultRoute = \&.\&.\&.;
713 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
714 readonly s LLMNR = \*(Aq\&.\&.\&.\*(Aq;
715 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
716 readonly s MulticastDNS = \*(Aq\&.\&.\&.\*(Aq;
717 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
718 readonly s DNSOverTLS = \*(Aq\&.\&.\&.\*(Aq;
719 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
720 readonly s DNSSEC = \*(Aq\&.\&.\&.\*(Aq;
721 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
722 readonly as DNSSECNegativeTrustAnchors = [\*(Aq\&.\&.\&.\*(Aq, \&.\&.\&.];
723 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
724 readonly b DNSSECSupported = \&.\&.\&.;
725 };
726 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
727 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
728 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
729 };
730 .fi
731 .if n \{\
732 .RE
733 .\}
734 .sp
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759 .PP
760 For each Linux network interface a "Link" object is created which exposes per\-link DNS configuration and state\&. Use
761 \fBGetLink()\fR
762 on the Manager interface to retrieve the object path for a link object given the network interface index (see above)\&.
763 .SS "Methods"
764 .PP
765 The various methods exposed by the Link interface are equivalent to their similarly named counterparts on the Manager interface\&. e\&.g\&.
766 \fBSetDNS()\fR
767 on the Link object maps to
768 \fBSetLinkDNS()\fR
769 on the Manager object, the main difference being that the later expects an interface index to be specified\&. Invoking the methods on the Manager interface has the benefit of reducing roundtrips, as it is not necessary to first request the Link object path via
770 \fBGetLink()\fR
771 before invoking the methods\&. The same relationship holds for
772 \fBSetDNSEx()\fR,
773 \fBSetDomains()\fR,
774 \fBSetDefaultRoute()\fR,
775 \fBSetLLMNR()\fR,
776 \fBSetMulticastDNS()\fR,
777 \fBSetDNSOverTLS()\fR,
778 \fBSetDNSSEC()\fR,
779 \fBSetDNSSECNegativeTrustAnchors()\fR, and
780 \fBRevert()\fR\&. For further details on these methods see the
781 Manager
782 documentation above\&.
783 .SS "Properties"
784 .PP
785 \fIScopesMask\fR
786 defines which resolver scopes are currently active on this interface\&. This 64\-bit unsigned integer field is a bit mask consisting of a subset of the bits of the flags parameter describe above\&. Specifically, it may have the DNS, LLMNR and MDNS bits (the latter in IPv4 and IPv6 flavours) set\&. Each individual bit is set when the protocol applies to a specific interface and is enabled for it\&. It is unset otherwise\&. Specifically, a multicast\-capable interface in the "UP" state with an IP address is suitable for LLMNR or MulticastDNS, and any interface that is UP and has an IP address is suitable for DNS\&. Note the relationship of the bits exposed here with the LLMNR and MulticastDNS properties also exposed on the Link interface\&. The latter expose what is *configured* to be used on the interface, the former expose what is actually used on the interface, taking into account the abilities of the interface\&.
787 .PP
788 \fIDNSSECSupported\fR
789 exposes a boolean field that indicates whether DNSSEC is currently configured and in use on the interface\&. Note that if DNSSEC is enabled on an interface, it is assumed available until it is detected that the configured server does not actually support it\&. Thus, this property may initially report that DNSSEC is supported on an interface\&.
790 .PP
791 \fIDefaultRoute\fR
792 exposes a boolean field that indicates whether the interface will be used as default route for name queries\&. See
793 \fBSetLinkDefaultRoute()\fR
794 above\&.
795 .PP
796 The other properties reflect the state of the various configuration settings for the link which may be set with the various methods calls such as
797 \fBSetDNS()\fR
798 or
799 \fBSetLLMNR()\fR\&.
800 .SH "COMMON ERRORS"
801 .PP
802 Many bus methods
803 systemd\-resolved
804 exposes (in particular the resolver methods such as
805 \fBResolveHostname()\fR
806 on the
807 Manager
808 interface) may return some of the following errors:
809 .PP
810 \fBorg\&.freedesktop\&.resolve1\&.NoNameServers\fR
811 .RS 4
812 No suitable DNS servers were found to resolve a request\&.
813 .sp
814 Added in version 246\&.
815 .RE
816 .PP
817 \fBorg\&.freedesktop\&.resolve1\&.InvalidReply\fR
818 .RS 4
819 A response from the selected DNS server was not understood\&.
820 .sp
821 Added in version 246\&.
822 .RE
823 .PP
824 \fBorg\&.freedesktop\&.resolve1\&.NoSuchRR\fR
825 .RS 4
826 The requested name exists, but there is no resource record of the requested type for it\&. (This is the DNS NODATA case)\&.
827 .sp
828 Added in version 246\&.
829 .RE
830 .PP
831 \fBorg\&.freedesktop\&.resolve1\&.CNameLoop\fR
832 .RS 4
833 The look\-up failed because a CNAME or DNAME loop was detected\&.
834 .sp
835 Added in version 246\&.
836 .RE
837 .PP
838 \fBorg\&.freedesktop\&.resolve1\&.Aborted\fR
839 .RS 4
840 The look\-up was aborted because the selected protocol became unavailable while the operation was ongoing\&.
841 .sp
842 Added in version 246\&.
843 .RE
844 .PP
845 \fBorg\&.freedesktop\&.resolve1\&.NoSuchService\fR
846 .RS 4
847 A service look\-up was successful, but the
848 \fBSRV\fR
849 record reported that the service is not available\&.
850 .sp
851 Added in version 246\&.
852 .RE
853 .PP
854 \fBorg\&.freedesktop\&.resolve1\&.DnssecFailed\fR
855 .RS 4
856 The acquired response did not pass DNSSEC validation\&.
857 .sp
858 Added in version 246\&.
859 .RE
860 .PP
861 \fBorg\&.freedesktop\&.resolve1\&.NoTrustAnchor\fR
862 .RS 4
863 No chain of trust could be established for the response to a configured DNSSEC trust anchor\&.
864 .sp
865 Added in version 246\&.
866 .RE
867 .PP
868 \fBorg\&.freedesktop\&.resolve1\&.ResourceRecordTypeUnsupported\fR
869 .RS 4
870 The requested resource record type is not supported on the selected DNS servers\&. This error is generated for example when an RRSIG record is requested from a DNS server that does not support DNSSEC\&.
871 .sp
872 Added in version 246\&.
873 .RE
874 .PP
875 \fBorg\&.freedesktop\&.resolve1\&.NoSuchLink\fR
876 .RS 4
877 No network interface with the specified network interface index exists\&.
878 .sp
879 Added in version 246\&.
880 .RE
881 .PP
882 \fBorg\&.freedesktop\&.resolve1\&.LinkBusy\fR
883 .RS 4
884 The requested configuration change could not be made because
885 \fBsystemd-networkd\fR(8), already took possession of the interface and supplied configuration data for it\&.
886 .sp
887 Added in version 246\&.
888 .RE
889 .PP
890 \fBorg\&.freedesktop\&.resolve1\&.NetworkDown\fR
891 .RS 4
892 The requested look\-up failed because the system is currently not connected to any suitable network\&.
893 .sp
894 Added in version 246\&.
895 .RE
896 .PP
897 \fBorg\&.freedesktop\&.resolve1\&.DnsError\&.NXDOMAIN\fR, \fBorg\&.freedesktop\&.resolve1\&.DnsError\&.REFUSED\fR, \&.\&.\&.
898 .RS 4
899 The look\-up failed with a DNS return code reporting a failure\&. The error names used as suffixes here are defined in by IANA in
900 \m[blue]\fBDNS\ \&RCODEs\fR\m[]\&\s-2\u[4]\d\s+2\&.
901 .sp
902 Added in version 246\&.
903 .RE
904 .SH "EXAMPLES"
905 .PP
906 \fBExample\ \&1.\ \&Introspect org\&.freedesktop\&.resolve1\&.Manager on the bus\fR
907 .sp
908 .if n \{\
909 .RS 4
910 .\}
911 .nf
912 $ gdbus introspect \-\-system \e
913 \-\-dest org\&.freedesktop\&.resolve1 \e
914 \-\-object\-path /org/freedesktop/resolve1
915 .fi
916 .if n \{\
917 .RE
918 .\}
919 .PP
920 \fBExample\ \&2.\ \&Introspect org\&.freedesktop\&.resolve1\&.Link on the bus\fR
921 .sp
922 .if n \{\
923 .RS 4
924 .\}
925 .nf
926 $ gdbus introspect \-\-system \e
927 \-\-dest org\&.freedesktop\&.resolve1 \e
928 \-\-object\-path /org/freedesktop/resolve1/link/_11
929 .fi
930 .if n \{\
931 .RE
932 .\}
933 .SH "VERSIONING"
934 .PP
935 These D\-Bus interfaces follow
936 \m[blue]\fBthe usual interface versioning guidelines\fR\m[]\&\s-2\u[5]\d\s+2\&.
937 .SH "SEE ALSO"
938 .PP
939 \fBsystemd\fR(1), \fBsystemd-resolved.service\fR(8), \fBresolvectl\fR(1)
940 .SH "NOTES"
941 .IP " 1." 4
942 Writing Network Configuration Managers
943 .RS 4
944 \%https://wiki.freedesktop.org/www/Software/systemd/writing-network-configuration-managers
945 .RE
946 .IP " 2." 4
947 Writing Resolver Clients
948 .RS 4
949 \%https://wiki.freedesktop.org/www/Software/systemd/writing-resolver-clients
950 .RE
951 .IP " 3." 4
952 RFC\ \&1035
953 .RS 4
954 \%https://www.ietf.org/rfc/rfc1035.txt
955 .RE
956 .IP " 4." 4
957 DNS\ \&RCODEs
958 .RS 4
959 \%https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6
960 .RE
961 .IP " 5." 4
962 the usual interface versioning guidelines
963 .RS 4
964 \%https://0pointer.de/blog/projects/versioning-dbus.html
965 .RE