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" host name or all data from
29       /etc/hosts.
30

OPTIONS

32       -4, -6
33           By default, when resolving a hostname, both IPv4 and IPv6 addresses
34           are acquired. By specifying -4 only IPv4 addresses are requested,
35           by specifying -6 only IPv6 addresses are requested.
36
37       -i INTERFACE, --interface=INTERFACE
38           Specifies the network interface to execute the query on. This may
39           either be specified as numeric interface index or as network
40           interface string (e.g.  "en0"). Note that this option has no effect
41           if system-wide DNS configuration (as configured in /etc/resolv.conf
42           or /etc/systemd/resolve.conf) in place of per-link configuration is
43           used.
44
45       -p PROTOCOL, --protocol=PROTOCOL
46           Specifies the network protocol for the query. May be one of "dns"
47           (i.e. classic unicast DNS), "llmnr" (Link-Local Multicast Name
48           Resolution[1]), "llmnr-ipv4", "llmnr-ipv6" (LLMNR via the indicated
49           underlying IP protocols), "mdns" (Multicast DNS[2]), "mdns-ipv4",
50           "mdns-ipv6" (MDNS via the indicated underlying IP protocols). By
51           default the lookup is done via all protocols suitable for the
52           lookup. If used, limits the set of protocols that may be used. Use
53           this option multiple times to enable resolving via multiple
54           protocols at the same time. The setting "llmnr" is identical to
55           specifying this switch once with "llmnr-ipv4" and once via
56           "llmnr-ipv6". Note that this option does not force the service to
57           resolve the operation with the specified protocol, as that might
58           require a suitable network interface and configuration. The special
59           value "help" may be used to list known values.
60
61       -t TYPE, --type=TYPE, -c CLASS, --class=CLASS
62           Specifies the DNS resource record type (e.g. A, AAAA, MX, ...) and
63           class (e.g. IN, ANY, ...) to look up. If these options are used a
64           DNS resource record set matching the specified class and type is
65           requested. The class defaults to IN if only a type is specified.
66           The special value "help" may be used to list known values.
67
68       --service-address=BOOL
69           Takes a boolean parameter. If true (the default), when doing a
70           service lookup with --service the hostnames contained in the SRV
71           resource records are resolved as well.
72
73       --service-txt=BOOL
74           Takes a boolean parameter. If true (the default), when doing a
75           DNS-SD service lookup with --service the TXT service metadata
76           record is resolved as well.
77
78       --cname=BOOL
79           Takes a boolean parameter. If true (the default), DNS CNAME or
80           DNAME redirections are followed. Otherwise, if a CNAME or DNAME
81           record is encountered while resolving, an error is returned.
82
83       --search=BOOL
84           Takes a boolean parameter. If true (the default), any specified
85           single-label hostnames will be searched in the domains configured
86           in the search domain list, if it is non-empty. Otherwise, the
87           search domain logic is disabled.
88
89       --raw[=payload|packet]
90           Dump the answer as binary data. If there is no argument or if the
91           argument is "payload", the payload of the packet is exported. If
92           the argument is "packet", the whole packet is dumped in wire
93           format, prefixed by length specified as a little-endian 64-bit
94           number. This format allows multiple packets to be dumped and
95           unambiguously parsed.
96
97       --legend=BOOL
98           Takes a boolean parameter. If true (the default), column headers
99           and meta information about the query response are shown. Otherwise,
100           this output is suppressed.
101
102       -h, --help
103           Print a short help text and exit.
104
105       --version
106           Print a short version string and exit.
107
108       --no-pager
109           Do not pipe output into a pager.
110

COMMANDS

112       query HOSTNAME|ADDRESS...
113           Resolve domain names, IPv4 and IPv6 addresses.
114
115       service [[NAME] TYPE] DOMAIN
116           Resolve DNS-SD[3] and SRV[4] services, depending on the specified
117           list of parameters. If three parameters are passed the first is
118           assumed to be the DNS-SD service name, the second the SRV service
119           type, and the third the domain to search in. In this case a full
120           DNS-SD style SRV and TXT lookup is executed. If only two parameters
121           are specified, the first is assumed to be the SRV service type, and
122           the second the domain to look in. In this case no TXT RR is
123           requested. Finally, if only one parameter is specified, it is
124           assumed to be a domain name, that is already prefixed with an SRV
125           type, and an SRV lookup is done (no TXT).
126
127       openpgp EMAIL@DOMAIN...
128           Query PGP keys stored as OPENPGPKEY[5] resource records. Specified
129           e-mail addresses are converted to the corresponding DNS domain
130           name, and any OPENPGPKEY keys are printed.
131
132       tlsa [FAMILY] DOMAIN[:PORT]...
133           Query TLS public keys stored as TLSA[6] resource records. A query
134           will be performed for each of the specified names prefixed with the
135           port and family ("_port._family.domain"). The port number may be
136           specified after a colon (":"), otherwise 443 will be used by
137           default. The family may be specified as the first argument,
138           otherwise tcp will be used.
139
140       status [LINK...]
141           Shows the global and per-link DNS settings in currently in effect.
142           If no command is specified, this is the implied default.
143
144       statistics
145           Shows general resolver statistics, including information whether
146           DNSSEC is enabled and available, as well as resolution and
147           validation statistics.
148
149       reset-statistics
150           Resets the statistics counters shown in statistics to zero. This
151           operation requires root privileges.
152
153       flush-caches
154           Flushes all DNS resource record caches the service maintains
155           locally. This is mostly equivalent to sending the SIGUSR2 to the
156           systemd-resolved service.
157
158       reset-server-features
159           Flushes all feature level information the resolver learnt about
160           specific servers, and ensures that the server feature probing logic
161           is started from the beginning with the next look-up request. This
162           is mostly equivalent to sending the SIGRTMIN+1 to the
163           systemd-resolved service.
164
165       dns [LINK [SERVER...]], domain [LINK [DOMAIN...]], llmnr [LINK [MODE]],
166       mdns [LINK [MODE]], dnssec [LINK [MODE]], dnsovertls [LINK [MODE]], nta
167       [LINK [DOMAIN...]]
168           Get/set per-interface DNS configuration. These commands may be used
169           to configure various DNS settings for network interfaces that
170           aren't managed by systemd-networkd.service(8). (These commands will
171           fail when used on interfaces that are managed by systemd-networkd,
172           please configure their DNS settings directly inside the .network
173           files instead.) These commands may be used to inform
174           systemd-resolved about per-interface DNS configuration determined
175           through external means. The dns command expects IPv4 or IPv6
176           address specifications of DNS servers to use. The domain command
177           expects valid DNS domains, possibly prefixed with "~", and
178           configures a per-interface search or route-only domain. The llmnr,
179           mdns, dnssec and dnsovertls commands may be used to configure the
180           per-interface LLMNR, MulticastDNS, DNSSEC and DNSOverTLS settings.
181           Finally, nta command may be used to configure additional
182           per-interface DNSSEC NTA domains. For details about these settings,
183           their possible values and their effect, see the corresponding
184           options in systemd.network(5).
185
186       revert LINK
187           Revert the per-interface DNS configuration. If the DNS
188           configuration is reverted all per-interface DNS setting are reset
189           to their defaults, undoing all effects of dns, domain, llmnr, mdns,
190           dnssec, dnsovertls, nta. Note that when a network interface
191           disappears all configuration is lost automatically, an explicit
192           reverting is not necessary in that case.
193

COMPATIBILITY WITH RESOLVCONF(8)

195       resolvectl is a multi-call binary. When invoked as "resolvconf"
196       (generally achieved by means of a symbolic link of this name to the
197       resolvectl binary) it is run in a limited resolvconf(8) compatibility
198       mode. It accepts mostly the same arguments and pushes all data into
199       systemd-resolved.service(8), similar to how dns and domain commands
200       operate. Note that systemd-resolved.service is the only supported
201       backend, which is different from other implementations of this command.
202       Note that not all operations supported by other implementations are
203       supported natively. Specifically:
204
205       -a
206           Registers per-interface DNS configuration data with
207           systemd-resolved. Expects a network interface name as only command
208           line argument. Reads resolv.conf(5) compatible DNS configuration
209           data from its standard input. Relevant fields are "nameserver" and
210           "domain"/"search". This command is mostly identical to invoking
211           resolvectl with a combination of dns and domain commands.
212
213       -d
214           Unregisters per-interface DNS configuration data with
215           systemd-resolved. This command is mostly identical to invoking
216           resolvectl revert.
217
218       -f
219           When specified -a and -d will not complain about missing network
220           interfaces and will silently execute no operation in that case.
221
222       -x
223           This switch for "exclusive" operation is supported only partially.
224           It is mapped to an additional configured search domain of "~."  —
225           i.e. ensures that DNS traffic is preferably routed to the DNS
226           servers on this interface, unless there are other, more specific
227           domains configured on other interfaces.
228
229       -m, -p
230           These switches are not supported and are silently ignored.
231
232       -u, -I, -i, -l, -R, -r, -v, -V, --enable-updates, --disable-updates,
233       --are-updates-enabled
234           These switches are not supported and the command will fail if used.
235
236       See resolvconf(8) for details on this command line options.
237

EXAMPLES

239       Example 1. Retrieve the addresses of the "www.0pointer.net" domain
240
241           $ resolvectl query www.0pointer.net
242           www.0pointer.net: 2a01:238:43ed:c300:10c3:bcf3:3266:da74
243                             85.214.157.71
244
245           -- Information acquired via protocol DNS in 611.6ms.
246           -- Data is authenticated: no
247
248       Example 2. Retrieve the domain of the "85.214.157.71" IP address
249
250           $ resolvectl query 85.214.157.71
251           85.214.157.71: gardel.0pointer.net
252
253           -- Information acquired via protocol DNS in 1.2997s.
254           -- Data is authenticated: no
255
256       Example 3. Retrieve the MX record of the "yahoo.com" domain
257
258           $ resolvectl --legend=no -t MX query yahoo.com
259           yahoo.com. IN MX    1 mta7.am0.yahoodns.net
260           yahoo.com. IN MX    1 mta6.am0.yahoodns.net
261           yahoo.com. IN MX    1 mta5.am0.yahoodns.net
262
263       Example 4. Resolve an SRV service
264
265           $ resolvectl service _xmpp-server._tcp gmail.com
266           _xmpp-server._tcp/gmail.com: alt1.xmpp-server.l.google.com:5269 [priority=20, weight=0]
267                                        173.194.210.125
268                                        alt4.xmpp-server.l.google.com:5269 [priority=20, weight=0]
269                                        173.194.65.125
270                                        ...
271
272       Example 5. Retrieve a PGP key
273
274           $ resolvectl openpgp zbyszek@fedoraproject.org
275           d08ee310438ca124a6149ea5cc21b6313b390dce485576eff96f8722._openpgpkey.fedoraproject.org. IN OPENPGPKEY
276                   mQINBFBHPMsBEACeInGYJCb+7TurKfb6wGyTottCDtiSJB310i37/6ZYoeIay/5soJjlMyf
277                   MFQ9T2XNT/0LM6gTa0MpC1st9LnzYTMsT6tzRly1D1UbVI6xw0g0vE5y2Cjk3xUwAynCsSs
278                   ...
279
280       Example 6. Retrieve a TLS key ("tcp" and ":443" could be skipped)
281
282           $ resolvectl tlsa tcp fedoraproject.org:443
283           _443._tcp.fedoraproject.org IN TLSA 0 0 1 19400be5b7a31fb733917700789d2f0a2471c0c9d506c0e504c06c16d7cb17c0
284                   -- Cert. usage: CA constraint
285                   -- Selector: Full Certificate
286                   -- Matching type: SHA-256
287

SEE ALSO

289       systemd(1), systemd-resolved.service(8), systemd.dnssd(5), systemd-
290       networkd.service(8), resolvconf(8)
291

NOTES

293        1. Link-Local Multicast Name Resolution
294           https://tools.ietf.org/html/rfc4795
295
296        2. Multicast DNS
297           https://www.ietf.org/rfc/rfc6762.txt
298
299        3. DNS-SD
300           https://tools.ietf.org/html/rfc6763
301
302        4. SRV
303           https://tools.ietf.org/html/rfc2782
304
305        5. OPENPGPKEY
306           https://tools.ietf.org/html/rfc7929
307
308        6. TLSA
309           https://tools.ietf.org/html/rfc6698
310
311
312
313systemd 239                                                      RESOLVECTL(1)
Impressum