1RESOLVECTL(1)                     resolvectl                     RESOLVECTL(1)
2
3
4

NAME

6       resolvectl, resolvconf - Resolve domain names, IPV4 and IPv6 addresses,
7       DNS resource records, and services; introspect and reconfigure the DNS
8       resolver
9

SYNOPSIS

11       resolvectl [OPTIONS...] {COMMAND} [NAME...]
12

DESCRIPTION

14       resolvectl may be used to resolve domain names, IPv4 and IPv6
15       addresses, DNS resource records and services with the systemd-
16       resolved.service(8) resolver service. By default, the specified list of
17       parameters will be resolved as hostnames, retrieving their IPv4 and
18       IPv6 addresses. If the parameters specified are formatted as IPv4 or
19       IPv6 operation the reverse operation is done, and a hostname is
20       retrieved for the specified addresses.
21
22       The program's output contains information about the protocol used for
23       the look-up and on which network interface the data was discovered. It
24       also contains information on whether the information could be
25       authenticated. All data for which local DNSSEC validation succeeds is
26       considered authenticated. Moreover all data originating from local,
27       trusted sources is also reported authenticated, including resolution of
28       the local host name, the "localhost" hostname or all data from
29       /etc/hosts.
30

COMMANDS

32       query HOSTNAME|ADDRESS...
33           Resolve domain names, as well as IPv4 and IPv6 addresses. When used
34           in conjunction with --type= or --class= (see below), resolves
35           low-level DNS resource records.
36
37           If a single-label domain name is specified it is searched for
38           according to the configured search domains — unless --search=no or
39           --type=/--class= are specified, both of which turn this logic off.
40
41           If an international domain name is specified, it is automatically
42           translated according to IDNA rules when resolved via classic DNS —
43           but not for look-ups via MulticastDNS or LLMNR. If --type=/--class=
44           is used IDNA translation is turned off and domain names are
45           processed as specified.
46
47       service [[NAME] TYPE] DOMAIN
48           Resolve DNS-SD[1] and SRV[2] services, depending on the specified
49           list of parameters. If three parameters are passed the first is
50           assumed to be the DNS-SD service name, the second the SRV service
51           type, and the third the domain to search in. In this case a full
52           DNS-SD style SRV and TXT lookup is executed. If only two parameters
53           are specified, the first is assumed to be the SRV service type, and
54           the second the domain to look in. In this case no TXT RR is
55           requested. Finally, if only one parameter is specified, it is
56           assumed to be a domain name, that is already prefixed with an SRV
57           type, and an SRV lookup is done (no TXT).
58
59       openpgp EMAIL@DOMAIN...
60           Query PGP keys stored as OPENPGPKEY[3] resource records. Specified
61           e-mail addresses are converted to the corresponding DNS domain
62           name, and any OPENPGPKEY keys are printed.
63
64       tlsa [FAMILY] DOMAIN[:PORT]...
65           Query TLS public keys stored as TLSA[4] resource records. A query
66           will be performed for each of the specified names prefixed with the
67           port and family ("_port._family.domain"). The port number may be
68           specified after a colon (":"), otherwise 443 will be used by
69           default. The family may be specified as the first argument,
70           otherwise tcp will be used.
71
72       status [LINK...]
73           Shows the global and per-link DNS settings currently in effect. If
74           no command is specified, this is the implied default.
75
76       statistics
77           Shows general resolver statistics, including information whether
78           DNSSEC is enabled and available, as well as resolution and
79           validation statistics.
80
81       reset-statistics
82           Resets the statistics counters shown in statistics to zero. This
83           operation requires root privileges.
84
85       flush-caches
86           Flushes all DNS resource record caches the service maintains
87           locally. This is mostly equivalent to sending the SIGUSR2 to the
88           systemd-resolved service.
89
90       reset-server-features
91           Flushes all feature level information the resolver learnt about
92           specific servers, and ensures that the server feature probing logic
93           is started from the beginning with the next look-up request. This
94           is mostly equivalent to sending the SIGRTMIN+1 to the
95           systemd-resolved service.
96
97       dns [LINK [SERVER...]], domain [LINK [DOMAIN...]], default-route [LINK
98       [BOOL...]], llmnr [LINK [MODE]], mdns [LINK [MODE]], dnssec [LINK
99       [MODE]], dnsovertls [LINK [MODE]], nta [LINK [DOMAIN...]]
100           Get/set per-interface DNS configuration. These commands may be used
101           to configure various DNS settings for network interfaces. These
102           commands may be used to inform systemd-resolved or systemd-networkd
103           about per-interface DNS configuration determined through external
104           means. The dns command expects IPv4 or IPv6 address specifications
105           of DNS servers to use. Each address can optionally take a port
106           number separated with ":", a network interface name or index
107           separated with "%", and a Server Name Indication (SNI) separated
108           with "#". When IPv6 address is specified with a port number, then
109           the address must be in the square brackets. That is, the acceptable
110           full formats are "111.222.333.444:9953%ifname#example.com" for IPv4
111           and "[1111:2222::3333]:9953%ifname#example.com" for IPv6. The
112           domain command expects valid DNS domains, possibly prefixed with
113           "~", and configures a per-interface search or route-only domain.
114           The default-route command expects a boolean parameter, and
115           configures whether the link may be used as default route for DNS
116           lookups, i.e. if it is suitable for lookups on domains no other
117           link explicitly is configured for. The llmnr, mdns, dnssec and
118           dnsovertls commands may be used to configure the per-interface
119           LLMNR, MulticastDNS, DNSSEC and DNSOverTLS settings. Finally, nta
120           command may be used to configure additional per-interface DNSSEC
121           NTA domains.
122
123           Commands dns, domain and nta can take a single empty string
124           argument to clear their respective value lists.
125
126           For details about these settings, their possible values and their
127           effect, see the corresponding settings in systemd.network(5).
128
129       revert LINK
130           Revert the per-interface DNS configuration. If the DNS
131           configuration is reverted all per-interface DNS setting are reset
132           to their defaults, undoing all effects of dns, domain,
133           default-route, llmnr, mdns, dnssec, dnsovertls, nta. Note that when
134           a network interface disappears all configuration is lost
135           automatically, an explicit reverting is not necessary in that case.
136
137       log-level [LEVEL]
138           If no argument is given, print the current log level of the
139           manager. If an optional argument LEVEL is provided, then the
140           command changes the current log level of the manager to LEVEL
141           (accepts the same values as --log-level= described in systemd(1)).
142

OPTIONS

144       -4, -6
145           By default, when resolving a hostname, both IPv4 and IPv6 addresses
146           are acquired. By specifying -4 only IPv4 addresses are requested,
147           by specifying -6 only IPv6 addresses are requested.
148
149       -i INTERFACE, --interface=INTERFACE
150           Specifies the network interface to execute the query on. This may
151           either be specified as numeric interface index or as network
152           interface string (e.g.  "en0"). Note that this option has no effect
153           if system-wide DNS configuration (as configured in /etc/resolv.conf
154           or /etc/systemd/resolved.conf) in place of per-link configuration
155           is used.
156
157       -p PROTOCOL, --protocol=PROTOCOL
158           Specifies the network protocol for the query. May be one of "dns"
159           (i.e. classic unicast DNS), "llmnr" (Link-Local Multicast Name
160           Resolution[5]), "llmnr-ipv4", "llmnr-ipv6" (LLMNR via the indicated
161           underlying IP protocols), "mdns" (Multicast DNS[6]), "mdns-ipv4",
162           "mdns-ipv6" (MDNS via the indicated underlying IP protocols). By
163           default the lookup is done via all protocols suitable for the
164           lookup. If used, limits the set of protocols that may be used. Use
165           this option multiple times to enable resolving via multiple
166           protocols at the same time. The setting "llmnr" is identical to
167           specifying this switch once with "llmnr-ipv4" and once via
168           "llmnr-ipv6". Note that this option does not force the service to
169           resolve the operation with the specified protocol, as that might
170           require a suitable network interface and configuration. The special
171           value "help" may be used to list known values.
172
173       -t TYPE, --type=TYPE, -c CLASS, --class=CLASS
174           When used in conjunction with the query command, specifies the DNS
175           resource record type (e.g. A, AAAA, MX, ...) and class (e.g. IN,
176           ANY, ...) to look up. If these options are used a DNS resource
177           record set matching the specified class and type is requested. The
178           class defaults to IN if only a type is specified. The special value
179           "help" may be used to list known values.
180
181           Without these options resolvectl query provides high-level domain
182           name to address and address to domain name resolution. With these
183           options it provides low-level DNS resource record resolution. The
184           search domain logic is automatically turned off when these options
185           are used, i.e. specified domain names need to be fully qualified
186           domain names. Moreover, IDNA internal domain name translation is
187           turned off as well, i.e. international domain names should be
188           specified in "xn--..."  notation, unless look-up in
189           MulticastDNS/LLMNR is desired, in which case UTF-8 characters
190           should be used.
191
192       --service-address=BOOL
193           Takes a boolean parameter. If true (the default), when doing a
194           service lookup with --service the hostnames contained in the SRV
195           resource records are resolved as well.
196
197       --service-txt=BOOL
198           Takes a boolean parameter. If true (the default), when doing a
199           DNS-SD service lookup with --service the TXT service metadata
200           record is resolved as well.
201
202       --cname=BOOL
203           Takes a boolean parameter. If true (the default), DNS CNAME or
204           DNAME redirections are followed. Otherwise, if a CNAME or DNAME
205           record is encountered while resolving, an error is returned.
206
207       --validate=BOOL
208           Takes a boolean parameter; used in conjunction with query. If true
209           (the default), DNSSEC validation is applied as usual — under the
210           condition that it is enabled for the network and for
211           systemd-resolved.service as a whole. If false, DNSSEC validation is
212           disabled for the specific query, regardless of whether it is
213           enabled for the network or in the service. Note that setting this
214           option to true does not force DNSSEC validation on systems/networks
215           where DNSSEC is turned off. This option is only suitable to turn
216           off such validation where otherwise enabled, not enable validation
217           where otherwise disabled.
218
219       --synthesize=BOOL
220           Takes a boolean parameter; used in conjunction with query. If true
221           (the default), select domains are resolved on the local system,
222           among them "localhost" and "_gateway" or entries from /etc/hosts.
223           If false these domains are not resolved locally, and either fail
224           (in case of "localhost" or "_gateway" and suchlike) or go to the
225           network via regular DNS/mDNS/LLMNR lookups (in case of /etc/hosts
226           entries).
227
228       --cache=BOOL
229           Takes a boolean parameter; used in conjunction with query. If true
230           (the default), lookups use the local DNS resource record cache. If
231           false, lookups are routed to the network instead, regardless if
232           already available in the local cache.
233
234       --zone=BOOL
235           Takes a boolean parameter; used in conjunction with query. If true
236           (the default), lookups are answered from locally registered LLMNR
237           or mDNS resource records, if defined. If false, locally registered
238           LLMNR/mDNS records are not considered for the lookup request.
239
240       --trust-anchor=BOOL
241           Takes a boolean parameter; used in conjunction with query. If true
242           (the default), lookups for DS and DNSKEY are answered from the
243           local DNSSEC trust anchors if possible. If false, the local trust
244           store is not considered for the lookup request.
245
246       --network=BOOL
247           Takes a boolean parameter; used in conjunction with query. If true
248           (the default), lookups are answered via DNS, LLMNR or mDNS network
249           requests if they cannot be synthesized locally, or be answered from
250           the local cache, zone or trust anchors (see above). If false, the
251           request is not answered from the network and will thus fail if none
252           of the indicated sources can answer them.
253
254       --search=BOOL
255           Takes a boolean parameter. If true (the default), any specified
256           single-label hostnames will be searched in the domains configured
257           in the search domain list, if it is non-empty. Otherwise, the
258           search domain logic is disabled. Note that this option has no
259           effect if --type= is used (see above), in which case the search
260           domain logic is unconditionally turned off.
261
262       --raw[=payload|packet]
263           Dump the answer as binary data. If there is no argument or if the
264           argument is "payload", the payload of the packet is exported. If
265           the argument is "packet", the whole packet is dumped in wire
266           format, prefixed by length specified as a little-endian 64-bit
267           number. This format allows multiple packets to be dumped and
268           unambiguously parsed.
269
270       --legend=BOOL
271           Takes a boolean parameter. If true (the default), column headers
272           and meta information about the query response are shown. Otherwise,
273           this output is suppressed.
274
275       -h, --help
276           Print a short help text and exit.
277
278       --version
279           Print a short version string and exit.
280
281       --no-pager
282           Do not pipe output into a pager.
283

COMPATIBILITY WITH RESOLVCONF(8)

285       resolvectl is a multi-call binary. When invoked as "resolvconf"
286       (generally achieved by means of a symbolic link of this name to the
287       resolvectl binary) it is run in a limited resolvconf(8) compatibility
288       mode. It accepts mostly the same arguments and pushes all data into
289       systemd-resolved.service(8), similar to how dns and domain commands
290       operate. Note that systemd-resolved.service is the only supported
291       backend, which is different from other implementations of this command.
292
293       /etc/resolv.conf will only be updated with servers added with this
294       command when /etc/resolv.conf is a symlink to
295       /run/systemd/resolve/resolv.conf, and not a static file. See the
296       discussion of /etc/resolv.conf handling in systemd-resolved.service(8).
297
298       Not all operations supported by other implementations are supported
299       natively. Specifically:
300
301       -a
302           Registers per-interface DNS configuration data with
303           systemd-resolved. Expects a network interface name as only command
304           line argument. Reads resolv.conf(5)-compatible DNS configuration
305           data from its standard input. Relevant fields are "nameserver" and
306           "domain"/"search". This command is mostly identical to invoking
307           resolvectl with a combination of dns and domain commands.
308
309       -d
310           Unregisters per-interface DNS configuration data with
311           systemd-resolved. This command is mostly identical to invoking
312           resolvectl revert.
313
314       -f
315           When specified -a and -d will not complain about missing network
316           interfaces and will silently execute no operation in that case.
317
318       -x
319           This switch for "exclusive" operation is supported only partially.
320           It is mapped to an additional configured search domain of "~."  —
321           i.e. ensures that DNS traffic is preferably routed to the DNS
322           servers on this interface, unless there are other, more specific
323           domains configured on other interfaces.
324
325       -m, -p
326           These switches are not supported and are silently ignored.
327
328       -u, -I, -i, -l, -R, -r, -v, -V, --enable-updates, --disable-updates,
329       --are-updates-enabled
330           These switches are not supported and the command will fail if used.
331
332       See resolvconf(8) for details on those command line options.
333

EXAMPLES

335       Example 1. Retrieve the addresses of the "www.0pointer.net" domain
336
337           $ resolvectl query www.0pointer.net
338           www.0pointer.net: 2a01:238:43ed:c300:10c3:bcf3:3266:da74
339                             85.214.157.71
340
341           -- Information acquired via protocol DNS in 611.6ms.
342           -- Data is authenticated: no
343
344       Example 2. Retrieve the domain of the "85.214.157.71" IP address
345
346           $ resolvectl query 85.214.157.71
347           85.214.157.71: gardel.0pointer.net
348
349           -- Information acquired via protocol DNS in 1.2997s.
350           -- Data is authenticated: no
351
352       Example 3. Retrieve the MX record of the "yahoo.com" domain
353
354           $ resolvectl --legend=no -t MX query yahoo.com
355           yahoo.com. IN MX    1 mta7.am0.yahoodns.net
356           yahoo.com. IN MX    1 mta6.am0.yahoodns.net
357           yahoo.com. IN MX    1 mta5.am0.yahoodns.net
358
359       Example 4. Resolve an SRV service
360
361           $ resolvectl service _xmpp-server._tcp gmail.com
362           _xmpp-server._tcp/gmail.com: alt1.xmpp-server.l.google.com:5269 [priority=20, weight=0]
363                                        173.194.210.125
364                                        alt4.xmpp-server.l.google.com:5269 [priority=20, weight=0]
365                                        173.194.65.125
366                                        ...
367
368       Example 5. Retrieve a PGP key
369
370           $ resolvectl openpgp zbyszek@fedoraproject.org
371           d08ee310438ca124a6149ea5cc21b6313b390dce485576eff96f8722._openpgpkey.fedoraproject.org. IN OPENPGPKEY
372                   mQINBFBHPMsBEACeInGYJCb+7TurKfb6wGyTottCDtiSJB310i37/6ZYoeIay/5soJjlMyf
373                   MFQ9T2XNT/0LM6gTa0MpC1st9LnzYTMsT6tzRly1D1UbVI6xw0g0vE5y2Cjk3xUwAynCsSs
374                   ...
375
376       Example 6. Retrieve a TLS key ("tcp" and ":443" could be skipped)
377
378           $ resolvectl tlsa tcp fedoraproject.org:443
379           _443._tcp.fedoraproject.org IN TLSA 0 0 1 19400be5b7a31fb733917700789d2f0a2471c0c9d506c0e504c06c16d7cb17c0
380                   -- Cert. usage: CA constraint
381                   -- Selector: Full Certificate
382                   -- Matching type: SHA-256
383

SEE ALSO

385       systemd(1), systemd-resolved.service(8), systemd.dnssd(5), systemd-
386       networkd.service(8), resolvconf(8)
387

NOTES

389        1. DNS-SD
390           https://tools.ietf.org/html/rfc6763
391
392        2. SRV
393           https://tools.ietf.org/html/rfc2782
394
395        3. OPENPGPKEY
396           https://tools.ietf.org/html/rfc7929
397
398        4. TLSA
399           https://tools.ietf.org/html/rfc6698
400
401        5. Link-Local Multicast Name Resolution
402           https://tools.ietf.org/html/rfc4795
403
404        6. Multicast DNS
405           https://www.ietf.org/rfc/rfc6762.txt
406
407
408
409systemd 248                                                      RESOLVECTL(1)
Impressum