]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/org.freedesktop.resolve1.xml
tree-wide: use "hostname" spelling everywhere
[thirdparty/systemd.git] / man / org.freedesktop.resolve1.xml
1 <?xml version="1.0"?>
2 <!--*-nxml-*-->
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
5 <!ENTITY % entities SYSTEM "custom-entities.ent" >
6 %entities;
7 ]>
8 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
9
10 <refentry id="org.freedesktop.resolve1" conditional='ENABLE_RESOLVE'
11 xmlns:xi="http://www.w3.org/2001/XInclude">
12 <refentryinfo>
13 <title>org.freedesktop.resolve1</title>
14 <productname>systemd</productname>
15 </refentryinfo>
16
17 <refmeta>
18 <refentrytitle>org.freedesktop.resolve1</refentrytitle>
19 <manvolnum>5</manvolnum>
20 </refmeta>
21
22 <refnamediv>
23 <refname>org.freedesktop.resolve1</refname>
24 <refpurpose>The D-Bus interface of systemd-resolved</refpurpose>
25 </refnamediv>
26
27 <refsect1>
28 <title>Introduction</title>
29
30 <para>
31 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
32 is a system service that provides hostname resolution and caching using DNS, LLMNR, and mDNS. It also
33 does DNSSEC validation. This page describes the resolve semantics and the D-Bus interface.</para>
34
35 <para>This page contains an API reference only. If you are looking for a longer explanation how to use
36 this API, please consult
37 <ulink url="https://wiki.freedesktop.org/www/Software/systemd/writing-network-configuration-managers">
38 Writing Network Configuration Managers</ulink> and
39 <ulink url="https://wiki.freedesktop.org/www/Software/systemd/writing-resolver-clients">Writing Resolver
40 Clients</ulink>.
41 </para>
42 </refsect1>
43
44 <refsect1>
45 <title>The Manager Object</title>
46
47 <para>The service exposes the following interfaces on the Manager object on the bus:</para>
48
49 <programlisting>
50 $ gdbus introspect --system \
51 --dest org.freedesktop.resolve1 \
52 --object-path /org/freedesktop/resolve1
53
54 node /org/freedesktop/resolve1 {
55 interface org.freedesktop.resolve1.Manager {
56 methods:
57 ResolveHostname(in i ifindex,
58 in s name,
59 in i family,
60 in t flags,
61 out a(iiay) addresses,
62 out s canonical,
63 out t flags);
64 ResolveAddress(in i ifindex,
65 in i family,
66 in ay address,
67 in t flags,
68 out a(is) names,
69 out t flags);
70 ResolveRecord(in i ifindex,
71 in s name,
72 in q class,
73 in q type,
74 in t flags,
75 out a(iqqay) records,
76 out t flags);
77 ResolveService(in i ifindex,
78 in s name,
79 in s type,
80 in s domain,
81 in i family,
82 in t flags,
83 out a(qqqsa(iiay)s) srv_data,
84 out aay txt_data,
85 out s canonical_name,
86 out s canonical_type,
87 out s canonical_domain,
88 out t flags);
89 GetLink(in i ifindex,
90 out o path);
91 SetLinkDNS(in i ifindex,
92 in a(iay) addresses);
93 SetLinkDomains(in i ifindex,
94 in a(sb) domains);
95 SetLinkDefaultRoute(in i ifindex,
96 in b enable);
97 SetLinkLLMNR(in i ifindex,
98 in s mode);
99 SetLinkMulticastDNS(in i ifindex,
100 in s mode);
101 SetLinkDNSOverTLS(in i ifindex,
102 in s mode);
103 SetLinkDNSSEC(in i ifindex,
104 in s mode);
105 SetLinkDNSSECNegativeTrustAnchors(in i ifindex,
106 in as names);
107 RevertLink(in i ifindex);
108 RegisterService(in s name,
109 in s name_template,
110 in s type,
111 in q service_port,
112 in q service_priority,
113 in q serwise_weight,
114 in aa{say} txt_datas,
115 out o service_path);
116 UnregisterService(in o service_path);
117 ResetStatistics();
118 FlushCaches();
119 ResetServerFeatures();
120 properties:
121 readonly s LLMNRHostname = '...';
122 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
123 readonly s LLMNR = '...';
124 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
125 readonly s MulticastDNS = '...';
126 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
127 readonly s DNSOverTLS = '...';
128 readonly a(iiay) DNS = [...];
129 @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
130 readonly a(iiay) FallbackDNS = [...];
131 readonly (iiay) CurrentDNSServer = ...;
132 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
133 readonly a(isb) Domains = [...];
134 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
135 readonly (tt) TransactionStatistics = ...;
136 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
137 readonly (ttt) CacheStatistics = ...;
138 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
139 readonly s DNSSEC = '...';
140 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
141 readonly (tttt) DNSSECStatistics = ...;
142 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
143 readonly b DNSSECSupported = ...;
144 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
145 readonly as DNSSECNegativeTrustAnchors = ['...', ...];
146 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
147 readonly s DNSStubListener = '...';
148 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
149 @org.freedesktop.systemd1.Privileged("true")
150 readwrite s LogLevel = '...';
151 };
152 interface org.freedesktop.DBus.Peer { ... };
153 interface org.freedesktop.DBus.Introspectable { ... };
154 interface org.freedesktop.DBus.Properties { ... };
155 };
156 </programlisting>
157
158 <!--method SetLinkDefaultRoute is not documented!-->
159
160 <!--method SetLinkDNSOverTLS is not documented!-->
161
162 <!--method RegisterService is not documented!-->
163
164 <!--method UnregisterService is not documented!-->
165
166 <!--method FlushCaches is not documented!-->
167
168 <!--method ResetServerFeatures is not documented!-->
169
170 <!--property LLMNR is not documented!-->
171
172 <!--property MulticastDNS is not documented!-->
173
174 <!--property DNSOverTLS is not documented!-->
175
176 <!--property FallbackDNS is not documented!-->
177
178 <!--property CurrentDNSServer is not documented!-->
179
180 <!--property DNSSEC is not documented!-->
181
182 <!--property DNSSECNegativeTrustAnchors is not documented!-->
183
184 <!--property DNSStubListener is not documented!-->
185
186 <!--Autogenerated cross-references for systemd.directives, do not edit-->
187
188 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.resolve1.Manager"/>
189
190 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.resolve1.Manager"/>
191
192 <variablelist class="dbus-method" generated="True" extra-ref="ResolveHostname()"/>
193
194 <variablelist class="dbus-method" generated="True" extra-ref="ResolveAddress()"/>
195
196 <variablelist class="dbus-method" generated="True" extra-ref="ResolveRecord()"/>
197
198 <variablelist class="dbus-method" generated="True" extra-ref="ResolveService()"/>
199
200 <variablelist class="dbus-method" generated="True" extra-ref="GetLink()"/>
201
202 <variablelist class="dbus-method" generated="True" extra-ref="SetLinkDNS()"/>
203
204 <variablelist class="dbus-method" generated="True" extra-ref="SetLinkDomains()"/>
205
206 <variablelist class="dbus-method" generated="True" extra-ref="SetLinkDefaultRoute()"/>
207
208 <variablelist class="dbus-method" generated="True" extra-ref="SetLinkLLMNR()"/>
209
210 <variablelist class="dbus-method" generated="True" extra-ref="SetLinkMulticastDNS()"/>
211
212 <variablelist class="dbus-method" generated="True" extra-ref="SetLinkDNSOverTLS()"/>
213
214 <variablelist class="dbus-method" generated="True" extra-ref="SetLinkDNSSEC()"/>
215
216 <variablelist class="dbus-method" generated="True" extra-ref="SetLinkDNSSECNegativeTrustAnchors()"/>
217
218 <variablelist class="dbus-method" generated="True" extra-ref="RevertLink()"/>
219
220 <variablelist class="dbus-method" generated="True" extra-ref="RegisterService()"/>
221
222 <variablelist class="dbus-method" generated="True" extra-ref="UnregisterService()"/>
223
224 <variablelist class="dbus-method" generated="True" extra-ref="ResetStatistics()"/>
225
226 <variablelist class="dbus-method" generated="True" extra-ref="FlushCaches()"/>
227
228 <variablelist class="dbus-method" generated="True" extra-ref="ResetServerFeatures()"/>
229
230 <variablelist class="dbus-property" generated="True" extra-ref="LLMNRHostname"/>
231
232 <variablelist class="dbus-property" generated="True" extra-ref="LLMNR"/>
233
234 <variablelist class="dbus-property" generated="True" extra-ref="MulticastDNS"/>
235
236 <variablelist class="dbus-property" generated="True" extra-ref="DNSOverTLS"/>
237
238 <variablelist class="dbus-property" generated="True" extra-ref="DNS"/>
239
240 <variablelist class="dbus-property" generated="True" extra-ref="FallbackDNS"/>
241
242 <variablelist class="dbus-property" generated="True" extra-ref="CurrentDNSServer"/>
243
244 <variablelist class="dbus-property" generated="True" extra-ref="Domains"/>
245
246 <variablelist class="dbus-property" generated="True" extra-ref="TransactionStatistics"/>
247
248 <variablelist class="dbus-property" generated="True" extra-ref="CacheStatistics"/>
249
250 <variablelist class="dbus-property" generated="True" extra-ref="DNSSEC"/>
251
252 <variablelist class="dbus-property" generated="True" extra-ref="DNSSECStatistics"/>
253
254 <variablelist class="dbus-property" generated="True" extra-ref="DNSSECSupported"/>
255
256 <variablelist class="dbus-property" generated="True" extra-ref="DNSSECNegativeTrustAnchors"/>
257
258 <variablelist class="dbus-property" generated="True" extra-ref="DNSStubListener"/>
259
260 <variablelist class="dbus-property" generated="True" extra-ref="LogLevel"/>
261
262 <!--End of Autogenerated section-->
263
264 <refsect2>
265 <title>Methods</title>
266
267 <para><function>ResolveHostname()</function> takes a hostname and resolves it to one or more IP addresses.
268 As parameters it takes the Linux network interface index to execute the query on, or 0 if it may be
269 done on any suitable interface. The <varname>name</varname> parameter specifies the hostname to
270 resolve. Note that if required, IDNA conversion is applied to this name unless it is resolved via LLMNR or MulticastDNS. The <varname>family</varname> parameter
271 limits the results to a specific address family. It may be <constant>AF_INET</constant>,
272 <constant>AF_INET6</constant> or <constant>AF_UNSPEC</constant>. If <constant>AF_UNSPEC</constant> is specified (recommended), both kinds are retrieved, subject
273 to local network configuration (i.e. if no local, routable IPv6 address is found, no IPv6 address is
274 retrieved; and similarly for IPv4). A 64-bit <varname>flags</varname> field may be used to alter the
275 behaviour of the resolver operation (see below). The method returns an array of address records. Each
276 address record consists of the interface index the address belongs to, an address family as well as a
277 byte array with the actual IP address data (which either has 4 or 16 elements, depending on the address
278 family). The returned address family will be one of <constant>AF_INET</constant> or
279 <constant>AF_INET6</constant>. For IPv6, the returned address interface index should be used to
280 initialize the .sin6_scope_id field of a <structname>struct sockaddr_in6</structname> instance to permit
281 support for resolution to link-local IP addresses. The address array is followed by the canonical name
282 of the host, which may or may not be identical to the resolved hostname. Finally, a 64-bit
283 <varname>flags</varname> field is returned that is defined similarly to the <varname>flags</varname>
284 field that was passed in, but contains information about the resolved data (see below). If the hostname
285 passed in is an IPv4 or IPv6 address formatted as string, it is parsed, and the result is returned. In
286 this case, no network communication is done.</para>
287
288 <para><function>ResolveAddress()</function> executes the reverse operation: it takes an IP address and
289 acquires one or more hostnames for it. As parameters it takes the interface index to execute the query
290 on, or <constant>0</constant> if all suitable interfaces are OK. The <varname>family</varname>
291 parameter indicates the address family of the IP address to resolve. It may be either
292 <constant>AF_INET</constant> or <constant>AF_INET6</constant>. The <varname>address</varname> parameter
293 takes the raw IP address data (as either a 4 or 16 byte array). The <varname>flags</varname> input
294 parameter may be used to alter the resolver operation (see below). The method returns an array of name
295 records, each consisting of an interface index and a hostname. The <varname>flags</varname> output
296 field contains additional information about the resolver operation (see below).</para>
297
298 <para><function>ResolveRecord()</function> takes a DNS resource record (RR) type, class and name, and
299 retrieves the full resource record set (RRset), including the RDATA, for it. As parameter it takes the
300 Linux network interface index to execute the query on, or <constant>0</constant> if it may be done on
301 any suitable interface. The <varname>name</varname> parameter specifies the RR domain name to look up
302 (no IDNA conversion is applied), followed by the 16-bit class and type fields (which may be
303 ANY). Finally, a <varname>flags</varname> field may be passed in to alter behaviour of the look-up (see
304 below). On completion, an array of RR items is returned. Each array entry consists of the network interface
305 index the RR was discovered on, the type and class field of the RR found, and a byte array of the raw
306 RR discovered. The raw RR data starts with the RR's domain name, in the original casing, followed
307 by the RR type, class, TTL and RDATA, in the binary format documented in
308 <ulink url="https://www.ietf.org/rfc/rfc1035.txt">RFC 1035</ulink>. For RRs that support name
309 compression in the payload (such as MX or PTR), the compression is expanded in the returned
310 data.</para>
311
312 <para>Note that currently, the class field has to be specified as IN or ANY. Specifying a different
313 class will return an error indicating that look-ups of this kind are unsupported. Similarly, some
314 special types are not supported either (AXFR, OPT, …). While <filename>systemd-resolved</filename> parses and validates resource
315 records of many types, it is crucial that clients using this API understand that the RR data originates
316 from the network and should be thoroughly validated before use.</para>
317
318 <para><function>ResolveService()</function> may be used to resolve a DNS SRV service record, as well as the
319 hostnames referenced in it, and possibly an accompanying DNS-SD TXT record containing additional
320 service metadata. The primary benefit of using this method over <function>ResolveRecord()</function>
321 specifying the SRV type is that it will resolve the SRV and TXT RRs as well as the hostnames referenced
322 in the SRV in a single operation. As parameters it takes a Linux network interface index, a service
323 name, a service type and a service domain. This method may be invoked in three different modes:</para>
324
325 <orderedlist>
326 <listitem><para>To resolve a DNS-SD service, specify the service name (e.g. <literal>Lennart's
327 Files</literal>), the service type (e.g. <literal>_webdav._tcp</literal>) and the domain to search in
328 (e.g. <literal>local</literal>) as the three service parameters. The service name must be in UTF-8
329 format, and no IDNA conversion is applied to it in this mode (as mandated by the DNS-SD
330 specifications). However, if necessary, IDNA conversion is applied to the domain parameter.</para>
331 </listitem>
332
333 <listitem><para>To resolve a plain SRV record, set the service name parameter to the empty string
334 and set the service type and domain properly. (IDNA conversion is applied to the domain, if
335 necessary.)</para></listitem>
336
337 <listitem><para>Alternatively, leave both the service name and type empty and specify the full
338 domain name of the SRV record (i.e. prefixed with the service type) in the domain parameter. (No IDNA
339 coversion is applied in this mode.)</para></listitem>
340 </orderedlist>
341
342 <para>The <varname>family</varname> parameter of the <function>ResolveService()</function> method encodes
343 the desired family of the addresses to resolve (use <constant>AF_INET</constant>,
344 <constant>AF_INET6</constant>, or <constant>AF_UNSPEC</constant>). If this is enabled (Use the
345 <constant>NO_ADDRESS</constant> flag to turn address resolution off, see below). The
346 <varname>flags</varname> parameter takes a couple of flags that may be used to alter the resolver
347 operation.</para>
348
349 <para>On completion, <function>ResolveService()</function> returns an array of SRV record structures. Each
350 items consisting of the priority, weight and port fields as well as the hostname to contact, as encoded in the SRV
351 record. Immediately following is an array of the addresses of this hostname, with each item consisting
352 of the interface index, the address family and the address data in a byte array. This address array is
353 followed by the canonicalized hostname. After this array of SRV record structures an array of byte
354 arrays follows that encodes the TXT RR strings, in case DNS-SD look-ups are enabled. The next parameters
355 are the canonical service name, type and domain. This may or may not be identical to the parameters
356 passed in. Finally, a <varname>flags</varname> field is returned that contains information about the
357 resolver operation performed.</para>
358
359 <para>The <function>ResetStatistics()</function> method resets the various statistics counters that
360 <filename>systemd-resolved</filename> maintains to zero. (For details, see the statistics properties below.)</para>
361
362 <para>The <function>GetLink()</function> method takes a network interface index and returns the object
363 path to the <interfacename>org.freedesktop.resolve1.Link</interfacename> object corresponding to it.
364 </para>
365
366 <para>The <function>SetLinkDNS()</function> method sets the DNS servers to use on a specific
367 interface. This method (and the following ones) may be used by network management software to configure
368 per-interface DNS settings. It takes a network interface index as well as an array of DNS server IP
369 address records. Each array item consists of an address family (either <constant>AF_INET</constant> or
370 <constant>AF_INET6</constant>), followed by a 4-byte or 16-byte array with the raw address data. This
371 method is a one-step shortcut for retrieving the Link object for a network interface using
372 <function>GetLink()</function> (see above) and then invoking the <function>SetDNS()</function> method
373 (see below) on it.
374 </para>
375
376 <para>Network management software integrating with <filename>systemd-resolved</filename> should
377 call this method (and the five below) after the interface appeared in the kernel (and thus after a
378 network interface index has been assigned), but before the network interfaces is activated
379 (<constant>IFF_UP</constant> set) so that all settings take effect during the full time the network
380 interface is up. It is safe to alter settings while the interface is up, however. Use
381 <function>RevertLink()</function> (described below) to reset all per-interface settings.</para>
382
383 <para>The <function>SetLinkDomains()</function> method sets the search and routing domains to use on a
384 specific network interface for DNS look-ups. It takes a network interface index and an array of domains,
385 each with a boolean parameter indicating whether the specified domain shall be used as a search domain
386 (false), or just as a routing domain (true). Search domains are used for qualifying single-label names into
387 FQDN when looking up hostnames, as well as for making routing decisions on which interface to send
388 queries ending in the domain to. Routing domains are only used for routing decisions and not used for single-label
389 name qualification. Pass the search domains in the order they should be used.</para>
390
391 <para>The <function>SetLinkLLMNR()</function> method enables or disables LLMNR support on a specific
392 network interface. It takes a network interface index as well as a string that may either be empty or one of
393 <literal>yes</literal>, <literal>no</literal> or <literal>resolve</literal>. If empty, the systemd-wide
394 default LLMNR setting is used. If <literal>yes</literal>, LLMNR is used for resolution of single-label
395 names and the local hostname is registered on all local LANs for LLMNR resolution by peers. If
396 <literal>no</literal>, LLMNR is turned off fully on this interface. If <literal>resolve</literal>, LLMNR
397 is only enabled for resolving names, but the local hostname is not registered for other peers to
398 use.</para>
399
400 <para>Similarly, the <function>SetLinkMulticastDNS()</function> method enables or disables MulticastDNS
401 support on a specific interface. It takes the same parameters as <function>SetLinkLLMNR()</function>
402 described above.</para>
403
404 <para>The <function>SetLinkDNSSEC()</function> method enables or disables DNSSEC validation on a
405 specific network interface. It takes a network interface index as well as a string that may either be
406 empty or one of <literal>yes</literal>, <literal>no</literal>, or <literal>allow-downgrade</literal>. When
407 empty, the system-wide default DNSSEC setting is used. If <literal>yes</literal>, full DNSSEC validation
408 is done for all look-ups. If the selected DNS server does not support DNSSEC, look-ups will fail if this
409 mode is used. If <literal>no</literal>, DNSSEC validation is fully disabled. If
410 <literal>allow-downgrade</literal>, DNSSEC validation is enabled, but is turned off automatically if the
411 selected server does not support it (thus opening up behaviour to downgrade attacks). Note that DNSSEC
412 only applies to traditional DNS, not to LLMNR or MulticastDNS.</para>
413
414 <para>The <function>SetLinkDNSSECNegativeTrustAnchors()</function> method may be used to configure DNSSEC
415 Negative Trust Anchors (NTAs) for a specific network interface. It takes a network interface index and a
416 list of domains as arguments.</para>
417
418 <para>The <function>RevertLink()</function> method may be used to revert all per-link settings done with
419 the six methods described above to the defaults again.</para>
420
421 <refsect3>
422 <title>The Flags Parameter</title>
423
424 <para>The four methods above accept and return a 64-bit flags value. In most cases passing 0 is sufficient
425 and recommended. However, the following flags are defined to alter the look-up:</para>
426
427 <programlisting>
428 #define SD_RESOLVED_DNS (UINT64_C(1) &lt;&lt; 0)
429 #define SD_RESOLVED_LLMNR_IPV4 (UINT64_C(1) &lt;&lt; 1)
430 #define SD_RESOLVED_LLMNR_IPV6 (UINT64_C(1) &lt;&lt; 2)
431 #define SD_RESOLVED_MDNS_IPV4 (UINT64_C(1) &lt;&lt; 3)
432 #define SD_RESOLVED_MDNS_IPV6 (UINT64_C(1) &lt;&lt; 4)
433 #define SD_RESOLVED_NO_CNAME (UINT64_C(1) &lt;&lt; 5)
434 #define SD_RESOLVED_NO_TXT (UINT64_C(1) &lt;&lt; 6)
435 #define SD_RESOLVED_NO_ADDRESS (UINT64_C(1) &lt;&lt; 7)
436 #define SD_RESOLVED_NO_SEARCH (UINT64_C(1) &lt;&lt; 8)
437 #define SD_RESOLVED_AUTHENTICATED (UINT64_C(1) &lt;&lt; 9)
438 </programlisting>
439
440 <para>On input, the first five flags control the protocols to use for the look-up. They refer to
441 classic unicast DNS, LLMNR via IPv4/UDP and IPv6/UDP respectively, as well as MulticastDNS via
442 IPv4/UDP and IPv6/UDP. If all of these five bits are off on input (which is strongly recommended) the
443 look-up will be done via all suitable protocols for the specific look-up. Note that these flags
444 operate as filter only, but cannot force a look-up to be done via a protocol. Specifically, <filename>systemd-resolved</filename>
445 will only route look-ups within the .local TLD to MulticastDNS (plus some reverse look-up address
446 domains), and single-label names to LLMNR (plus some reverse address lookup domains). It will route
447 neither of these to Unicast DNS servers. Also, it will do LLMNR and Multicast DNS only on interfaces
448 suitable for multicast.</para>
449
450 <para>On output, these five flags indicate which protocol was used to execute the operation, and hence
451 where the data was found.</para>
452
453 <para>The primary use cases for these five flags are follow-up look-ups based on DNS data retrieved
454 earlier. In this case it is often a good idea to limit the follow-up look-up to the protocol that was
455 used to discover the first DNS result.</para>
456
457 <para>The NO_CNAME flag controls whether CNAME/DNAME resource records shall be followed during the
458 look-up. This flag is only available at input, none of the functions will return it on output. If a
459 CNAME/DNAME RR is discovered while resolving a hostname, an error is returned instead. By default,
460 when the flag is off, CNAME/DNAME RRs are followed.</para>
461
462 <para>The NO_TXT and NO_ADDRESS flags only influence operation of the
463 <function>ResolveService()</function> method. They are only defined for input, not output. If
464 NO_TXT set, the DNS-SD TXT RR look-up is not done in the same operation. If NO_ADDRESS is specified,
465 the hostnames discovered are not implicitly translated to their addresses.</para>
466
467 <para>The NO_SEARCH flag turns off the search domain logic. It is only defined for input in
468 <function>ResolveHostname()</function>. When specified, single-label hostnames are not qualified
469 using defined search domains, if any are configured. Note that <function>ResolveRecord()</function>
470 will never qualify single-label domain names using search domains. Also note that
471 multi-label hostnames are never subject to search list expansion.</para>
472
473 <para>The AUTHENTICATED bit is defined only in the output flags of the four functions. If set, the
474 returned data has been fully authenticated. Specifically, this bit is set for all DNSSEC-protected data
475 for which a full trust chain may be established to a trusted domain anchor. It is also set for locally
476 synthesized data, such as <literal>localhost</literal> or data from
477 <filename>/etc/hosts</filename>. Moreover, it is set for all LLMNR or mDNS RRs which originate from the
478 local host. Applications that require authenticated RR data for operation should check this flag before
479 trusting the data. Note that <filename>systemd-resolved</filename> will never return invalidated data, hence this flag
480 simply allows to discern the cases where data is known to be trustable, or where there is proof that
481 the data is "rightfully" unauthenticated (which includes cases where the underlying protocol or server
482 does not support authenticating data).</para>
483 </refsect3>
484
485 </refsect2>
486
487 <refsect2>
488 <title>Properties</title>
489
490 <para><varname>LLMNRHostname</varname> contains the hostname currently exposed on the network via
491 LLMNR. It usually follows the system hostname as may be queried via
492 <citerefentry project="man-pages"><refentrytitle>gethostname</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
493 but may differ if a conflict is detected on the network.</para>
494
495 <para><varname>DNS</varname> contains an array of all DNS servers currently used by
496 <filename>systemd-resolved</filename>. It contains similar information as the DNS server data written to
497 /run/systemd/resolve/resolv.conf. Each structure in the array consists of a numeric network interface
498 index, an address family, and a byte array containing the DNS server address (either 4 bytes in length
499 for IPv4 or 16 bytes in lengths for IPv6). The array contains DNS servers configured system-wide,
500 including those possibly read from a foreign <filename>/etc/resolv.conf</filename> or the
501 <varname>DNS=</varname> setting in <filename>/etc/systemd/resolved.conf</filename>, as well as
502 per-interface DNS server information either retrieved from
503 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
504 or configured by external software via <function>SetLinkDNS()</function> (see above). The network
505 interface index will be 0 for the system-wide configured services and non-zero for the per-link
506 servers.</para>
507
508 <para>Similarly, the <varname>Domains</varname> property contains an array of all search and
509 routing domains currently used by <filename>systemd-resolved</filename>. Each entry consists of a network interface index (again, 0
510 encodes system-wide entries), the actual domain name, and whether the entry is used only for routing
511 (true) or for both routing and searching (false).</para>
512
513 <para>The <varname>TransactionStatistics</varname> property contains information about the number of
514 transactions <filename>systemd-resolved</filename> has processed. It contains a pair of unsigned 64-bit counters, the first
515 containing the number of currently ongoing transactions, the second the number of total transactions
516 <filename>systemd-resolved</filename> is processing or has processed. The latter value may be reset using the
517 <function>ResetStatistics()</function> method described above. Note that the number of transactions does
518 not directly map to the number of issued resolver bus method calls. While simple look-ups usually require a
519 single transaction only, more complex look-ups might result in more, for example when CNAMEs or DNSSEC
520 are in use.</para>
521
522 <para>The <varname>CacheStatistics</varname> property contains information about the executed cache
523 operations so far. It exposes three 64-bit counters: the first being the total number of current cache
524 entries (both positive and negative), the second the number of cache hits, and the third the number of
525 cache misses. The latter counters may be reset using <function>ResetStatistics()</function> (see
526 above). </para>
527
528 <para>The <varname>DNSSECStatistics</varname> property contains information about the DNSSEC
529 validations executed so far. It contains four 64-bit counters: the number of secure, insecure, bogus,
530 and indeterminate DNSSEC validations so far. The counters are increased for each validated RRset, and
531 each non-existance proof. The secure counter is increased for each operation that successfully verified
532 a signed reply, the insecure counter is increased for each operation that successfully verified that an
533 unsigned reply is rightfully unsigned. The bogus counter is increased for each operation where the
534 validation did not check out and the data is likely to have been tempered with. Finally the
535 indeterminate counter is increased for each operation which did not complete because the necessary keys
536 could not be acquired or the cryptographic algorithms were unknown.</para>
537
538 <para>The <varname>DNSSECSupported</varname> boolean property reports whether DNSSEC is enabled and
539 the selected DNS servers support it. It combines information about system-wide and per-link DNS
540 settings (see below), and only reports true if DNSSEC is enabled and supported on every interface for
541 which DNS is configured and for the system-wide settings if there are any. Note that <filename>systemd-resolved</filename> assumes
542 DNSSEC is supported by DNS servers until it verifies that this is not the case. Thus, the reported
543 value may initially be true, until the first transactions are executed.</para>
544
545 <para>The <varname>LogLevel</varname> property shows the (maximum) log level of the manager, with the
546 same values as the <option>--log-level=</option> option described in
547 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
548 </refsect2>
549 </refsect1>
550
551 <refsect1>
552 <title>Link Object</title>
553
554 <programlisting>
555 $ gdbus introspect --system \
556 --dest org.freedesktop.resolve1 \
557 --object-path /org/freedesktop/resolve1/link/_34
558
559 node /org/freedesktop/resolve1/link/_34 {
560 interface org.freedesktop.resolve1.Link {
561 methods:
562 SetDNS(in a(iay) addresses);
563 SetDomains(in a(sb) domains);
564 SetDefaultRoute(in b enable);
565 SetLLMNR(in s mode);
566 SetMulticastDNS(in s mode);
567 SetDNSOverTLS(in s mode);
568 SetDNSSEC(in s mode);
569 SetDNSSECNegativeTrustAnchors(in as names);
570 Revert();
571 properties:
572 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
573 readonly t ScopesMask = ...;
574 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
575 readonly a(iay) DNS = [...];
576 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
577 readonly (iay) CurrentDNSServer = ...;
578 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
579 readonly a(sb) Domains = [...];
580 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
581 readonly b DefaultRoute = ...;
582 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
583 readonly s LLMNR = '...';
584 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
585 readonly s MulticastDNS = '...';
586 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
587 readonly s DNSOverTLS = '...';
588 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
589 readonly s DNSSEC = '...';
590 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
591 readonly as DNSSECNegativeTrustAnchors = ['...', ...];
592 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
593 readonly b DNSSECSupported = ...;
594 };
595 interface org.freedesktop.DBus.Peer { ... };
596 interface org.freedesktop.DBus.Introspectable { ... };
597 interface org.freedesktop.DBus.Properties { ... };
598 };
599 </programlisting>
600
601 <!--method SetDomains is not documented!-->
602
603 <!--method SetDefaultRoute is not documented!-->
604
605 <!--method SetLLMNR is not documented!-->
606
607 <!--method SetMulticastDNS is not documented!-->
608
609 <!--method SetDNSOverTLS is not documented!-->
610
611 <!--method SetDNSSEC is not documented!-->
612
613 <!--method SetDNSSECNegativeTrustAnchors is not documented!-->
614
615 <!--method Revert is not documented!-->
616
617 <!--property CurrentDNSServer is not documented!-->
618
619 <!--property DefaultRoute is not documented!-->
620
621 <!--property LLMNR is not documented!-->
622
623 <!--property MulticastDNS is not documented!-->
624
625 <!--property DNSOverTLS is not documented!-->
626
627 <!--property DNSSEC is not documented!-->
628
629 <!--property DNSSECNegativeTrustAnchors is not documented!-->
630
631 <!--Autogenerated cross-references for systemd.directives, do not edit-->
632
633 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.resolve1.Link"/>
634
635 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.resolve1.Link"/>
636
637 <variablelist class="dbus-method" generated="True" extra-ref="SetDNS()"/>
638
639 <variablelist class="dbus-method" generated="True" extra-ref="SetDomains()"/>
640
641 <variablelist class="dbus-method" generated="True" extra-ref="SetDefaultRoute()"/>
642
643 <variablelist class="dbus-method" generated="True" extra-ref="SetLLMNR()"/>
644
645 <variablelist class="dbus-method" generated="True" extra-ref="SetMulticastDNS()"/>
646
647 <variablelist class="dbus-method" generated="True" extra-ref="SetDNSOverTLS()"/>
648
649 <variablelist class="dbus-method" generated="True" extra-ref="SetDNSSEC()"/>
650
651 <variablelist class="dbus-method" generated="True" extra-ref="SetDNSSECNegativeTrustAnchors()"/>
652
653 <variablelist class="dbus-method" generated="True" extra-ref="Revert()"/>
654
655 <variablelist class="dbus-property" generated="True" extra-ref="ScopesMask"/>
656
657 <variablelist class="dbus-property" generated="True" extra-ref="DNS"/>
658
659 <variablelist class="dbus-property" generated="True" extra-ref="CurrentDNSServer"/>
660
661 <variablelist class="dbus-property" generated="True" extra-ref="Domains"/>
662
663 <variablelist class="dbus-property" generated="True" extra-ref="DefaultRoute"/>
664
665 <variablelist class="dbus-property" generated="True" extra-ref="LLMNR"/>
666
667 <variablelist class="dbus-property" generated="True" extra-ref="MulticastDNS"/>
668
669 <variablelist class="dbus-property" generated="True" extra-ref="DNSOverTLS"/>
670
671 <variablelist class="dbus-property" generated="True" extra-ref="DNSSEC"/>
672
673 <variablelist class="dbus-property" generated="True" extra-ref="DNSSECNegativeTrustAnchors"/>
674
675 <variablelist class="dbus-property" generated="True" extra-ref="DNSSECSupported"/>
676
677 <!--End of Autogenerated section-->
678
679 <para>For each Linux network interface a "Link" object is created which exposes per-link DNS
680 configuration and state. Use <function>GetLink()</function> on the Manager interface to retrieve the
681 object path for a link object given the network interface index (see above).</para>
682
683 <refsect2>
684 <title>Methods</title>
685
686 <para>The various methods exposed by the Link interface are equivalent to their similarly named
687 counterparts on the Manager interface. e.g. <function>SetDNS()</function> on the Link object maps to
688 <function>SetLinkDNS()</function> on the Manager object, the main difference being that the later
689 expects an interface index to be specified. Invoking the methods on the Manager interface has the
690 benefit of reducing roundtrips, as it is not necessary to first request the Link object path via
691 <function>GetLink()</function> before invoking the methods. For further details on these methods see
692 the <interfacename>Manager</interfacename> documentation above.</para>
693 </refsect2>
694
695 <refsect2>
696 <title>Properties</title>
697
698 <para><varname>ScopesMask</varname> defines which resolver scopes are currently active on this
699 interface. This 64-bit unsigned integer field is a bit mask consisting of a subset of the bits of the
700 flags parameter describe above. Specifically, it may have the DNS, LLMNR and MDNS bits (the latter in
701 IPv4 and IPv6 flavours) set. Each individual bit is set when the protocol applies to a specific
702 interface and is enabled for it. It is unset otherwise. Specifically, a multicast-capable interface in
703 the "UP" state with an IP address is suitable for LLMNR or MulticastDNS, and any interface that is UP and
704 has an IP address is suitable for DNS. Note the relationship of the bits exposed here with the LLMNR
705 and MulticastDNS properties also exposed on the Link interface. The latter expose what is *configured*
706 to be used on the interface, the former expose what is actually used on the interface, taking into
707 account the abilities of the interface.</para>
708
709 <para><varname>DNSSECSupported</varname> exposes a boolean field that indicates whether DNSSEC is
710 currently configured and in use on the interface. Note that if DNSSEC is enabled on an interface, it is
711 assumed available until it is detected that the configured server does not actually support it. Thus,
712 this property may initially report that DNSSEC is supported on an interface.</para>
713
714 <para>The other properties reflect the state of the various configuration settings for the link which
715 may be set with the various methods calls such as SetDNS() or SetLLMNR().</para>
716 </refsect2>
717 </refsect1>
718
719 <refsect1>
720 <title>Common Errors</title>
721
722 <para>Many bus methods <filename>systemd-resolved</filename> exposes (in particular the resolver methods such
723 as <function>ResolveHostname()</function> on the <interfacename>Manager</interfacename> interface) may return
724 some of the following errors:</para>
725
726 <variablelist>
727 <varlistentry><term><constant>org.freedesktop.resolve1.NoNameServers</constant></term>
728 <listitem><para>No suitable DNS servers were found to resolve a request.</para></listitem>
729 </varlistentry>
730
731 <varlistentry><term><constant>org.freedesktop.resolve1.InvalidReply</constant></term>
732 <listitem><para>A response from the selected DNS server was not understood.</para></listitem>
733 </varlistentry>
734
735 <varlistentry><term><constant>org.freedesktop.resolve1.NoSuchRR</constant></term>
736 <listitem><para>The requested name exists, but there is no resource record of the requested type for
737 it. (This is the DNS NODATA case).</para></listitem></varlistentry>
738
739 <varlistentry><term><constant>org.freedesktop.resolve1.CNameLoop</constant></term>
740 <listitem><para>The look-up failed because a CNAME or DNAME loop was detected.</para></listitem>
741 </varlistentry>
742
743 <varlistentry><term><constant>org.freedesktop.resolve1.Aborted</constant></term>
744 <listitem><para>The look-up was aborted because the selected protocol became unavailable while the
745 operation was ongoing.</para></listitem>
746 </varlistentry>
747
748 <varlistentry><term><constant>org.freedesktop.resolve1.NoSuchService</constant></term>
749 <listitem><para>A service look-up was successful, but the SRV record reported that the service is not
750 available.</para></listitem></varlistentry>
751
752 <varlistentry><term><constant>org.freedesktop.resolve1.DnssecFailed</constant></term>
753 <listitem><para>The acquired response did not pass DNSSEC validation.</para></listitem>
754 </varlistentry>
755
756 <varlistentry><term><constant>org.freedesktop.resolve1.NoTrustAnchor</constant></term>
757 <listitem><para>No chain of trust could be established for the response to a configured DNSSEC trust
758 anchor.</para></listitem>
759 </varlistentry>
760
761 <varlistentry><term><constant>org.freedesktop.resolve1.ResourceRecordTypeUnsupported</constant></term>
762 <listitem><para>The requested resource record type is not supported on the selected DNS servers. This
763 error is generated for example when an RRSIG record is requested from a DNS server that does not
764 support DNSSEC.</para></listitem>
765
766 </varlistentry>
767
768 <varlistentry><term><constant>org.freedesktop.resolve1.NoSuchLink</constant></term>
769 <listitem><para>No network interface with the specified network interface index exists.
770 </para></listitem></varlistentry>
771
772 <varlistentry><term><constant>org.freedesktop.resolve1.LinkBusy</constant></term>
773 <listitem><para>The requested configuration change could not be made because
774 <citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
775 already took possession of the interface and supplied configuration data for it.</para></listitem>
776 </varlistentry>
777
778 <varlistentry><term><constant>org.freedesktop.resolve1.NetworkDown</constant></term>
779 <listitem><para>The requested look-up failed because the system is currently not connected to any
780 suitable network.</para></listitem></varlistentry>
781
782 <varlistentry><term><constant>org.freedesktop.resolve1.DnsError.NXDOMAIN</constant></term>
783 <term><constant>org.freedesktop.resolve1.DnsError.REFUSED</constant></term>
784 <term>...</term>
785 <listitem><para>The look-up failed with a DNS return code reporting a failure. The error names used as
786 suffixes here are defined in by IANA in
787 <ulink url="https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6">DNS RCODEs</ulink>.
788 </para></listitem>
789 </varlistentry>
790 </variablelist>
791 </refsect1>
792
793 <refsect1>
794 <title>Versioning</title>
795
796 <para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
797 the usual interface versioning guidelines</ulink>.</para>
798 </refsect1>
799 </refentry>