dig.docbook 34.6 KB
Newer Older
1
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
Mark Andrews's avatar
Mark Andrews committed
2
	       "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3
	       [<!ENTITY mdash "&#8212;">]>
4
<!--
Tinderbox User's avatar
Tinderbox User committed
5
 - Copyright (C) 2004-2011, 2013, 2014  Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
6
 - Copyright (C) 2000-2003  Internet Software Consortium.
7
 -
Automatic Updater's avatar
Automatic Updater committed
8
 - Permission to use, copy, modify, and/or distribute this software for any
9
10
11
 - purpose with or without fee is hereby granted, provided that the above
 - copyright notice and this permission notice appear in all copies.
 -
Mark Andrews's avatar
Mark Andrews committed
12
13
14
15
16
17
18
 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 - PERFORMANCE OF THIS SOFTWARE.
19
-->
Mark Andrews's avatar
Mark Andrews committed
20

21
<refentry id="man.dig">
22

23
  <refentryinfo>
24
    <date>February 19, 2014</date>
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  </refentryinfo>

  <refmeta>
    <refentrytitle>dig</refentrytitle>
    <manvolnum>1</manvolnum>
    <refmiscinfo>BIND9</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>dig</refname>
    <refpurpose>DNS lookup utility</refpurpose>
  </refnamediv>

  <docinfo>
    <copyright>
      <year>2004</year>
Mark Andrews's avatar
Mark Andrews committed
41
      <year>2005</year>
Mark Andrews's avatar
Mark Andrews committed
42
      <year>2006</year>
Mark Andrews's avatar
Mark Andrews committed
43
      <year>2007</year>
Automatic Updater's avatar
Automatic Updater committed
44
      <year>2008</year>
Automatic Updater's avatar
Automatic Updater committed
45
      <year>2009</year>
Automatic Updater's avatar
Automatic Updater committed
46
      <year>2010</year>
Automatic Updater's avatar
Automatic Updater committed
47
      <year>2011</year>
Tinderbox User's avatar
Tinderbox User committed
48
      <year>2013</year>
Tinderbox User's avatar
Tinderbox User committed
49
      <year>2014</year>
50
51
52
53
54
55
56
      <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
    </copyright>
    <copyright>
      <year>2000</year>
      <year>2001</year>
      <year>2002</year>
      <year>2003</year>
Mark Andrews's avatar
Mark Andrews committed
57
      <holder>Internet Software Consortium.</holder>
58
59
60
61
62
63
64
65
66
67
68
    </copyright>
  </docinfo>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>dig</command>
      <arg choice="opt">@server</arg>
      <arg><option>-b <replaceable class="parameter">address</replaceable></option></arg>
      <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
      <arg><option>-f <replaceable class="parameter">filename</replaceable></option></arg>
      <arg><option>-k <replaceable class="parameter">filename</replaceable></option></arg>
69
      <arg><option>-m</option></arg>
70
      <arg><option>-p <replaceable class="parameter">port#</replaceable></option></arg>
71
      <arg><option>-q <replaceable class="parameter">name</replaceable></option></arg>
72
      <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
73
      <arg><option>-v</option></arg>
74
      <arg><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
75
      <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>name:key</replaceable></option></arg>
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
      <arg><option>-4</option></arg>
      <arg><option>-6</option></arg>
      <arg choice="opt">name</arg>
      <arg choice="opt">type</arg>
      <arg choice="opt">class</arg>
      <arg choice="opt" rep="repeat">queryopt</arg>
    </cmdsynopsis>

    <cmdsynopsis>
      <command>dig</command>
      <arg><option>-h</option></arg>
    </cmdsynopsis>

    <cmdsynopsis>
      <command>dig</command>
      <arg choice="opt" rep="repeat">global-queryopt</arg>
      <arg choice="opt" rep="repeat">query</arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>DESCRIPTION</title>
    <para><command>dig</command>
      (domain information groper) is a flexible tool
      for interrogating DNS name servers.  It performs DNS lookups and
      displays the answers that are returned from the name server(s) that
      were queried.  Most DNS administrators use <command>dig</command> to
      troubleshoot DNS problems because of its flexibility, ease of use and
      clarity of output.  Other lookup tools tend to have less functionality
      than <command>dig</command>.
    </para>

    <para>
      Although <command>dig</command> is normally used with
      command-line
      arguments, it also has a batch mode of operation for reading lookup
      requests from a file.  A brief summary of its command-line arguments
      and options is printed when the <option>-h</option> option is given.
114
      Unlike earlier versions, the BIND 9 implementation of
115
116
117
118
119
120
121
      <command>dig</command> allows multiple lookups to be issued
      from the
      command line.
    </para>

    <para>
      Unless it is told to query a specific name server,
122
      <command>dig</command> will try each of the servers listed in
Jeremy C. Reed's avatar
Jeremy C. Reed committed
123
      <filename>/etc/resolv.conf</filename>. If no usable server addresses
124
125
      are found, <command>dig</command> will send the query to the local
      host.
126
127
128
    </para>

    <para>
129
130
      When no command line arguments or options are given,
      <command>dig</command> will perform an NS query for "." (the root).
131
132
133
134
135
136
137
138
139
    </para>

    <para>
      It is possible to set per-user defaults for <command>dig</command> via
      <filename>${HOME}/.digrc</filename>.  This file is read and
      any options in it
      are applied before the command line arguments.
    </para>

140
141
    <para>
      The IN and CH class names overlap with the IN and CH top level
Evan Hunt's avatar
Evan Hunt committed
142
      domain names.  Either use the <option>-t</option> and
143
144
      <option>-c</option> options to specify the type and class, 
      use the <option>-q</option> the specify the domain name, or
145
146
147
      use "IN." and "CH." when looking up these top level domains.
    </para>

148
149
150
151
152
153
154
155
156
157
158
159
  </refsect1>

  <refsect1>
    <title>SIMPLE USAGE</title>

    <para>
      A typical invocation of <command>dig</command> looks like:
      <programlisting> dig @server name type </programlisting>
      where:

      <variablelist>

Mark Andrews's avatar
Mark Andrews committed
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
	<varlistentry>
	  <term><constant>server</constant></term>
	  <listitem>
	    <para>
	      is the name or IP address of the name server to query.  This
	      can be an IPv4 address in dotted-decimal notation or an IPv6
	      address in colon-delimited notation.  When the supplied
	      <parameter>server</parameter> argument is a hostname,
	      <command>dig</command> resolves that name before querying
	      that name server.
	    </para>
	    <para>
	      If no <parameter>server</parameter> argument is
	      provided, <command>dig</command> consults
	      <filename>/etc/resolv.conf</filename>; if an
	      address is found there, it queries the name server at
	      that address. If either of the <option>-4</option> or
	      <option>-6</option> options are in use, then
	      only addresses for the corresponding transport
	      will be tried.  If no usable addresses are found,
	      <command>dig</command> will send the query to the
	      local host.  The reply from the name server that
	      responds is displayed.
	    </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><constant>name</constant></term>
	  <listitem>
	    <para>
	      is the name of the resource record that is to be looked up.
	    </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><constant>type</constant></term>
	  <listitem>
	    <para>
	      indicates what type of query is required &mdash;
	      ANY, A, MX, SIG, etc.
	      <parameter>type</parameter> can be any valid query
	      type.  If no
	      <parameter>type</parameter> argument is supplied,
	      <command>dig</command> will perform a lookup for an
	      A record.
	    </para>
	  </listitem>
	</varlistentry>
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231

      </variablelist>
    </para>

  </refsect1>

  <refsect1>
    <title>OPTIONS</title>

    <para>
      The <option>-b</option> option sets the source IP address of the query
      to <parameter>address</parameter>.  This must be a valid
      address on
      one of the host's network interfaces or "0.0.0.0" or "::".  An optional
      port
      may be specified by appending "#&lt;port&gt;"
    </para>

    <para>
      The default query class (IN for internet) is overridden by the
      <option>-c</option> option.  <parameter>class</parameter> is
      any valid
232
      class, such as HS for Hesiod records or CH for Chaosnet records.
233
234
235
236
237
238
239
240
    </para>

    <para>
      The <option>-f</option> option makes <command>dig </command>
      operate
      in batch mode by reading a list of lookup requests to process from the
      file <parameter>filename</parameter>.  The file contains a
      number of
241
      queries, one per line.  Each entry in the file should be organized in
242
243
244
245
      the same way they would be presented as queries to
      <command>dig</command> using the command-line interface.
    </para>

246
247
248
    <para>
      The <option>-m</option> option enables memory usage debugging.
      <!-- It enables ISC_MEM_DEBUGTRACE and ISC_MEM_DEBUGRECORD
Mark Andrews's avatar
Mark Andrews committed
249
	   documented in include/isc/mem.h -->
250
251
    </para>

252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
    <para>
      If a non-standard port number is to be queried, the
      <option>-p</option> option is used.  <parameter>port#</parameter> is
      the port number that <command>dig</command> will send its
      queries
      instead of the standard DNS port number 53.  This option would be used
      to test a name server that has been configured to listen for queries
      on a non-standard port number.
    </para>

    <para>
      The <option>-4</option> option forces <command>dig</command>
      to only
      use IPv4 query transport.  The <option>-6</option> option forces
      <command>dig</command> to only use IPv6 query transport.
    </para>

    <para>
      The <option>-t</option> option sets the query type to
      <parameter>type</parameter>.  It can be any valid query type
      which is
273
      supported in BIND 9.  The default query type is "A", unless the
274
275
276
277
278
279
280
281
282
      <option>-x</option> option is supplied to indicate a reverse lookup.
      A zone transfer can be requested by specifying a type of AXFR.  When
      an incremental zone transfer (IXFR) is required,
      <parameter>type</parameter> is set to <literal>ixfr=N</literal>.
      The incremental zone transfer will contain the changes made to the zone
      since the serial number in the zone's SOA record was
      <parameter>N</parameter>.
    </para>

283
284
    <para>
      The <option>-q</option> option sets the query name to 
Evan Hunt's avatar
Evan Hunt committed
285
      <parameter>name</parameter>.  This is useful to distinguish the
Mark Andrews's avatar
Mark Andrews committed
286
      <parameter>name</parameter> from other arguments.
287
288
    </para>

289
290
291
292
293
    <para>
      The <option>-v</option> causes <command>dig</command> to
      print the version number and exit.
    </para>

294
    <para>
295
      Reverse lookups &mdash; mapping addresses to names &mdash; are simplified by the
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
      <option>-x</option> option.  <parameter>addr</parameter> is
      an IPv4
      address in dotted-decimal notation, or a colon-delimited IPv6 address.
      When this option is used, there is no need to provide the
      <parameter>name</parameter>, <parameter>class</parameter> and
      <parameter>type</parameter> arguments.  <command>dig</command>
      automatically performs a lookup for a name like
      <literal>11.12.13.10.in-addr.arpa</literal> and sets the
      query type and
      class to PTR and IN respectively.  By default, IPv6 addresses are
      looked up using nibble format under the IP6.ARPA domain.
      To use the older RFC1886 method using the IP6.INT domain
      specify the <option>-i</option> option.  Bit string labels (RFC2874)
      are now experimental and are not attempted.
    </para>

    <para>
      To sign the DNS queries sent by <command>dig</command> and
      their
      responses using transaction signatures (TSIG), specify a TSIG key file
      using the <option>-k</option> option.  You can also specify the TSIG
      key itself on the command line using the <option>-y</option> option;
318
      <parameter>hmac</parameter> is the type of the TSIG, default HMAC-MD5,
319
320
321
322
323
      <parameter>name</parameter> is the name of the TSIG key and
      <parameter>key</parameter> is the actual key.  The key is a
      base-64
      encoded string, typically generated by
      <citerefentry>
Mark Andrews's avatar
Mark Andrews committed
324
	<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
325
326
327
328
329
      </citerefentry>.

      Caution should be taken when using the <option>-y</option> option on
      multi-user systems as the key can be visible in the output from
      <citerefentry>
Mark Andrews's avatar
Mark Andrews committed
330
	<refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
      </citerefentry>
      or in the shell's history file.  When
      using TSIG authentication with <command>dig</command>, the name
      server that is queried needs to know the key and algorithm that is
      being used.  In BIND, this is done by providing appropriate
      <command>key</command> and <command>server</command> statements in
      <filename>named.conf</filename>.
    </para>

  </refsect1>

  <refsect1>
    <title>QUERY OPTIONS</title>

    <para><command>dig</command>
      provides a number of query options which affect
      the way in which lookups are made and the results displayed.  Some of
      these set or reset flag bits in the query header, some determine which
      sections of the answer get printed, and others determine the timeout
      and retry strategies.
    </para>

    <para>
      Each query option is identified by a keyword preceded by a plus sign
      (<literal>+</literal>).  Some keywords set or reset an
      option.  These may be preceded
      by the string <literal>no</literal> to negate the meaning of
      that keyword.  Other
      keywords assign values to options like the timeout interval.  They
      have the form <option>+keyword=value</option>.
      The query options are:

      <variablelist>

Mark Andrews's avatar
Mark Andrews committed
365
366
	<varlistentry>
	  <term><option>+[no]aaflag</option></term>
367
368
369
370
371
372
	  <listitem>
	    <para>
	      A synonym for <parameter>+[no]aaonly</parameter>.
	    </para>
	  </listitem>
	</varlistentry>
373

Mark Andrews's avatar
Mark Andrews committed
374
375
	<varlistentry>
	  <term><option>+[no]aaonly</option></term>
376
377
378
379
380
381
	  <listitem>
	    <para>
	      Sets the "aa" flag in the query.
	    </para>
	  </listitem>
	</varlistentry>
382

Mark Andrews's avatar
Mark Andrews committed
383
384
	<varlistentry>
	  <term><option>+[no]additional</option></term>
385
386
387
388
389
390
391
	  <listitem>
	    <para>
	      Display [do not display] the additional section of a
	      reply.  The default is to display it.
	    </para>
	  </listitem>
	</varlistentry>
392

Mark Andrews's avatar
Mark Andrews committed
393
394
	<varlistentry>
	  <term><option>+[no]adflag</option></term>
395
396
397
398
399
400
401
402
403
	  <listitem>
	    <para>
	      Set [do not set] the AD (authentic data) bit in the
	      query.  This requests the server to return whether
	      all of the answer and authority sections have all
	      been validated as secure according to the security
	      policy of the server.  AD=1 indicates that all records
	      have been validated as secure and the answer is not
	      from a OPT-OUT range.  AD=0 indicate that some part
404
405
	      of the answer was insecure or not validated.  This
	      bit is set by default.
406
407
408
	    </para>
	  </listitem>
	</varlistentry>
409

Mark Andrews's avatar
Mark Andrews committed
410
411
	<varlistentry>
	  <term><option>+[no]all</option></term>
412
413
414
415
416
417
	  <listitem>
	    <para>
	      Set or clear all display flags.
	    </para>
	  </listitem>
	</varlistentry>
418

Mark Andrews's avatar
Mark Andrews committed
419
420
	<varlistentry>
	  <term><option>+[no]answer</option></term>
421
422
423
424
425
426
427
	  <listitem>
	    <para>
	      Display [do not display] the answer section of a
	      reply.  The default is to display it.
	    </para>
	  </listitem>
	</varlistentry>
428

Mark Andrews's avatar
Mark Andrews committed
429
430
	<varlistentry>
	  <term><option>+[no]authority</option></term>
431
432
433
434
435
436
437
	  <listitem>
	    <para>
	      Display [do not display] the authority section of a
	      reply.  The default is to display it.
	    </para>
	  </listitem>
	</varlistentry>
438

Mark Andrews's avatar
Mark Andrews committed
439
440
	<varlistentry>
	  <term><option>+[no]besteffort</option></term>
441
442
443
444
445
446
447
448
	  <listitem>
	    <para>
	      Attempt to display the contents of messages which are
	      malformed.  The default is to not display malformed
	      answers.
	    </para>
	  </listitem>
	</varlistentry>
Evan Hunt's avatar
Evan Hunt committed
449

Mark Andrews's avatar
Mark Andrews committed
450
451
	<varlistentry>
	  <term><option>+bufsize=B</option></term>
452
453
	  <listitem>
	    <para>
454
455
456
457
458
459
	      Set the UDP message buffer size advertised using EDNS0
	      to <parameter>B</parameter> bytes.  The maximum and
	      minimum sizes of this buffer are 65535 and 0 respectively.
	      Values outside this range are rounded up or down
	      appropriately.  Values other than zero will cause a
	      EDNS query to be sent.
460
461
462
	    </para>
	  </listitem>
	</varlistentry>
463

Mark Andrews's avatar
Mark Andrews committed
464
465
	<varlistentry>
	  <term><option>+[no]cdflag</option></term>
466
467
468
469
470
471
472
473
	  <listitem>
	    <para>
	      Set [do not set] the CD (checking disabled) bit in
	      the query.  This requests the server to not perform
	      DNSSEC validation of responses.
	    </para>
	  </listitem>
	</varlistentry>
474

Mark Andrews's avatar
Mark Andrews committed
475
476
	<varlistentry>
	  <term><option>+[no]cl</option></term>
477
	  <listitem>
478
	    <para>
479
480
	      Display [do not display] the CLASS when printing the
	      record.
481
	    </para>
482
483
484
	  </listitem>
	</varlistentry>

Mark Andrews's avatar
Mark Andrews committed
485
486
	<varlistentry>
	  <term><option>+[no]cmd</option></term>
487
	  <listitem>
488
	    <para>
489
490
491
492
	      Toggles the printing of the initial comment in the
	      output identifying the version of <command>dig</command>
	      and the query options that have been applied.  This
	      comment is printed by default.
493
494
495
	    </para>
	  </listitem>
	</varlistentry>
496

Mark Andrews's avatar
Mark Andrews committed
497
498
	<varlistentry>
	  <term><option>+[no]comments</option></term>
499
500
501
502
503
504
505
	  <listitem>
	    <para>
	      Toggle the display of comment lines in the output.
	      The default is to print comments.
	    </para>
	  </listitem>
	</varlistentry>
506

Mark Andrews's avatar
Mark Andrews committed
507
508
	<varlistentry>
	  <term><option>+[no]crypto</option></term>
509
510
511
512
513
514
515
516
517
518
519
520
521
	  <listitem>
	    <para>
	      Toggle the display of cryptographic fields in DNSSEC
	      records.  The contents of these field are unnecessary
	      to debug most DNSSEC validation failures and removing
	      them makes it easier to see the common failures.  The
	      default is to display the fields.  When omitted they
	      are replaced by the string "[omitted]" or in the
	      DNSKEY case the key id is displayed as the replacement,
	      e.g. "[ key id = value ]".
	    </para>
	  </listitem>
	</varlistentry>
522

Mark Andrews's avatar
Mark Andrews committed
523
524
	<varlistentry>
	  <term><option>+[no]defname</option></term>
525
526
527
528
529
530
531
	  <listitem>
	    <para>
	      Deprecated, treated as a synonym for
	      <parameter>+[no]search</parameter>
	    </para>
	  </listitem>
	</varlistentry>
532

Mark Andrews's avatar
Mark Andrews committed
533
534
	<varlistentry>
	  <term><option>+[no]dnssec</option></term>
535
536
	  <listitem>
	    <para>
Mark Andrews's avatar
Mark Andrews committed
537
538
539
	      Requests DNSSEC records be sent by setting the DNSSEC
	      OK bit (DO) in the OPT record in the additional section
	      of the query.
540
541
542
	    </para>
	  </listitem>
	</varlistentry>
543

Mark Andrews's avatar
Mark Andrews committed
544
545
	<varlistentry>
	  <term><option>+domain=somename</option></term>
546
547
	  <listitem>
	    <para>
Mark Andrews's avatar
Mark Andrews committed
548
549
550
551
552
553
	      Set the search list to contain the single domain
	      <parameter>somename</parameter>, as if specified in
	      a <command>domain</command> directive in
	      <filename>/etc/resolv.conf</filename>, and enable
	      search list processing as if the
	      <parameter>+search</parameter> option were given.
554
555
556
557
	    </para>
	  </listitem>
	</varlistentry>

558
559
560
561
562
	<varlistentry>
	  <term><option>+dscp=value</option></term> <listitem>
	    <para>
	      Set the DSCP code point to be used when sending the
	      query.  Valid DSCP code points are in the range
Jeremy C. Reed's avatar
Jeremy C. Reed committed
563
	      [0..63].  By default no code point is explicitly set.
564
565
566
567
	    </para>
	  </listitem>
	</varlistentry>

568
569
570
571
572
573
574
575
576
577
578
579
580
	<varlistentry>
	  <term><option>+[no]edns[=#]</option></term>
	  <listitem>
	    <para>
	       Specify the EDNS version to query with.  Valid values
	       are 0 to 255.  Setting the EDNS version will cause
	       a EDNS query to be sent.  <option>+noedns</option>
	       clears the remembered EDNS version.  EDNS is set to
	       0 by default.
	    </para>
	  </listitem>
	</varlistentry>

581
582
583
584
585
586
587
588
589
590
591
592
	<varlistentry>
	  <term><option>+[no]ednsflags[=#]</option></term>
	  <listitem>
	    <para>
	      Set the must-be-zero EDNS flags bits (Z bits) to the
	      specified value. Decimal, hex and octal encodings are
	      accepted. Setting a named flag (e.g. DO) will silently be
	      ignored. By default, no Z bits are set.
	    </para>
	  </listitem>
	</varlistentry>

593
594
595
596
597
598
599
	<varlistentry>
	  <term><option>+[no]ednsopt[=code[:value]]</option></term>
	  <listitem>
	    <para>
	      Specify EDNS option with code point <option>code</option>
	      and optionally payload of <option>value</option> as a
	      hexadecimal string.  <option>+noednsopt</option>
Mark Andrews's avatar
grammar    
Mark Andrews committed
600
	      clears the EDNS options to be sent.
601
602
603
	    </para>
	  </listitem>
	</varlistentry>
604

Mark Andrews's avatar
Mark Andrews committed
605
606
	<varlistentry>
	  <term><option>+[no]expire</option></term>
607
608
609
610
611
612
	  <listitem>
	    <para>
	      Send an EDNS Expire option.
	    </para>
	  </listitem>
	</varlistentry>
613

Mark Andrews's avatar
Mark Andrews committed
614
615
	<varlistentry>
	  <term><option>+[no]fail</option></term>
616
617
618
619
620
621
622
623
	  <listitem>
	    <para>
	      Do not try the next server if you receive a SERVFAIL.
	      The default is to not try the next server which is
	      the reverse of normal stub resolver behavior.
	    </para>
	  </listitem>
	</varlistentry>
624

Mark Andrews's avatar
Mark Andrews committed
625
626
	<varlistentry>
	  <term><option>+[no]identify</option></term>
627
628
629
630
631
632
633
634
635
636
637
	  <listitem>
	    <para>
	      Show [or do not show] the IP address and port number
	      that supplied the answer when the
	      <parameter>+short</parameter> option is enabled.  If
	      short form answers are requested, the default is not
	      to show the source address and port number of the
	      server that provided the answer.
	    </para>
	  </listitem>
	</varlistentry>
638

Mark Andrews's avatar
Mark Andrews committed
639
640
	<varlistentry>
	  <term><option>+[no]ignore</option></term>
641
642
643
644
645
646
647
	  <listitem>
	    <para>
	      Ignore truncation in UDP responses instead of retrying
	      with TCP.  By default, TCP retries are performed.
	    </para>
	  </listitem>
	</varlistentry>
648

Mark Andrews's avatar
Mark Andrews committed
649
650
	<varlistentry>
	  <term><option>+[no]keepopen</option></term>
651
652
653
654
655
656
657
658
	  <listitem>
	    <para>
	      Keep the TCP socket open between queries and reuse
	      it rather than creating a new TCP socket for each
	      lookup.  The default is <option>+nokeepopen</option>.
	    </para>
	  </listitem>
	</varlistentry>
659

Mark Andrews's avatar
Mark Andrews committed
660
661
	<varlistentry>
	  <term><option>+[no]multiline</option></term>
662
663
664
665
666
667
668
669
670
671
	  <listitem>
	    <para>
	      Print records like the SOA records in a verbose
	      multi-line format with human-readable comments.  The
	      default is to print each record on a single line, to
	      facilitate machine parsing of the <command>dig</command>
	      output.
	    </para>
	  </listitem>
	</varlistentry>
672

Mark Andrews's avatar
Mark Andrews committed
673
674
	<varlistentry>
	  <term><option>+ndots=D</option></term>
675
676
677
678
679
680
681
682
683
684
685
	  <listitem>
	    <para>
	      Set the number of dots that have to appear in
	      <parameter>name</parameter> to <parameter>D</parameter>
	      for it to be considered absolute.  The default value
	      is that defined using the ndots statement in
	      <filename>/etc/resolv.conf</filename>, or 1 if no
	      ndots statement is present.  Names with fewer dots
	      are interpreted as relative names and will be searched
	      for in the domains listed in the <option>search</option>
	      or <option>domain</option> directive in
686
687
	      <filename>/etc/resolv.conf</filename> if
	      <option>+search</option> is set.
688
689
690
	    </para>
	  </listitem>
	</varlistentry>
691

Mark Andrews's avatar
Mark Andrews committed
692
693
	<varlistentry>
	  <term><option>+[no]nsid</option></term>
694
695
696
697
698
699
700
701
	  <listitem>
	    <para>
	      Include an EDNS name server ID request when sending
	      a query.
	    </para>
	  </listitem>
	</varlistentry>

Mark Andrews's avatar
Mark Andrews committed
702
703
	<varlistentry>
	  <term><option>+[no]nssearch</option></term>
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
	  <listitem>
	    <para>
	      When this option is set, <command>dig</command>
	      attempts to find the authoritative name servers for
	      the zone containing the name being looked up and
	      display the SOA record that each name server has for
	      the zone.
	    </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>+[no]onesoa</option></term>
	  <listitem>
	    <para>
	      Print only one (starting) SOA record when performing
	      an AXFR. The default is to print both the starting
	      and ending SOA records.
	    </para>
	  </listitem>
	</varlistentry>
725

Mark Andrews's avatar
Mark Andrews committed
726
727
	<varlistentry>
	  <term><option>+[no]qr</option></term>
728
729
730
731
732
733
734
	  <listitem>
	    <para>
	      Print [do not print] the query as it is sent.  By
	      default, the query is not printed.
	    </para>
	  </listitem>
	</varlistentry>
735

Mark Andrews's avatar
Mark Andrews committed
736
737
	<varlistentry>
	  <term><option>+[no]question</option></term>
738
739
740
741
742
743
744
745
	  <listitem>
	    <para>
	      Print [do not print] the question section of a query
	      when an answer is returned.  The default is to print
	      the question section as a comment.
	    </para>
	  </listitem>
	</varlistentry>
746

Mark Andrews's avatar
Mark Andrews committed
747
748
	<varlistentry>
	  <term><option>+[no]recurse</option></term>
749
750
751
752
753
754
755
756
757
758
759
	  <listitem>
	    <para>
	      Toggle the setting of the RD (recursion desired) bit
	      in the query.  This bit is set by default, which means
	      <command>dig</command> normally sends recursive
	      queries.  Recursion is automatically disabled when
	      the <parameter>+nssearch</parameter> or
	      <parameter>+trace</parameter> query options are used.
	    </para>
	  </listitem>
	</varlistentry>
760

Mark Andrews's avatar
Mark Andrews committed
761
762
	<varlistentry>
	  <term><option>+retry=T</option></term>
763
764
765
766
767
768
769
770
771
	  <listitem>
	    <para>
	      Sets the number of times to retry UDP queries to
	      server to <parameter>T</parameter> instead of the
	      default, 2.  Unlike <parameter>+tries</parameter>,
	      this does not include the initial query.
	    </para>
	  </listitem>
	</varlistentry>
772

Mark Andrews's avatar
Mark Andrews committed
773
774
	<varlistentry>
	  <term><option>+[no]rrcomments</option></term>
775
776
777
778
779
780
781
782
783
	  <listitem>
	    <para>
	      Toggle the display of per-record comments in the
	      output (for example, human-readable key information
	      about DNSKEY records).  The default is not to print
	      record comments unless multiline mode is active.
	    </para>
	  </listitem>
	</varlistentry>
784

Mark Andrews's avatar
Mark Andrews committed
785
786
	<varlistentry>
	  <term><option>+[no]search</option></term>
787
788
	  <listitem>
	    <para>
789
790
791
792
	      Use [do not use] the search list defined by the
	      searchlist or domain directive in
	      <filename>resolv.conf</filename> (if any).  The search
	      list is not used by default.
793
	    </para>
794
795
796
797
798
799
800
	    <para>
	      'ndots' from <filename>resolv.conf</filename> (default 1)
	       which may be overridden by <parameter>+ndots</parameter>
	      determines if the name will be treated as relative
	      or not and hence whether a search is eventually
	      performed or not.
	    </para>
801
802
803
	  </listitem>
	</varlistentry>

Mark Andrews's avatar
Mark Andrews committed
804
805
	<varlistentry>
	  <term><option>+[no]short</option></term>
806
807
	  <listitem>
	    <para>
808
809
	      Provide a terse answer.  The default is to print the
	      answer in a verbose form.
810
811
812
813
	    </para>
	  </listitem>
	</varlistentry>

Mark Andrews's avatar
Mark Andrews committed
814
815
	<varlistentry>
	  <term><option>+[no]showsearch</option></term>
816
817
	  <listitem>
	    <para>
818
819
	      Perform [do not perform] a search showing intermediate
	      results.
820
821
822
823
	    </para>
	  </listitem>
	</varlistentry>

Mark Andrews's avatar
Mark Andrews committed
824
825
	<varlistentry>
	  <term><option>+[no]sigchase</option></term>
826
827
828
829
830
831
832
	  <listitem>
	    <para>
	      Chase DNSSEC signature chains.  Requires dig be
	      compiled with -DDIG_SIGCHASE.
	    </para>
	  </listitem>
	</varlistentry>
833

Mark Andrews's avatar
Mark Andrews committed
834
835
	<varlistentry>
	  <term><option>+[no]sit<optional>=####</optional></option></term>
836
837
838
839
840
841
842
843
844
845
	  <listitem>
	    <para>
	      Send a Source Identity Token EDNS option, with optional
	      value.  Replaying a SIT from a previous response will
	      allow the server to identify a previous client.  The
	      default is <option>+nosit</option>.  Currently using
	      experimental value 65001 for the option code.
	    </para>
	  </listitem>
	</varlistentry>
846

Mark Andrews's avatar
Mark Andrews committed
847
848
	<varlistentry>
	  <term><option>+split=W</option></term>
849
850
851
852
853
854
855
856
857
858
859
860
861
	  <listitem>
	    <para>
	      Split long hex- or base64-formatted fields in resource
	      records into chunks of <parameter>W</parameter>
	      characters (where <parameter>W</parameter> is rounded
	      up to the nearest multiple of 4).
	      <parameter>+nosplit</parameter> or
	      <parameter>+split=0</parameter> causes fields not to
	      be split at all.  The default is 56 characters, or
	      44 characters when multiline mode is active.
	    </para>
	  </listitem>
	</varlistentry>
862

Mark Andrews's avatar
Mark Andrews committed
863
864
	<varlistentry>
	  <term><option>+[no]stats</option></term>
865
866
867
868
869
870
871
872
873
	  <listitem>
	    <para>
	      This query option toggles the printing of statistics:
	      when the query was made, the size of the reply and
	      so on.  The default behavior is to print the query
	      statistics.
	    </para>
	  </listitem>
	</varlistentry>
874

Mark Andrews's avatar
Mark Andrews committed
875
876
	<varlistentry>
	  <term><option>+[no]subnet=addr/prefix</option></term>
877
	  <listitem>
Mark Andrews's avatar
Mark Andrews committed
878
	    <para>
Jeremy C. Reed's avatar
Jeremy C. Reed committed
879
	      Send an EDNS Client Subnet option with the specified
880
	      IP address or network prefix.
Mark Andrews's avatar
Mark Andrews committed
881
	    </para>
882
883
884
	  </listitem>
	</varlistentry>

Mark Andrews's avatar
Mark Andrews committed
885
886
	<varlistentry>
	  <term><option>+[no]tcp</option></term>
887
	  <listitem>
Mark Andrews's avatar
Mark Andrews committed
888
	    <para>
889
890
891
892
893
	      Use [do not use] TCP when querying name servers. The
	      default behavior is to use UDP unless an
	      <literal>ixfr=N</literal> query is requested, in which
	      case the default is TCP.  AXFR queries always use
	      TCP.
Mark Andrews's avatar
Mark Andrews committed
894
	    </para>
895
896
	  </listitem>
	</varlistentry>
897

Mark Andrews's avatar
Mark Andrews committed
898
899
	<varlistentry>
	  <term><option>+time=T</option></term>
900
901
902
	  <listitem>
	    <para>

Mark Andrews's avatar
Mark Andrews committed
903
904
	      Sets the timeout for a query to
	      <parameter>T</parameter> seconds.  The default
905
	      timeout is 5 seconds.
Mark Andrews's avatar
Mark Andrews committed
906
907
908
909
910
911
912
913
914
	      An attempt to set <parameter>T</parameter> to less
	      than 1 will result
	      in a query timeout of 1 second being applied.
	    </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>+[no]topdown</option></term>
915
916
917
918
919
920
921
	  <listitem>
	    <para>
	      When chasing DNSSEC signature chains perform a top-down
	      validation.  Requires dig be compiled with -DDIG_SIGCHASE.
	    </para>
	  </listitem>
	</varlistentry>
922

Mark Andrews's avatar
Mark Andrews committed
923
924
	<varlistentry>
	  <term><option>+[no]trace</option></term>
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
	  <listitem>
	    <para>
	      Toggle tracing of the delegation path from the root
	      name servers for the name being looked up.  Tracing
	      is disabled by default.  When tracing is enabled,
	      <command>dig</command> makes iterative queries to
	      resolve the name being looked up.  It will follow
	      referrals from the root servers, showing the answer
	      from each server that was used to resolve the lookup.
	    </para> <para>
	      <command>+dnssec</command> is also set when +trace
	      is set to better emulate the default queries from a
	      nameserver.
	    </para>
	  </listitem>
	</varlistentry>
941

Mark Andrews's avatar
Mark Andrews committed
942
943
	<varlistentry>
	  <term><option>+tries=T</option></term>
944
945
946
947
948
949
950
951
952
953
	  <listitem>
	    <para>
	      Sets the number of times to try UDP queries to server
	      to <parameter>T</parameter> instead of the default,
	      3.  If <parameter>T</parameter> is less than or equal
	      to zero, the number of tries is silently rounded up
	      to 1.
	    </para>
	  </listitem>
	</varlistentry>
954

Mark Andrews's avatar
Mark Andrews committed
955
956
	<varlistentry>
	  <term><option>+trusted-key=####</option></term>
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
	  <listitem>
	    <para>
	      Specifies a file containing trusted keys to be used
	      with <option>+sigchase</option>.  Each DNSKEY record
	      must be on its own line.
	    </para> <para>
	      If not specified, <command>dig</command> will look
	      for <filename>/etc/trusted-key.key</filename> then
	      <filename>trusted-key.key</filename> in the current
	      directory.
	    </para> <para>
	      Requires dig be compiled with -DDIG_SIGCHASE.
	    </para>
	  </listitem>
	</varlistentry>
Evan Hunt's avatar
Evan Hunt committed
972

Mark Andrews's avatar
Mark Andrews committed
973
974
	<varlistentry>
	  <term><option>+[no]ttlid</option></term>
975
976
977
978
979
980
981
982
	  <listitem>
	    <para>
	      Display [do not display] the TTL when printing the
	      record.
	    </para>
	  </listitem>
	</varlistentry>

Mark Andrews's avatar
Mark Andrews committed
983
984
985
986
987
988
989
990
991
992
993
994
995
	<varlistentry>
	  <term><option>+[no]ttlunits</option></term>
	  <listitem>
	    <para>
	      Display [do not display] the TTL in friendly human-readable
	      time units of "s", "m", "h", "d", and "w", representing
	      seconds, minutes, hours, days and weeks.  Implies +ttlid.
	    </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>+[no]vc</option></term>
996
997
998
999
1000
1001
1002
1003
1004
1005
	  <listitem>
	    <para>
	      Use [do not use] TCP when querying name servers.  This
	      alternate syntax to <parameter>+[no]tcp</parameter>
	      is provided for backwards compatibility.  The "vc"
	      stands for "virtual circuit".
	    </para>
	  </listitem>
	</varlistentry>

1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
      </variablelist>

    </para>
  </refsect1>

  <refsect1>
    <title>MULTIPLE QUERIES</title>

    <para>
      The BIND 9 implementation of <command>dig </command>
      supports
      specifying multiple queries on the command line (in addition to
      supporting the <option>-f</option> batch file option).  Each of those
      queries can be supplied with its own set of flags, options and query
      options.
    </para>

    <para>
      In this case, each <parameter>query</parameter> argument
      represent an
      individual query in the command-line syntax described above.  Each
      consists of any of the standard options and flags, the name to be
      looked up, an optional query type and class and any query options that
      should be applied to that query.
    </para>

    <para>
      A global set of query options, which should be applied to all queries,
      can also be supplied.  These global query options must precede the
      first tuple of name, class, type, options, flags, and query options
      supplied on the command line.  Any global query options (except
      the <option>+[no]cmd</option> option) can be
      overridden by a query-specific set of query options.  For example:
      <programlisting>
1040
1041
dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
</programlisting>
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
      shows how <command>dig</command> could be used from the
      command line
      to make three lookups: an ANY query for <literal>www.isc.org</literal>, a
      reverse lookup of 127.0.0.1 and a query for the NS records of
      <literal>isc.org</literal>.

      A global query option of <parameter>+qr</parameter> is
      applied, so
      that <command>dig</command> shows the initial query it made
      for each
      lookup.  The final query has a local query option of
      <parameter>+noqr</parameter> which means that <command>dig</command>
      will not print the initial query when it looks up the NS records for
      <literal>isc.org</literal>.
    </para>

  </refsect1>

1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
  <refsect1>
    <title>IDN SUPPORT</title>
    <para>
      If <command>dig</command> has been built with IDN (internationalized
      domain name) support, it can accept and display non-ASCII domain names.
      <command>dig</command> appropriately converts character encoding of
      domain name before sending a request to DNS server or displaying a
      reply from the server.
      If you'd like to turn off the IDN support for some reason, defines
      the <envar>IDN_DISABLE</envar> environment variable.
      The IDN support is disabled if the variable is set when 
      <command>dig</command> runs.
    </para>
  </refsect1>

1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
  <refsect1>
    <title>FILES</title>
    <para><filename>/etc/resolv.conf</filename>
    </para>
    <para><filename>${HOME}/.digrc</filename>
    </para>
  </refsect1>

  <refsect1>
    <title>SEE ALSO</title>
    <para><citerefentry>
Mark Andrews's avatar
Mark Andrews committed
1086
	<refentrytitle>host</refentrytitle><manvolnum>1</manvolnum>
1087
1088
      </citerefentry>,
      <citerefentry>
Mark Andrews's avatar
Mark Andrews committed
1089
	<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
1090
1091
      </citerefentry>,
      <citerefentry>
Mark Andrews's avatar
Mark Andrews committed
1092
	<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
      </citerefentry>,
      <citetitle>RFC1035</citetitle>.
    </para>
  </refsect1>

  <refsect1>
    <title>BUGS</title>
    <para>
      There are probably too many query options.
    </para>
  </refsect1>
</refentry><!--
 - Local variables:
 - mode: sgml
 - End:
-->