]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-resolve.xml
resolved: make sure to normalize all domain names returned via the bus
[thirdparty/systemd.git] / man / systemd-resolve.xml
CommitLineData
624993ac
LP
1<?xml version='1.0'?>
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
6 This file is part of systemd.
7
8 Copyright 2016 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
24<refentry id="systemd-resolve"
25 xmlns:xi="http://www.w3.org/2001/XInclude">
26
27 <refentryinfo>
28 <title>systemd-resolve</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>systemd-resolve</refentrytitle>
43 <manvolnum>1</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>systemd-resolve</refname>
48 <refpurpose>Resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <cmdsynopsis>
53 <command>systemd-resolve</command>
54 <arg choice="opt" rep="repeat">OPTIONS</arg>
55 <arg choice="plain" rep="repeat"><replaceable>HOSTNAME</replaceable></arg>
56 </cmdsynopsis>
57
58 <cmdsynopsis>
59 <command>systemd-resolve</command>
60 <arg choice="opt" rep="repeat">OPTIONS</arg>
61 <arg choice="plain" rep="repeat"><replaceable>ADDRESS</replaceable></arg>
62 </cmdsynopsis>
63
64 <cmdsynopsis>
65 <command>systemd-resolve</command>
66 <arg choice="opt" rep="repeat">OPTIONS</arg>
27d3b124 67 <command> --type=<replaceable>TYPE</replaceable></command>
624993ac
LP
68 <arg choice="plain" rep="repeat"><replaceable>RRDOMAIN</replaceable></arg>
69 </cmdsynopsis>
70
71 <cmdsynopsis>
72 <command>systemd-resolve</command>
73 <arg choice="opt" rep="repeat">OPTIONS</arg>
27d3b124 74 <command> --service</command>
624993ac
LP
75 <arg choice="plain"><arg choice="opt"><arg choice="opt"><replaceable>NAME</replaceable></arg>
76 <replaceable>TYPE</replaceable></arg> <replaceable>DOMAIN</replaceable></arg>
77 </cmdsynopsis>
78
4ac2ca1b
ZJS
79 <cmdsynopsis>
80 <command>systemd-resolve</command>
81 <arg choice="opt" rep="repeat">OPTIONS</arg>
82 <command> --openpgp</command>
83 <arg choice="plain"><replaceable>USER@DOMAIN</replaceable></arg>
84 </cmdsynopsis>
85
624993ac
LP
86 <cmdsynopsis>
87 <command>systemd-resolve</command>
88 <arg choice="opt" rep="repeat">OPTIONS</arg>
27d3b124 89 <command> --statistics</command>
624993ac
LP
90 </cmdsynopsis>
91
92 <cmdsynopsis>
93 <command>systemd-resolve</command>
94 <arg choice="opt" rep="repeat">OPTIONS</arg>
27d3b124 95 <command> --reset-statistics</command>
624993ac
LP
96 </cmdsynopsis>
97
98 </refsynopsisdiv>
99
100 <refsect1>
101 <title>Description</title>
102
103 <para><command>systemd-resolve</command> may be used to resolve domain names, IPv4 and IPv6 addresses, DNS resource
104 records and services with the
105 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
106 resolver service. By default, the specified list of parameters will be resolved as hostnames, retrieving their IPv4
107 and IPv6 addresses. If the parameters specified are formatted as IPv4 or IPv6 operation the reverse operation is
108 done, and a hostname is retrieved for the specified addresses.</para>
109
110 <para>The <option>--type=</option> switch may be used to specify a DNS resource record type (A, AAAA, SOA, MX, ...) in
ba82da3b
ZJS
111 order to request a specific DNS resource record, instead of the address or reverse address lookups.
112 The special value <literal>help</literal> may be used to list known values.</para>
624993ac
LP
113
114 <para>The <option>--service</option> switch may be used to resolve <ulink
115 url="https://tools.ietf.org/html/rfc2782">SRV</ulink> and <ulink
116 url="https://tools.ietf.org/html/rfc6763">DNS-SD</ulink> services (see below). In this mode, between one and three
117 arguments are required. If three parameters are passed the first is assumed to be the DNS-SD service name, the
118 second the SRV service type, and the third the domain to search in. In this case a full DNS-SD style SRV and TXT
119 lookup is executed. If only two parameters are specified, the first is assumed to be the SRV service type, and the
120 second the domain to look in. In this case no TXT RR is requested. Finally, if only one parameter is specified, it
121 is assumed to be a domain name, that is already prefixed with an SRV type, and an SRV lookup is done (no
122 TXT).</para>
123
4ac2ca1b
ZJS
124 <para>The <option>--openpgp</option> switch may be use to query PGP keys stored as the
125 <ulink url="https://tools.ietf.org/html/draft-wouters-dane-openpgp-02">OPENPGPKEY</ulink> resource records.
126 When this option is specified one or more e-mail address must be specified.</para>
127
624993ac 128 <para>The <option>--statistics</option> switch may be used to show resolver statistics, including information about
07ff561c 129 the number of successful and failed DNSSEC validations.</para>
624993ac
LP
130
131 <para>The <option>--reset-statistics</option> may be used to reset various statistics counters maintained the
132 resolver, including those shown in the <option>--statistics</option> output. This operation requires root
133 privileges.</para>
134 </refsect1>
135
136 <refsect1>
137 <title>Options</title>
138 <variablelist>
139 <varlistentry>
140 <term><option>-4</option></term>
141 <term><option>-6</option></term>
142
143 <listitem><para>By default, when resolving a hostname, both IPv4 and IPv6
144 addresses are acquired. By specifying <option>-4</option> only IPv4 addresses are requested, by specifying
145 <option>-6</option> only IPv6 addresses are requested.</para>
146 </listitem>
147 </varlistentry>
148
149 <varlistentry>
150 <term><option>-i</option> <replaceable>INTERFACE</replaceable></term>
151 <term><option>--interface=</option><replaceable>INTERFACE</replaceable></term>
152
153 <listitem><para>Specifies the network interface to execute the query on. This may either be specified as numeric
154 interface index or as network interface string (e.g. <literal>en0</literal>). Note that this option has no
155 effect if system-wide DNS configuration (as configured in <filename>/etc/resolv.conf</filename> or
156 <filename>/etc/systemd/resolve.conf</filename>) in place of per-link configuration is used.</para></listitem>
157 </varlistentry>
158
159 <varlistentry>
160 <term><option>-p</option> <replaceable>PROTOCOL</replaceable></term>
161 <term><option>--protocol=</option><replaceable>PROTOCOL</replaceable></term>
162
163 <listitem><para>Specifies the network protocol for the query. May be one of <literal>dns</literal>
164 (i.e. classic unicast DNS), <literal>llmnr</literal> (<ulink
165 url="https://tools.ietf.org/html/rfc4795">Link-Local Multicast Name Resolution</ulink>),
166 <literal>llmr-ipv4</literal>, <literal>llmnr-ipv6</literal> (LLMNR via the indicated underlying IP
167 protocols). By default the lookup is done via all protocols suitable for the lookup. If used, limits the set of
168 protocols that may be used. Use this option multiple times to enable resolving via multiple protocols at the
169 same time. The setting <literal>llmnr</literal> is identical to specifying this switch once with
170 <literal>llmnr-ipv4</literal> and once via <literal>llmnr-ipv6</literal>. Note that this option does not force
171 the service to resolve the operation with the specified protocol, as that might require a suitable network
ba82da3b
ZJS
172 interface and configuration.
173 The special value <literal>help</literal> may be used to list known values.
174 </para></listitem>
624993ac
LP
175 </varlistentry>
176
177 <varlistentry>
178 <term><option>-t</option> <replaceable>TYPE</replaceable></term>
179 <term><option>--type=</option><replaceable>TYPE</replaceable></term>
180 <term><option>-c</option> <replaceable>CLASS</replaceable></term>
181 <term><option>--class=</option><replaceable>CLASS</replaceable></term>
182
183 <listitem><para>Specifies the DNS resource record type (e.g. A, AAAA, MX, …) and class (e.g. IN, ANY, …) to
184 look up. If these options are used a DNS resource record set matching the specified class and type is
ba82da3b
ZJS
185 requested. The class defaults to IN if only a type is specified.
186 The special value <literal>help</literal> may be used to list known values.
187 </para></listitem>
624993ac
LP
188 </varlistentry>
189
190 <varlistentry>
191 <term><option>--service</option></term>
192
e94968ba 193 <listitem><para>Enables service resolution. This enables DNS-SD and simple SRV service resolution, depending
624993ac
LP
194 on the specified list of parameters (see above).</para></listitem>
195 </varlistentry>
196
197 <varlistentry>
198 <term><option>--service-address=</option><replaceable>BOOL</replaceable></term>
199
200 <listitem><para>Takes a boolean parameter. If true (the default), when doing a service lookup with
201 <option>--service</option> the hostnames contained in the SRV resource records are resolved as well.</para></listitem>
202 </varlistentry>
203
204 <varlistentry>
205 <term><option>--service-txt=</option><replaceable>BOOL</replaceable></term>
206
207 <listitem><para>Takes a boolean parameter. If true (the default), when doing a DNS-SD service lookup with
208 <option>--service</option> the TXT service metadata record is resolved as well.</para></listitem>
209 </varlistentry>
210
4ac2ca1b
ZJS
211 <varlistentry>
212 <term><option>--openpgp</option></term>
213
214 <listitem><para>Enables OPENPGPKEY resource record resolution (see above). Specified e-mail
215 addresses are converted to the corresponding DNS domain name, and any OPENPGPKEY keys are
216 printed.</para></listitem>
217 </varlistentry>
218
624993ac
LP
219 <varlistentry>
220 <term><option>--cname=</option><replaceable>BOOL</replaceable></term>
221
222 <listitem><para>Takes a boolean parameter. If true (the default), DNS CNAME or DNAME redirections are
223 followed. Otherwise, if a CNAME or DNAME record is encountered while resolving, an error is
224 returned.</para></listitem>
225 </varlistentry>
226
227 <varlistentry>
228 <term><option>--search=</option><replaceable>BOOL</replaceable></term>
229
230 <listitem><para>Takes a boolean parameter. If true (the default), any specified single-label hostnames will be
231 searched in the domains configured in the search domain list, if it is non-empty. Otherwise, the search domain
232 logic is disabled.</para></listitem>
233 </varlistentry>
234
235 <varlistentry>
236 <term><option>--legend=</option><replaceable>BOOL</replaceable></term>
237
238 <listitem><para>Takes a boolean parameter. If true (the default), column headers and meta information about the
239 query response are shown. Otherwise, this output is suppressed.</para></listitem>
240 </varlistentry>
241
242 <varlistentry>
243 <term><option>--statistics</option></term>
244
245 <listitem><para>If specified general resolver statistics are shown, including information whether DNSSEC is
246 enabled and available, as well as resolution and validation statistics.</para></listitem>
247 </varlistentry>
248
249 <varlistentry>
250 <term><option>--reset-statistics</option></term>
251
252 <listitem><para>Resets the statistics counters shown in <option>--statistics</option> to zero.</para></listitem>
253 </varlistentry>
254
255 <xi:include href="standard-options.xml" xpointer="help" />
256 <xi:include href="standard-options.xml" xpointer="version" />
257 </variablelist>
258 </refsect1>
259
260 <refsect1>
261 <title>Examples</title>
262
263 <example>
264 <title>Retrieve the addresses of the <literal>www.0pointer.net</literal> domain</title>
265
266 <programlisting>$ systemd-resolve www.0pointer.net</programlisting>
267 </example>
268
269 <example>
270 <title>Retrieve the domain of the <literal>85.214.157.71</literal> IP address</title>
271
272 <programlisting>$ systemd-resolve 85.214.157.71</programlisting>
273 </example>
274
275 <example>
276 <title>Retrieve the MX record of the <literal>0pointer.net</literal> domain</title>
277
278 <programlisting>$ systemd-resolve -t MX 0pointer.net</programlisting>
279 </example>
280
281 <example>
282 <title>Resolve an SRV service</title>
283
284 <programlisting>$ systemd-resolve --service _xmpp-server._tcp gmail.com</programlisting>
285 </example>
286
287 </refsect1>
288
289 <refsect1>
290 <title>See Also</title>
291 <para>
292 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
293 <citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
294 </para>
295 </refsect1>
296</refentry>