]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/resolved.conf.xml
Merge pull request #16344 from keszybz/update-utmp-erofs
[thirdparty/systemd.git] / man / resolved.conf.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
5
6 <refentry id="resolved.conf" conditional='ENABLE_RESOLVE'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8 <refentryinfo>
9 <title>resolved.conf</title>
10 <productname>systemd</productname>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>resolved.conf</refentrytitle>
15 <manvolnum>5</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>resolved.conf</refname>
20 <refname>resolved.conf.d</refname>
21 <refpurpose>Network Name Resolution configuration files</refpurpose>
22 </refnamediv>
23
24 <refsynopsisdiv>
25 <para><filename>/etc/systemd/resolved.conf</filename></para>
26 <para><filename>/etc/systemd/resolved.conf.d/*.conf</filename></para>
27 <para><filename>/run/systemd/resolved.conf.d/*.conf</filename></para>
28 <para><filename>/usr/lib/systemd/resolved.conf.d/*.conf</filename></para>
29 </refsynopsisdiv>
30
31 <refsect1>
32 <title>Description</title>
33
34 <para>These configuration files control local DNS and LLMNR
35 name resolution.</para>
36
37 </refsect1>
38
39 <xi:include href="standard-conf.xml" xpointer="main-conf" />
40
41 <refsect1>
42 <title>Options</title>
43
44 <para>The following options are available in the [Resolve] section:</para>
45
46 <variablelist class='network-directives'>
47
48 <varlistentry>
49 <term><varname>DNS=</varname></term>
50 <listitem><para>A space-separated list of IPv4 and IPv6 addresses to use as system DNS servers. DNS requests
51 are sent to one of the listed DNS servers in parallel to suitable per-link DNS servers acquired from
52 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> or
53 set at runtime by external applications. For compatibility reasons, if this setting is not specified, the DNS
54 servers listed in <filename>/etc/resolv.conf</filename> are used instead, if that file exists and any servers
55 are configured in it. This setting defaults to the empty list.</para></listitem>
56 </varlistentry>
57
58 <varlistentry>
59 <term><varname>FallbackDNS=</varname></term>
60 <listitem><para>A space-separated list of IPv4 and IPv6 addresses to use as the fallback DNS servers. Any
61 per-link DNS servers obtained from
62 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
63 take precedence over this setting, as do any servers set via <varname>DNS=</varname> above or
64 <filename>/etc/resolv.conf</filename>. This setting is hence only used if no other DNS server information is
65 known. If this option is not given, a compiled-in list of DNS servers is used instead.</para></listitem>
66 </varlistentry>
67
68 <varlistentry>
69 <term><varname>Domains=</varname></term>
70 <listitem><para>A space-separated list of domains optionally prefixed with <literal>~</literal>,
71 used for two distinct purposes described below. Defaults to the empty list.</para>
72
73 <para>Any domains <emphasis>not</emphasis> prefixed with <literal>~</literal> are used as search
74 suffixes when resolving single-label hostnames (domain names which contain no dot), in order to
75 qualify them into fully-qualified domain names (FQDNs). These "search domains" are strictly processed
76 in the order they are specified in, until the name with the suffix appended is found. For
77 compatibility reasons, if this setting is not specified, the search domains listed in
78 <filename>/etc/resolv.conf</filename> with the <varname>search</varname> keyword are used instead, if
79 that file exists and any domains are configured in it.</para>
80
81 <para>The domains prefixed with <literal>~</literal> are called "routing domains". All domains listed
82 here (both search domains and routing domains after removing the <literal>~</literal> prefix) define
83 a search path that preferably directs DNS queries to this interface. This search path has an effect
84 only when suitable per-link DNS servers are known. Such servers may be defined through the
85 <varname>DNS=</varname> setting (see above) and dynamically at run time, for example from DHCP
86 leases. If no per-link DNS servers are known, routing domains have no effect.</para>
87
88 <para>Use the construct <literal>~.</literal> (which is composed from <literal>~</literal> to
89 indicate a routing domain and <literal>.</literal> to indicate the DNS root domain that is the
90 implied suffix of all DNS domains) to use the DNS servers defined for this link preferably for all
91 domains.</para></listitem>
92 </varlistentry>
93
94 <varlistentry>
95 <term><varname>LLMNR=</varname></term>
96 <listitem><para>Takes a boolean argument or
97 <literal>resolve</literal>. Controls Link-Local Multicast Name
98 Resolution support (<ulink
99 url="https://tools.ietf.org/html/rfc4795">RFC 4795</ulink>) on
100 the local host. If true, enables full LLMNR responder and
101 resolver support. If false, disables both. If set to
102 <literal>resolve</literal>, only resolution support is enabled,
103 but responding is disabled. Note that
104 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
105 also maintains per-link LLMNR settings. LLMNR will be
106 enabled on a link only if the per-link and the
107 global setting is on.</para></listitem>
108 </varlistentry>
109
110 <varlistentry>
111 <term><varname>MulticastDNS=</varname></term>
112 <listitem><para>Takes a boolean argument or
113 <literal>resolve</literal>. Controls Multicast DNS support (<ulink
114 url="https://tools.ietf.org/html/rfc6762">RFC 6762</ulink>) on
115 the local host. If true, enables full Multicast DNS responder and
116 resolver support. If false, disables both. If set to
117 <literal>resolve</literal>, only resolution support is enabled,
118 but responding is disabled. Note that
119 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
120 also maintains per-link Multicast DNS settings. Multicast DNS will be
121 enabled on a link only if the per-link and the
122 global setting is on.</para></listitem>
123 </varlistentry>
124
125 <varlistentry>
126 <term><varname>DNSSEC=</varname></term>
127 <listitem><para>Takes a boolean argument or
128 <literal>allow-downgrade</literal>. If true all DNS lookups are
129 DNSSEC-validated locally (excluding LLMNR and Multicast
130 DNS). If the response to a lookup request is detected to be invalid
131 a lookup failure is returned to applications. Note that
132 this mode requires a DNS server that supports DNSSEC. If the
133 DNS server does not properly support DNSSEC all validations
134 will fail. If set to <literal>allow-downgrade</literal> DNSSEC
135 validation is attempted, but if the server does not support
136 DNSSEC properly, DNSSEC mode is automatically disabled. Note
137 that this mode makes DNSSEC validation vulnerable to
138 "downgrade" attacks, where an attacker might be able to
139 trigger a downgrade to non-DNSSEC mode by synthesizing a DNS
140 response that suggests DNSSEC was not supported. If set to
141 false, DNS lookups are not DNSSEC validated.</para>
142
143 <para>Note that DNSSEC validation requires retrieval of
144 additional DNS data, and thus results in a small DNS look-up
145 time penalty.</para>
146
147 <para>DNSSEC requires knowledge of "trust anchors" to prove
148 data integrity. The trust anchor for the Internet root domain
149 is built into the resolver, additional trust anchors may be
150 defined with
151 <citerefentry><refentrytitle>dnssec-trust-anchors.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
152 Trust anchors may change at regular intervals, and old trust
153 anchors may be revoked. In such a case DNSSEC validation is
154 not possible until new trust anchors are configured locally or
155 the resolver software package is updated with the new root
156 trust anchor. In effect, when the built-in trust anchor is
157 revoked and <varname>DNSSEC=</varname> is true, all further
158 lookups will fail, as it cannot be proved anymore whether
159 lookups are correctly signed, or validly unsigned. If
160 <varname>DNSSEC=</varname> is set to
161 <literal>allow-downgrade</literal> the resolver will
162 automatically turn off DNSSEC validation in such a case.</para>
163
164 <para>Client programs looking up DNS data will be informed
165 whether lookups could be verified using DNSSEC, or whether the
166 returned data could not be verified (either because the data
167 was found unsigned in the DNS, or the DNS server did not
168 support DNSSEC or no appropriate trust anchors were known). In
169 the latter case it is assumed that client programs employ a
170 secondary scheme to validate the returned DNS data, should
171 this be required.</para>
172
173 <para>It is recommended to set <varname>DNSSEC=</varname> to
174 true on systems where it is known that the DNS server supports
175 DNSSEC correctly, and where software or trust anchor updates
176 happen regularly. On other systems it is recommended to set
177 <varname>DNSSEC=</varname> to
178 <literal>allow-downgrade</literal>.</para>
179
180 <para>In addition to this global DNSSEC setting
181 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
182 also maintains per-link DNSSEC settings. For system DNS
183 servers (see above), only the global DNSSEC setting is in
184 effect. For per-link DNS servers the per-link
185 setting is in effect, unless it is unset in which case the
186 global setting is used instead.</para>
187
188 <para>Site-private DNS zones generally conflict with DNSSEC
189 operation, unless a negative (if the private zone is not
190 signed) or positive (if the private zone is signed) trust
191 anchor is configured for them. If
192 <literal>allow-downgrade</literal> mode is selected, it is
193 attempted to detect site-private DNS zones using top-level
194 domains (TLDs) that are not known by the DNS root server. This
195 logic does not work in all private zone setups.</para>
196
197 <para>Defaults to <literal>allow-downgrade</literal></para>
198 </listitem>
199 </varlistentry>
200
201 <varlistentry>
202 <term><varname>DNSOverTLS=</varname></term>
203 <listitem>
204 <para>Takes a boolean argument or <literal>opportunistic</literal>. If
205 true all connections to the server will be encrypted. Note that this
206 mode requires a DNS server that supports DNS-over-TLS and has a valid
207 certificate. If the hostname was specified in <varname>DNS=</varname>
208 by using the format format <literal>address#server_name</literal> it
209 is used to validate its certificate and also to enable Server Name
210 Indication (SNI) when opening a TLS connection. Otherwise
211 the certificate is checked against the server's IP.
212 If the DNS server does not support DNS-over-TLS all DNS requests will fail.</para>
213
214 <para>When set to <literal>opportunistic</literal>
215 DNS request are attempted to send encrypted with DNS-over-TLS.
216 If the DNS server does not support TLS, DNS-over-TLS is disabled.
217 Note that this mode makes DNS-over-TLS vulnerable to "downgrade"
218 attacks, where an attacker might be able to trigger a downgrade
219 to non-encrypted mode by synthesizing a response that suggests
220 DNS-over-TLS was not supported. If set to false, DNS lookups
221 are send over UDP.</para>
222
223 <para>Note that DNS-over-TLS requires additional data to be
224 send for setting up an encrypted connection, and thus results
225 in a small DNS look-up time penalty.</para>
226
227 <para>Note that in <literal>opportunistic</literal> mode the
228 resolver is not capable of authenticating the server, so it is
229 vulnerable to "man-in-the-middle" attacks.</para>
230
231 <para>In addition to this global DNSOverTLS setting
232 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
233 also maintains per-link DNSOverTLS settings. For system DNS
234 servers (see above), only the global DNSOverTLS setting is in
235 effect. For per-link DNS servers the per-link
236 setting is in effect, unless it is unset in which case the
237 global setting is used instead.</para>
238
239 <para>Defaults to off.</para>
240 </listitem>
241 </varlistentry>
242
243 <varlistentry>
244 <term><varname>Cache=</varname></term>
245 <listitem><para>Takes a boolean or <literal>no-negative</literal> as argument. If
246 <literal>yes</literal> (the default), resolving a domain name which already got queried earlier will
247 return the previous result as long as it is still valid, and thus does not result in a new network
248 request. Be aware that turning off caching comes at a performance penalty, which is particularly high
249 when DNSSEC is used. If <literal>no-negative</literal>, only positive answers are cached.</para>
250
251 <para>Note that caching is turned off implicitly if the configured DNS server is on a host-local IP address
252 (such as 127.0.0.1 or ::1), in order to avoid duplicate local caching.</para></listitem>
253 </varlistentry>
254
255 <varlistentry>
256 <term><varname>DNSStubListener=</varname></term>
257 <listitem><para>Takes a boolean argument or one of <literal>udp</literal> and <literal>tcp</literal>. If
258 <literal>udp</literal>, a DNS stub resolver will listen for UDP requests on address 127.0.0.53
259 port 53. If <literal>tcp</literal>, the stub will listen for TCP requests on the same address and port. If
260 <literal>yes</literal> (the default), the stub listens for both UDP and TCP requests. If <literal>no</literal>, the stub
261 listener is disabled.</para>
262
263 <para>Note that the DNS stub listener is turned off implicitly when its listening address and port are already
264 in use.</para></listitem>
265 </varlistentry>
266
267 <varlistentry>
268 <term><varname>ReadEtcHosts=</varname></term>
269 <listitem><para>Takes a boolean argument. If <literal>yes</literal> (the default),
270 <command>systemd-resolved</command> will read <filename>/etc/hosts</filename>, and try to resolve
271 hosts or address by using the entries in the file before sending query to DNS servers.
272 </para></listitem>
273 </varlistentry>
274
275 <varlistentry>
276 <term><varname>ResolveUnicastSingleLabel=</varname></term>
277 <listitem><para>Takes a boolean argument. When false (the default),
278 <command>systemd-resolved</command> will not resolve A and AAAA queries for single-label names over
279 classic DNS. Note that such names may still be resolved if search domains are specified (see
280 <varname>Domains=</varname> above), or using other mechanisms, in particular via LLMNR or from
281 <filename>/etc/hosts</filename>. When true, queries for single-label names will be forwarded to
282 global DNS servers even if no search domains are defined.
283 </para>
284
285 <para>This option is provided for compatibility with configurations where <emphasis>public DNS
286 servers are not used</emphasis>. Forwarding single-label names to servers not under your control is
287 not standard-conformant, see <ulink
288 url="https://www.iab.org/documents/correspondence-reports-documents/2013-2/iab-statement-dotless-domains-considered-harmful/">IAB
289 Statement</ulink>, and may create a privacy and security risk.</para></listitem>
290 </varlistentry>
291 </variablelist>
292 </refsect1>
293
294 <refsect1>
295 <title>See Also</title>
296 <para>
297 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
298 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
299 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
300 <citerefentry><refentrytitle>dnssec-trust-anchors.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
301 <citerefentry project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry>
302 </para>
303 </refsect1>
304
305 </refentry>