Debian Codegraph @

upstream/mageia-cauldron/man5/org.freedesktop.resolve1.5

raw
1 '\" t
2 .TH "ORG\&.FREEDESKTOP\&.RESOLVE1" "5" "" "systemd 258.7" "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 GetDelegate(in s id,
110 out o path);
111 ListDelegates(out a(so) delegates);
112 properties:
113 readonly s LLMNRHostname = \*(Aq\&.\&.\&.\*(Aq;
114 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
115 readonly s LLMNR = \*(Aq\&.\&.\&.\*(Aq;
116 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
117 readonly s MulticastDNS = \*(Aq\&.\&.\&.\*(Aq;
118 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
119 readonly s DNSOverTLS = \*(Aq\&.\&.\&.\*(Aq;
120 readonly a(iiay) DNS = [\&.\&.\&.];
121 readonly a(iiayqs) DNSEx = [\&.\&.\&.];
122 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
123 readonly a(iiay) FallbackDNS = [\&.\&.\&.];
124 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
125 readonly a(iiayqs) FallbackDNSEx = [\&.\&.\&.];
126 readonly (iiay) CurrentDNSServer = \&.\&.\&.;
127 readonly (iiayqs) CurrentDNSServerEx = \&.\&.\&.;
128 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
129 readonly a(isb) Domains = [\&.\&.\&.];
130 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
131 readonly (tt) TransactionStatistics = \&.\&.\&.;
132 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
133 readonly (ttt) CacheStatistics = \&.\&.\&.;
134 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
135 readonly s DNSSEC = \*(Aq\&.\&.\&.\*(Aq;
136 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
137 readonly (tttt) DNSSECStatistics = \&.\&.\&.;
138 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
139 readonly b DNSSECSupported = \&.\&.\&.;
140 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
141 readonly as DNSSECNegativeTrustAnchors = [\*(Aq\&.\&.\&.\*(Aq, \&.\&.\&.];
142 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
143 readonly s DNSStubListener = \*(Aq\&.\&.\&.\*(Aq;
144 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
145 readonly s ResolvConfMode = \*(Aq\&.\&.\&.\*(Aq;
146 };
147 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
148 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
149 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
150 };
151 .fi
152 .if n \{\
153 .RE
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
193
194
195
196
197 .SS "Methods"
198 .PP
199 \fBResolveHostname()\fR
200 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
201 \fIname\fR
202 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
203 \fIfamily\fR
204 parameter limits the results to a specific address family\&. It may be
205 \fBAF_INET\fR,
206 \fBAF_INET6\fR
207 or
208 \fBAF_UNSPEC\fR\&. If
209 \fBAF_UNSPEC\fR
210 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
211 \fIflags\fR
212 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
213 \fBAF_INET\fR
214 or
215 \fBAF_INET6\fR\&. For IPv6, the returned address interface index should be used to initialize the \&.sin6_scope_id field of a
216 struct\ \&sockaddr_in6
217 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
218 \fIflags\fR
219 field is returned that is defined similarly to the
220 \fIflags\fR
221 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\&.
222 .PP
223 \fBResolveAddress()\fR
224 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
225 \fB0\fR
226 if all suitable interfaces are OK\&. The
227 \fIfamily\fR
228 parameter indicates the address family of the IP address to resolve\&. It may be either
229 \fBAF_INET\fR
230 or
231 \fBAF_INET6\fR\&. The
232 \fIaddress\fR
233 parameter takes the raw IP address data (as either a 4 or 16 byte array)\&. The
234 \fIflags\fR
235 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
236 \fIflags\fR
237 output field contains additional information about the resolver operation (see below)\&.
238 .PP
239 \fBResolveRecord()\fR
240 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
241 \fB0\fR
242 if it may be done on any suitable interface\&. The
243 \fIname\fR
244 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
245 \fIflags\fR
246 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
247 \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\&.
248 .PP
249 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
250 systemd\-resolved
251 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\&.
252 .PP
253 \fBResolveService()\fR
254 may be used to resolve a DNS
255 \fBSRV\fR
256 service record, as well as the hostnames referenced in it, and possibly an accompanying DNS\-SD
257 \fBTXT\fR
258 record containing additional service metadata\&. The primary benefit of using this method over
259 \fBResolveRecord()\fR
260 specifying the
261 \fBSRV\fR
262 type is that it will resolve the
263 \fBSRV\fR
264 and
265 \fBTXT\fR
266 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:
267 .sp
268 .RS 4
269 .ie n \{\
270 \h'-04' 1.\h'+01'\c
271 .\}
272 .el \{\
273 .sp -1
274 .IP " 1." 4.2
275 .\}
276 To resolve a DNS\-SD service, specify the service name (e\&.g\&.
277 "Lennart\*(Aqs Files"), the service type (e\&.g\&.
278 "_webdav\&._tcp") and the domain to search in (e\&.g\&.
279 "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\&.
280 .RE
281 .sp
282 .RS 4
283 .ie n \{\
284 \h'-04' 2.\h'+01'\c
285 .\}
286 .el \{\
287 .sp -1
288 .IP " 2." 4.2
289 .\}
290 To resolve a plain
291 \fBSRV\fR
292 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\&.)
293 .RE
294 .sp
295 .RS 4
296 .ie n \{\
297 \h'-04' 3.\h'+01'\c
298 .\}
299 .el \{\
300 .sp -1
301 .IP " 3." 4.2
302 .\}
303 Alternatively, leave both the service name and type empty and specify the full domain name of the
304 \fBSRV\fR
305 record (i\&.e\&. prefixed with the service type) in the domain parameter\&. (No IDNA conversion is applied in this mode\&.)
306 .RE
307 .PP
308 The
309 \fIfamily\fR
310 parameter of the
311 \fBResolveService()\fR
312 method encodes the desired family of the addresses to resolve (use
313 \fBAF_INET\fR,
314 \fBAF_INET6\fR, or
315 \fBAF_UNSPEC\fR)\&. If this is enabled (Use the
316 \fBNO_ADDRESS\fR
317 flag to turn address resolution off, see below)\&. The
318 \fIflags\fR
319 parameter takes a couple of flags that may be used to alter the resolver operation\&.
320 .PP
321 On completion,
322 \fBResolveService()\fR
323 returns an array of
324 \fBSRV\fR
325 record structures\&. Each items consisting of the priority, weight and port fields as well as the hostname to contact, as encoded in the
326 \fBSRV\fR
327 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
328 \fBSRV\fR
329 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
330 \fIflags\fR
331 field is returned that contains information about the resolver operation performed\&.
332 .PP
333 The
334 \fBResetStatistics()\fR
335 method resets the various statistics counters that
336 systemd\-resolved
337 maintains to zero\&. (For details, see the statistics properties below\&.)
338 .PP
339 The
340 \fBGetLink()\fR
341 method takes a network interface index and returns the object path to the
342 org\&.freedesktop\&.resolve1\&.Link
343 object corresponding to it\&.
344 .PP
345 The
346 \fBSetLinkDNS()\fR
347 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
348 \fBAF_INET\fR
349 or
350 \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
351 \fBGetLink()\fR
352 (see above) and then invoking the
353 \fBSetDNS()\fR
354 method (see below) on it\&.
355 .PP
356 \fBSetLinkDNSEx()\fR
357 is similar to
358 \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\&.
359 \fIDNS=\fR
360 in
361 \fBresolved.conf\fR(5)\&.
362 .PP
363 \fBSetLinkDefaultRoute()\fR
364 specifies whether the link shall be used as the default route for name queries\&. See the description of name routing in
365 \fBsystemd-resolved.service\fR(8)
366 for details\&.
367 .PP
368 The
369 \fBSetLinkDomains()\fR
370 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\&.
371 .PP
372 The
373 \fBSetLinkLLMNR()\fR
374 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
375 "yes",
376 "no"
377 or
378 "resolve"\&. If empty, the systemd\-wide default LLMNR setting is used\&. If
379 "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
380 "no", LLMNR is turned off fully on this interface\&. If
381 "resolve", LLMNR is only enabled for resolving names, but the local hostname is not registered for other peers to use\&.
382 .PP
383 Similarly, the
384 \fBSetLinkMulticastDNS()\fR
385 method enables or disables MulticastDNS support on a specific interface\&. It takes the same parameters as
386 \fBSetLinkLLMNR()\fR
387 described above\&.
388 .PP
389 The
390 \fBSetLinkDNSSEC()\fR
391 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
392 "yes",
393 "no", or
394 "allow\-downgrade"\&. When empty, the system\-wide default DNSSEC setting is used\&. If
395 "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
396 "no", DNSSEC validation is fully disabled\&. If
397 "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\&.
398 .PP
399 The
400 \fBSetLinkDNSSECNegativeTrustAnchors()\fR
401 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\&.
402 .PP
403 The
404 \fBSetLinkDNSOverTLS()\fR
405 method enables or disables DNS\-over\-TLS\&. C\&.f\&.
406 \fIDNSOverTLS=\fR
407 in
408 \fBsystemd-resolved.service\fR(8)
409 for details\&.
410 .PP
411 Network management software integrating with
412 systemd\-resolved
413 should call
414 \fBSetLinkDNS()\fR
415 or
416 \fBSetLinkDNSEx()\fR,
417 \fBSetLinkDefaultRoute()\fR,
418 \fBSetLinkDomains()\fR
419 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
420 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
421 \fBRevertLink()\fR
422 (described below) to reset all per\-interface settings\&.
423 .PP
424 The
425 \fBRevertLink()\fR
426 method may be used to revert all per\-link settings described above to the defaults\&.
427 .PP
428 The
429 \fBFlushCaches()\fR
430 method flushes all resource record caches maintained by the resolver, and ensures that any subsequent lookups re\-request their responses from their sources\&.
431 .PP
432 The
433 \fBResetServerFeatures()\fR
434 method 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\&.
435 .PP
436 The
437 \fBRegisterService()\fR
438 method may be used to register a DNS\-SD service on the host\&. This functionality is closely related to the functionality provided by
439 \fBsystemd.dnssd\fR(5)
440 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
441 *\&.dnssd
442 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
443 \fIName=\fR
444 setting in
445 *\&.dnssd
446 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\&.
447 .PP
448 The
449 \fBUnregisterService()\fR
450 method undoes the effect of
451 \fBRegisterService()\fR
452 and deletes a DNS\-SD service previously created via IPC again\&.
453 .PP
454 The
455 \fBGetDelegate()\fR
456 method returns the D\-Bus object path for the specified DNS delegate ID\&.
457 .PP
458 The
459 \fBListDelegates()\fR
460 method returns a list of the IDs and D\-Bus object paths of the currently configured DNS delegates\&.
461 .sp
462 .it 1 an-trap
463 .nr an-no-space-flag 1
464 .nr an-break-flag 1
465 .br
466 .ps +1
467 \fBThe Flags Parameter\fR
468 .RS 4
469 .PP
470 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:
471 .sp
472 .if n \{\
473 .RS 4
474 .\}
475 .nf
476 /* Input+Output: Protocol/scope */
477 #define SD_RESOLVED_DNS (UINT64_C(1) << 0)
478 #define SD_RESOLVED_LLMNR_IPV4 (UINT64_C(1) << 1)
479 #define SD_RESOLVED_LLMNR_IPV6 (UINT64_C(1) << 2)
480 #define SD_RESOLVED_MDNS_IPV4 (UINT64_C(1) << 3)
481 #define SD_RESOLVED_MDNS_IPV6 (UINT64_C(1) << 4)
482
483 /* Input: Restrictions */
484 #define SD_RESOLVED_NO_CNAME (UINT64_C(1) << 5)
485 #define SD_RESOLVED_NO_TXT (UINT64_C(1) << 6)
486 #define SD_RESOLVED_NO_ADDRESS (UINT64_C(1) << 7)
487 #define SD_RESOLVED_NO_SEARCH (UINT64_C(1) << 8)
488 #define SD_RESOLVED_NO_VALIDATE (UINT64_C(1) << 10)
489 #define SD_RESOLVED_NO_SYNTHESIZE (UINT64_C(1) << 11)
490 #define SD_RESOLVED_NO_CACHE (UINT64_C(1) << 12)
491 #define SD_RESOLVED_NO_ZONE (UINT64_C(1) << 13)
492 #define SD_RESOLVED_NO_TRUST_ANCHOR (UINT64_C(1) << 14)
493 #define SD_RESOLVED_NO_NETWORK (UINT64_C(1) << 15)
494 #define SD_RESOLVED_NO_STALE (UINT64_C(1) << 24)
495 #define SD_RESOLVED_RELAX_SINGLE_LABEL (UINT64_C(1) << 25)
496
497 /* Output: Security */
498 #define SD_RESOLVED_AUTHENTICATED (UINT64_C(1) << 9)
499 #define SD_RESOLVED_CONFIDENTIAL (UINT64_C(1) << 18)
500
501 /* Output: Origin */
502 #define SD_RESOLVED_SYNTHETIC (UINT64_C(1) << 19)
503 #define SD_RESOLVED_FROM_CACHE (UINT64_C(1) << 20)
504 #define SD_RESOLVED_FROM_ZONE (UINT64_C(1) << 21)
505 #define SD_RESOLVED_FROM_TRUST_ANCHOR (UINT64_C(1) << 22)
506 #define SD_RESOLVED_FROM_NETWORK (UINT64_C(1) << 23)
507 .fi
508 .if n \{\
509 .RE
510 .\}
511 .PP
512 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,
513 systemd\-resolved
514 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\&.
515 .PP
516 On output, these five flags indicate which protocol was used to execute the operation, and hence where the data was found\&.
517 .PP
518 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\&.
519 .PP
520 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\&.
521 .PP
522 The NO_TXT and NO_ADDRESS flags only influence operation of the
523 \fBResolveService()\fR
524 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\&.
525 .PP
526 The NO_SEARCH flag turns off the search domain logic\&. It is only defined for input in
527 \fBResolveHostname()\fR\&. When specified, single\-label hostnames are not qualified using defined search domains, if any are configured\&. Note that
528 \fBResolveRecord()\fR
529 will never qualify single\-label domain names using search domains\&. Also note that multi\-label hostnames are never subject to search list expansion\&.
530 .PP
531 NO_VALIDATE can be set to disable validation via DNSSEC even if it would normally be used\&.
532 .PP
533 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
534 \fBsystemd-resolved.service\fR(8)
535 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\&.
536 .PP
537 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
538 "localhost"
539 or data from
540 /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
541 systemd\-resolved
542 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)\&.
543 .PP
544 CONFIDENTIAL means the query was resolved via encrypted channels or never left this system\&.
545 .PP
546 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\&.
547 .RE
548 .SS "Properties"
549 .PP
550 The
551 \fILLMNR\fR
552 and
553 \fIMulticastDNS\fR
554 properties report whether LLMNR and MulticastDNS are (globally) enabled\&. Each may be one of
555 "yes",
556 "no", and
557 "resolve"\&. See
558 \fBSetLinkLLMNR()\fR
559 and
560 \fBSetLinkMulticastDNS()\fR
561 above\&.
562 .PP
563 \fILLMNRHostname\fR
564 contains the hostname currently exposed on the network via LLMNR\&. It usually follows the system hostname as may be queried via
565 \fBgethostname\fR(3), but may differ if a conflict is detected on the network\&.
566 .PP
567 \fIDNS\fR
568 and
569 \fIDNSEx\fR
570 contain arrays of all DNS servers currently used by
571 systemd\-resolved\&.
572 \fIDNS\fR
573 contains information similar to the DNS server data in
574 /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)\&.
575 \fIDNSEx\fR
576 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
577 /etc/resolv\&.conf
578 or the
579 \fIDNS=\fR
580 setting in
581 /etc/systemd/resolved\&.conf, as well as per\-interface DNS server information either retrieved from
582 \fBsystemd-networkd\fR(8), or configured by external software via
583 \fBSetLinkDNS()\fR
584 or
585 \fBSetLinkDNSEx()\fR
586 (see above)\&. The network interface index will be 0 for the system\-wide configured services and non\-zero for the per\-link servers\&.
587 .PP
588 \fIFallbackDNS\fR
589 and
590 \fIFallbackDNSEx\fR
591 contain arrays of all DNS servers configured as fallback servers, if any, using the same format as
592 \fIDNS\fR
593 and
594 \fIDNSEx\fR
595 described above\&. See the description of
596 \fIFallbackDNS=\fR
597 in
598 \fBresolved.conf\fR(5)
599 for the description of when those servers are used\&.
600 .PP
601 \fICurrentDNSServer\fR
602 and
603 \fICurrentDNSServerEx\fR
604 specify the server that is currently used for query resolution, in the same format as a single entry in the
605 \fIDNS\fR
606 and
607 \fIDNSEx\fR
608 arrays described above\&.
609 .PP
610 Similarly, the
611 \fIDomains\fR
612 property contains an array of all search and routing domains currently used by
613 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)\&.
614 .PP
615 The
616 \fITransactionStatistics\fR
617 property contains information about the number of transactions
618 systemd\-resolved
619 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
620 systemd\-resolved
621 is processing or has processed\&. The latter value may be reset using the
622 \fBResetStatistics()\fR
623 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\&.
624 .PP
625 The
626 \fICacheStatistics\fR
627 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
628 \fBResetStatistics()\fR
629 (see above)\&.
630 .PP
631 The
632 \fIDNSSEC\fR
633 property specifies current status of DNSSEC validation\&. It is one of
634 "yes"
635 (validation is enforced),
636 "no"
637 (no validation is done),
638 "allow\-downgrade"
639 (validation is done if the current DNS server supports it)\&. See the description of
640 \fIDNSSEC=\fR
641 in
642 \fBresolved.conf\fR(5)\&.
643 .PP
644 The
645 \fIDNSSECStatistics\fR
646 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\&.
647 .PP
648 The
649 \fIDNSSECSupported\fR
650 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
651 systemd\-resolved
652 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\&.
653 .PP
654 The
655 \fIDNSOverTLS\fR
656 boolean property reports whether DNS\-over\-TLS is enabled\&.
657 .PP
658 The
659 \fIResolvConfMode\fR
660 property exposes how
661 /etc/resolv\&.conf
662 is managed on the host\&. Currently, the values
663 "uplink",
664 "stub",
665 "static"
666 (these three correspond to the three different files
667 systemd\-resolved\&.service
668 provides),
669 "foreign"
670 (the file is managed by admin or another service,
671 systemd\-resolved\&.service
672 just consumes it),
673 "missing"
674 (/etc/resolv\&.conf
675 is missing)\&.
676 .PP
677 The
678 \fIDNSStubListener\fR
679 property reports whether the stub listener on port 53 is enabled\&. Possible values are
680 "yes"
681 (enabled),
682 "no"
683 (disabled),
684 "udp"
685 (only the UDP listener is enabled), and
686 "tcp"
687 (only the TCP listener is enabled)\&.
688 .PP
689 The
690 \fIDNSSECNegativeTrustAnchors\fR
691 property contains a list of recognized DNSSEC negative trust anchors and contains a list of domains\&.
692 .SH "LINK OBJECT"
693 .sp
694 .if n \{\
695 .RS 4
696 .\}
697 .nf
698 node /org/freedesktop/resolve1/link/_1 {
699 interface org\&.freedesktop\&.resolve1\&.Link {
700 methods:
701 SetDNS(in a(iay) addresses);
702 SetDNSEx(in a(iayqs) addresses);
703 SetDomains(in a(sb) domains);
704 SetDefaultRoute(in b enable);
705 SetLLMNR(in s mode);
706 SetMulticastDNS(in s mode);
707 SetDNSOverTLS(in s mode);
708 SetDNSSEC(in s mode);
709 SetDNSSECNegativeTrustAnchors(in as names);
710 Revert();
711 properties:
712 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
713 readonly t ScopesMask = \&.\&.\&.;
714 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
715 readonly a(iay) DNS = [\&.\&.\&.];
716 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
717 readonly a(iayqs) DNSEx = [\&.\&.\&.];
718 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
719 readonly (iay) CurrentDNSServer = \&.\&.\&.;
720 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
721 readonly (iayqs) CurrentDNSServerEx = \&.\&.\&.;
722 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
723 readonly a(sb) Domains = [\&.\&.\&.];
724 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
725 readonly b DefaultRoute = \&.\&.\&.;
726 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
727 readonly s LLMNR = \*(Aq\&.\&.\&.\*(Aq;
728 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
729 readonly s MulticastDNS = \*(Aq\&.\&.\&.\*(Aq;
730 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
731 readonly s DNSOverTLS = \*(Aq\&.\&.\&.\*(Aq;
732 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
733 readonly s DNSSEC = \*(Aq\&.\&.\&.\*(Aq;
734 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
735 readonly as DNSSECNegativeTrustAnchors = [\*(Aq\&.\&.\&.\*(Aq, \&.\&.\&.];
736 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
737 readonly b DNSSECSupported = \&.\&.\&.;
738 };
739 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
740 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
741 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
742 };
743 .fi
744 .if n \{\
745 .RE
746 .\}
747 .sp
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772 .PP
773 For each Linux network interface a "Link" object is created which exposes per\-link DNS configuration and state\&. Use
774 \fBGetLink()\fR
775 on the Manager interface to retrieve the object path for a link object given the network interface index (see above)\&.
776 .SS "Methods"
777 .PP
778 The various methods exposed by the Link interface are equivalent to their similarly named counterparts on the Manager interface\&. e\&.g\&.
779 \fBSetDNS()\fR
780 on the Link object maps to
781 \fBSetLinkDNS()\fR
782 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
783 \fBGetLink()\fR
784 before invoking the methods\&. The same relationship holds for
785 \fBSetDNSEx()\fR,
786 \fBSetDomains()\fR,
787 \fBSetDefaultRoute()\fR,
788 \fBSetLLMNR()\fR,
789 \fBSetMulticastDNS()\fR,
790 \fBSetDNSOverTLS()\fR,
791 \fBSetDNSSEC()\fR,
792 \fBSetDNSSECNegativeTrustAnchors()\fR, and
793 \fBRevert()\fR\&. For further details on these methods see the
794 Manager
795 documentation above\&.
796 .SS "Properties"
797 .PP
798 \fIScopesMask\fR
799 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\&.
800 .PP
801 \fIDNSSECSupported\fR
802 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\&.
803 .PP
804 \fIDefaultRoute\fR
805 exposes a boolean field that indicates whether the interface will be used as default route for name queries\&. See
806 \fBSetLinkDefaultRoute()\fR
807 above\&.
808 .PP
809 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
810 \fBSetDNS()\fR
811 or
812 \fBSetLLMNR()\fR\&.
813 .SH "COMMON ERRORS"
814 .PP
815 Many bus methods
816 systemd\-resolved
817 exposes (in particular the resolver methods such as
818 \fBResolveHostname()\fR
819 on the
820 Manager
821 interface) may return some of the following errors:
822 .PP
823 \fBorg\&.freedesktop\&.resolve1\&.NoNameServers\fR
824 .RS 4
825 No suitable DNS servers were found to resolve a request\&.
826 .sp
827 Added in version 246\&.
828 .RE
829 .PP
830 \fBorg\&.freedesktop\&.resolve1\&.InvalidReply\fR
831 .RS 4
832 A response from the selected DNS server was not understood\&.
833 .sp
834 Added in version 246\&.
835 .RE
836 .PP
837 \fBorg\&.freedesktop\&.resolve1\&.NoSuchRR\fR
838 .RS 4
839 The requested name exists, but there is no resource record of the requested type for it\&. (This is the DNS NODATA case)\&.
840 .sp
841 Added in version 246\&.
842 .RE
843 .PP
844 \fBorg\&.freedesktop\&.resolve1\&.CNameLoop\fR
845 .RS 4
846 The look\-up failed because a CNAME or DNAME loop was detected\&.
847 .sp
848 Added in version 246\&.
849 .RE
850 .PP
851 \fBorg\&.freedesktop\&.resolve1\&.Aborted\fR
852 .RS 4
853 The look\-up was aborted because the selected protocol became unavailable while the operation was ongoing\&.
854 .sp
855 Added in version 246\&.
856 .RE
857 .PP
858 \fBorg\&.freedesktop\&.resolve1\&.NoSuchService\fR
859 .RS 4
860 A service look\-up was successful, but the
861 \fBSRV\fR
862 record reported that the service is not available\&.
863 .sp
864 Added in version 246\&.
865 .RE
866 .PP
867 \fBorg\&.freedesktop\&.resolve1\&.DnssecFailed\fR
868 .RS 4
869 The acquired response did not pass DNSSEC validation\&.
870 .sp
871 Added in version 246\&.
872 .RE
873 .PP
874 \fBorg\&.freedesktop\&.resolve1\&.NoTrustAnchor\fR
875 .RS 4
876 No chain of trust could be established for the response to a configured DNSSEC trust anchor\&.
877 .sp
878 Added in version 246\&.
879 .RE
880 .PP
881 \fBorg\&.freedesktop\&.resolve1\&.ResourceRecordTypeUnsupported\fR
882 .RS 4
883 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\&.
884 .sp
885 Added in version 246\&.
886 .RE
887 .PP
888 \fBorg\&.freedesktop\&.resolve1\&.NoSuchLink\fR
889 .RS 4
890 No network interface with the specified network interface index exists\&.
891 .sp
892 Added in version 246\&.
893 .RE
894 .PP
895 \fBorg\&.freedesktop\&.resolve1\&.LinkBusy\fR
896 .RS 4
897 The requested configuration change could not be made because
898 \fBsystemd-networkd\fR(8), already took possession of the interface and supplied configuration data for it\&.
899 .sp
900 Added in version 246\&.
901 .RE
902 .PP
903 \fBorg\&.freedesktop\&.resolve1\&.NetworkDown\fR
904 .RS 4
905 The requested look\-up failed because the system is currently not connected to any suitable network\&.
906 .sp
907 Added in version 246\&.
908 .RE
909 .PP
910 \fBorg\&.freedesktop\&.resolve1\&.DnsError\&.NXDOMAIN\fR, \fBorg\&.freedesktop\&.resolve1\&.DnsError\&.REFUSED\fR, \&.\&.\&.
911 .RS 4
912 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
913 \m[blue]\fBDNS\ \&RCODEs\fR\m[]\&\s-2\u[4]\d\s+2\&.
914 .sp
915 Added in version 246\&.
916 .RE
917 .SH "EXAMPLES"
918 .PP
919 \fBExample\ \&1.\ \&Introspect org\&.freedesktop\&.resolve1\&.Manager on the bus\fR
920 .sp
921 .if n \{\
922 .RS 4
923 .\}
924 .nf
925 $ gdbus introspect \-\-system \e
926 \-\-dest org\&.freedesktop\&.resolve1 \e
927 \-\-object\-path /org/freedesktop/resolve1
928 .fi
929 .if n \{\
930 .RE
931 .\}
932 .PP
933 \fBExample\ \&2.\ \&Introspect org\&.freedesktop\&.resolve1\&.Link on the bus\fR
934 .sp
935 .if n \{\
936 .RS 4
937 .\}
938 .nf
939 $ gdbus introspect \-\-system \e
940 \-\-dest org\&.freedesktop\&.resolve1 \e
941 \-\-object\-path /org/freedesktop/resolve1/link/_11
942 .fi
943 .if n \{\
944 .RE
945 .\}
946 .SH "VERSIONING"
947 .PP
948 These D\-Bus interfaces follow
949 \m[blue]\fBthe usual interface versioning guidelines\fR\m[]\&\s-2\u[5]\d\s+2\&.
950 .SH "HISTORY"
951 .SS "The Manager Object"
952 .PP
953 \fBGetDelegate()\fR
954 and
955 \fBListDelegates()\fR
956 were added in version 258\&.
957 .SH "SEE ALSO"
958 .PP
959 \fBsystemd\fR(1), \fBsystemd-resolved.service\fR(8), \fBresolvectl\fR(1)
960 .SH "NOTES"
961 .IP " 1." 4
962 Writing Network Configuration Managers
963 .RS 4
964 \%https://wiki.freedesktop.org/www/Software/systemd/writing-network-configuration-managers
965 .RE
966 .IP " 2." 4
967 Writing Resolver Clients
968 .RS 4
969 \%https://wiki.freedesktop.org/www/Software/systemd/writing-resolver-clients
970 .RE
971 .IP " 3." 4
972 RFC\ \&1035
973 .RS 4
974 \%https://www.ietf.org/rfc/rfc1035.txt
975 .RE
976 .IP " 4." 4
977 DNS\ \&RCODEs
978 .RS 4
979 \%https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6
980 .RE
981 .IP " 5." 4
982 the usual interface versioning guidelines
983 .RS 4
984 \%https://0pointer.de/blog/projects/versioning-dbus.html
985 .RE