summaryrefslogtreecommitdiff
path: root/usr.bin/dig/dig.1
blob: 92c71b2737694527d58c64ed1352d57c9a5767ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
.\" $OpenBSD: dig.1,v 1.4 2020/02/21 10:51:28 florian Exp $
.\"
.\" Copyright (C) 2000-2011, 2013-2018 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" 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.
.\"
.Dd $Mdocdate: February 21 2020 $
.Dt DIG 1
.Os
.Sh NAME
.Nm dig
.Nd DNS lookup utility
.Sh SYNOPSIS
.Nm
.Op Pf @ Ar server
.Op Fl 46hiuv
.Op Fl b Ar sourceaddr Ns Op Pf # Ar port
.Op Fl c Ar class
.Op Fl f Ar file
.Op Fl k Ar keyfile
.Op Fl p Ar port
.Op Fl q Ar name
.Op Fl t Ar type
.Op Fl x Ar addr
.Op Fl y Oo Ar hmac : Oc Ns Ar name : Ns Ar key
.Op Ar name
.Op Ar type
.Op Ar class
.Op Pf + Ar queryopt ...
.Sh DESCRIPTION
The
.Nm
command is a flexible tool for interrogating DNS name servers.
It performs DNS lookups and displays the answers that are returned from the name
servers that were queried.
Although
.Nm
is normally used with command line arguments, it also has a batch mode of
operation for reading lookup requests from a file.
When no command line arguments or options are given,
.Nm
will perform an NS query for '.' (the root).
.Pp
A typical invocation of
.Nm
looks like:
.Pp
.Dl dig @server [options] name type [class] [+queryopt]
.Bl -tag -width +queryopt
.It Pf @ Ar server
The name or IP address of the name server to query.
When the argument is a hostname,
.Nm
resolves that name before querying that name server.
If no
.Ar server
argument is provided,
.Nm
will try each of the servers listed in
.Xr resolv.conf 5 .
If no usable addresses are found,
.Nm
will send the query to the local host.
The reply from the name server that responds is displayed.
.It Ar name
The name of the resource record that is to be looked up.
.It Ar type
The type of query, as documented for
.Fl t .
The default is
.Cm A .
.It Ar class
The query class, as documented for
.Fl c .
The default is
.Cm IN .
.It Pf + Ar queryopt
One or more query options,
as documented in
.Sx QUERY OPTIONS ,
below.
.El
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl 4
Use IPv4 only.
.It Fl 6
Use IPv6 only.
.It Fl b Ar sourceaddr Ns Op Pf # Ar port
Set the source IP address of the query, which is useful on machines
with multiple interfaces.
The
.Ar sourceaddr
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
"#<port>".
.It Fl c Ar class
Set the query class.
The default is
.Cm IN ;
other classes are
.Cm HS
for Hesiod records and
.Cm CH
for Chaosnet records.
.It Fl f Ar file
Batch mode:
.Nm
reads a list of lookup requests to process from the given
.Ar file .
Each line in the file should be organized in the same way they would be
presented as queries to
.Nm
using the command-line interface.
.It Fl h
Display a brief summary of command line arguments and options.
.It Fl i
Do reverse IPv6 lookups using the obsolete RFC 1886 IP6.INT domain, which is no
longer in use.
Obsolete bit string label queries (RFC 2874) are not attempted.
.It Fl k Ar keyfile
Sign queries using TSIG.
The format of the
.Ar keyfile
is as follows:
.Bd -literal -offset indent
key "keyname" {
	algorithm hmac;
	secret "base64-secret";
};
.Ed
.Pp
.Ar keyname
is the name of the key, and
.Ar base64-secret
is the base64-encoded shared secret.
.Ar hmac
is the name of the key algorithm;
valid choices are
.Cm hmac-sha1 ,
.Cm hmac-sha224 ,
.Cm hmac-sha256 ,
.Cm hmac-sha384 ,
and
.Cm hmac-sha512 .
.It Fl p Ar port
Send the query to a non-standard port on the server, instead of the defaut port
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.
.It Fl q Ar name
The domain name to query.
This is useful to distinguish the
.Ar name
from other arguments.
.It Fl t Ar type
The resource record type to query.
It can be any valid query type.
If it is a resource record type supported in BIND 9, it can be given by the
type mnemonic (such as
.Cm NS
or
.Cm AAAA ) .
The default query type is
.Cm A ,
unless the
.Fl x
option is supplied to indicate a reverse lookup.
A zone transfer can be requested by specifying a type of
.Cm AXFR .
When an incremental zone transfer is required, set the
.Ar type
to
.Cm IXFR Ns = Ns Ar N .
The incremental zone transfer will contain the changes made to the zone since
the serial number in the zone's SOA record was
.Ar N .
.Pp
All resource record types can be expressed as
.Cm TYPE Ns Ar nn ,
where
.Ar nn
is the number of the type.
If the resource record type is not supported in BIND 9, the result will be
displayed as described in RFC 3597.
.It Fl u
Print query times in microseconds instead of milliseconds.
.It Fl v
Print the version number and exit.
.It Fl x Ar addr
Simplified reverse lookups, for mapping addresses to names.
The
.Ar addr
is an IPv4 address in dotted-decimal notation, or a colon-delimited IPv6
address.
When the
.Fl x
is used, there is no need to provide the
.Ar name ,
.Ar class
and
.Ar type
arguments.
.Nm
automatically performs a lookup for a name like
.Ql 94.2.0.192.in-addr.arpa
and sets the query type and class to
.Cm PTR
and
.Cm IN
respectively.
IPv6 addresses are looked up using nibble format under the IP6.ARPA domain
(but see also the
.Fl i
option).
.It Fl y Xo
.Op Ar hmac : Ns
.Ar keyname : Ns
.Ar secret
.Xc
Sign queries using TSIG with the given authentication key.
.Ar keyname
is the name of the key, and
.Ar secret
is the base64 encoded shared secret.
.Ar hmac
is the name of the key algorithm;
valid choices are
.Cm hmac-sha1 ,
.Cm hmac-sha224 ,
.Cm hmac-sha256 ,
.Cm hmac-sha384 ,
and
.Cm hmac-sha512 .
If
.Ar hmac
is not specified, the default is
.Cm hmac-sha256 .
.Pp
NOTE: You should use the
.Fl k
option and
avoid the
.Fl y
option, because
with
.Fl y
the shared secret is supplied as a command line argument in clear text.
This may be visible in the output from
.Xr ps 1
or in a history file maintained by the user's shell.
.El
.Pp
The
.Cm IN
and
.Cm CH
class names overlap with the IN and CH top level domain names.
Either use the
.Fl t
and
.Fl c
options to specify the type and class, use the
.Fl q
to specify the domain name, or use "IN." and "CH." when looking up these top
level domains.
.Sh QUERY OPTIONS
.Nm
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.
.Pp
Each query option is identified by a keyword preceded by a plus sign
.Pq Cm + .
Some keywords set or reset an option.
These may be preceded by the string
.Cm no
to negate the meaning of that keyword.
Other keywords assign values to options like the timeout interval.
They have the form
.Cm + Ns Ar keyword Ns = Ns Ar value .
Keywords may be abbreviated, provided the abbreviation is unambiguous; for
example,
.Cm +cd
is equivalent
to
.Cm +cdflag .
The query options are:
.Bl -tag -width Ds
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm aaflag
.Xc
A synonym for
.Xo
.Cm + Ns
.Op Cm no Ns
.Cm aaonly .
.Xc
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm aaonly
.Xc
Set the "aa" flag in the query (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm additional
.Xc
Display the additional section of a reply (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm adflag
.Xc
Set the AD (authentic data) bit in the query (on by default).
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 an OPT-OUT range.
AD=0 indicates that some part of the answer was insecure or not validated.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm all
.Xc
Set or clear all display flags.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm answer
.Xc
Display the answer section of a reply (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm authority
.Xc
Display the authority section of a reply (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm besteffort
.Xc
Attempt to display the contents of messages which are malformed (on by
default).
.It Cm +bufsize Ns = Ns Ar #
Set the UDP message buffer size advertised using EDNS0 to
.Ar #
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 an EDNS query to be sent.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm cdflag
.Xc
Set the CD (checking disabled) bit in the query (off by default).
This requests the server to not perform DNSSEC validation of responses.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm class
.Xc
Display the CLASS when printing the record (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm cmd
.Xc
Print an initial comment identifying the version of
.Nm
and the query options that have been applied (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm comments
.Xc
Display comment lines in the output (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm cookie Ns
.Op = Ns Ar value
.Xc
Send a COOKIE EDNS option, containing an optional
.Ar value
(off by default).
Replaying a COOKIE from a previous response will allow the server to
identify a previous client.
.Pp
.Cm +cookie
is automatically set when
.Cm +trace
is in use, to better emulate the default queries from a name server.
.Pp
This option was formerly called
.Xo
.Cm + Ns
.Op Cm no Ns
.Cm sit
.Xc
(Server Identity Token).
In BIND 9.10.0 through BIND 9.10.2,
it sent the experimental option code 65001.
This was changed to option code 10 in BIND 9.10.3 when the DNS
COOKIE option was allocated.
.Pp
The
.Xo
.Cm + Ns
.Op Cm no Ns
.Cm sit
.Xc
option is now deprecated, but has been retained as a synonym for
.Xo
.Cm + Ns
.Op Cm no Ns
.Cm cookie
.Xc
for backward compatibility within the BIND 9.10 branch.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm crypto
.Xc
Display cryptographic fields in DNSSEC records (on by default).
The contents of these field are unnecessary to debug most DNSSEC validation
failures and removing them makes it easier to see the common failures.
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 ]".
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm defname
.Xc
Deprecated, treated as a synonym for
.Xo
.Cm + Ns
.Op Cm no Ns
.Cm search
.Xc .
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm dnssec
.Xc
Request DNSSEC records be sent by setting the DNSSEC OK bit (DO) in the OPT
record in the additional section of the query (off by default).
.It Cm +domain Ns = Ns Ar name
Set the search list to contain the single domain
.Ar name ,
as if specified in a
.Ic domain
directive in
.Xr resolv.conf 5 ,
and enable search list processing as if the
.Cm +search
option were given (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm edns Ns
.Op = Ns Ar #
.Xc
Use EDNS in the query (on by default).
A version may also be specified, from 0 (the default) to 255.
.Cm +noedns
disables EDNS and clears the remembered version.
.It Cm +ednsflags Ns Op = Ns Ar #
Set the must-be-zero EDNS flags bits (Z bits)
to the specified value (0 by default).
Decimal, hex and octal encodings are accepted.
Setting a named flag (e.g. DO) will silently be ignored.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm ednsnegotiation
.Xc
Enable EDNS version negotiation (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm ednsopt Ns
.Op = Ns Ar code Ns Op : Ns Ar value
.Xc
Specify EDNS option with code point
.Ar code
and optionally payload of
.Ar value
as a hexadecimal string.
.Ar code
can be
either an EDNS option name (for example,
.Cm NSID
or
.Cm ECS ) ,
or an arbitrary numeric value.
.Cm +noednsopt
clears the EDNS options to be sent.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm expire
.Xc
Send an EDNS Expire option (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm fail
.Xc
Do not try the next server if you receive a SERVFAIL.
This option is on by default,
which is the reverse of normal stub resolver behavior.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm identify
.Xc
Show the IP address and port number that supplied the answer (off by default).
This option has no effect unless the
.Cm +short
option is enabled.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm idnout
.Xc
Convert puny code on output.
This version of
.Nm
does not support IDN.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm ignore
.Xc
Ignore truncation in UDP responses.
This option is off by default, which means truncated responses
cause retrying with TCP.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm keepopen
.Xc
Keep the TCP socket open between queries and reuse it.
This option is off by default, which means that a new TCP socket
is created for each lookup.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm multiline
.Xc
Print records like the SOA records in a verbose multi-line format with
human-readable comments.
This option is off by default, which means that each record is
printed on a single line to facilitate machine parsing of the
.Nm
output.
.It Cm +ndots Ns = Ns Ar #
Set the number of dots that have to appear in
.Ar name
to
.Ar #
for it to be considered absolute.
The default value is that defined using the ndots statement in
.Xr resolv.conf 5 ,
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
.Cm search
or
.Cm domain
directive in
.Xr resolv.conf 5
if
.Cm +search
is set.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm nsid
.Xc
Include an EDNS name server ID request when sending a query (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm nssearch
.Xc
Attempt 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 (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm onesoa
.Xc
Print only one (starting) SOA record when performing an
.Cm AXFR .
This option is off by default, which means that both the starting
and the ending SOA records are printed.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm opcode Ns = Ns
.Ar #
.Xc
Set or restore the DNS message opcode to the specified value,
which can be
.Cm QUERY Pq the default ,
.Cm IQUERY ,
.Cm STATUS ,
.Cm NOTIFY ,
.Cm UPDATE ,
or an integer number in the range from 0 to 15.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm qr
.Xc
Print the query as it is sent (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm question
.Xc
Print the question section of a query as a comment when an answer
is returned (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm rdflag
.Xc
A synonym for
.Xo
.Cm + Ns
.Op Cm no Ns
.Cm recurse
.Xc .
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm recurse
.Xc
Set the RD (recursion desired) bit in the query (on by default).
Recursion is automatically disabled when the
.Cm +nssearch
or
.Cm +trace
query options are used.
.It Cm +retry Ns = Ns Ar #
Set the number of times to retry UDP queries to server to
.Ar # .
The default is 2.
Unlike
.Cm +tries ,
this does not include the initial query.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm rrcomments
.Xc
Display per-record comments in the output (for example,
human-readable key information about DNSKEY records).
The default is
.Cm +rrcomments
if
.Cm +multiline
mode is active or
.Cm +norrcomments
otherwise.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm search
.Xc
Use the search list defined by the searchlist or domain directive in
.Xr resolv.conf 5 ,
if any (off by default).
\&'ndots' from
.Xr resolv.conf 5
(default 1), which may be overridden by
.Cm +ndots ,
determines if the name will be treated as relative or not and hence whether a
search is eventually performed or not.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm short
.Xc
Provide a terse answer (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm showsearch
.Xc
Perform a search showing intermediate results (off by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm split Ns = Ns Ar #
.Xc
Split long hex- or base64-formatted fields in resource records into chunks of
.Ar #
characters (where
.Ar #
is rounded up to the nearest multiple of 4).
.Cm +nosplit
or
.Cm +split Ns =0
causes fields not to be split at all.
The default is 56 characters, or 44 characters when
.Cm +multiline
mode is active.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm stats
.Xc
Print statistics:
when the query was made, the size of the reply and so on (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm subnet Ns = Ns
.Ar addr Ns
.Op / Ns Ar prefix
.Xc
Send an EDNS Client Subnet option with the specified IP address or
network prefix (off by default).
.Pp
.Nm
.Cm +subnet Ns =0.0.0.0/0,
or simply
.Nm
.Cm +subnet Ns =0
for short, sends an EDNS CLIENT-SUBNET option with an empty address and a
source prefix-length of zero, which signals a resolver that the client's address
information must
.Em not
be used when resolving this query.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm tcp
.Xc
Use TCP when querying name servers (off by default).
.Cm IXFR Ns = Ns Ar N
queries use TCP unless it is explicitly disabled with
.Cm +notcp .
.Cm AXFR
queries always use TCP.
.It Cm +timeout Ns = Ns Ar #
Set the timeout for a query to
.Ar #
seconds.
The default is 5 seconds for UDP and 10 seconds for TCP.
An attempt to set
.Ar #
to less than 1 will result in a query timeout of 1 second being applied.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm trace
.Xc
Trace the delegation path from the root name servers for the name
being looked up (off by default).
.Pp
When tracing is enabled,
.Nm
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.
.Pp
If @server is also specified, it affects only the initial query for the root
zone name servers.
.Pp
.Cm +dnssec
is also set when
.Cm +trace
is set to better emulate the default queries from a name server.
.It Cm +tries Ns = Ns Ar #
Set the number of times to try UDP queries to server to
.Ar # .
The default is 3.
If
.Ar #
is less than or equal to zero, the number of tries is silently rounded up to 1.
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm ttlid
.Xc
Display the TTL when printing the record (on by default).
.It Xo
.Cm + Ns
.Op Cm no Ns
.Cm vc
.Xc
Use TCP when querying name servers.
This alternate syntax to
.Xo
.Cm + Ns
.Op Cm no Ns
.Cm tcp
.Xc
is provided for backwards compatibility.
The "vc" stands for "virtual circuit".
.El
.Sh MULTIPLE QUERIES
The BIND 9 implementation of
.Nm
supports specifying multiple queries on the command line (in addition to
supporting the
.Fl f
batch file option).
Each of those queries can be supplied with its own set of flags, options and
query options.
.Pp
In this case, each
.Ar query
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.
.Pp
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
.Xo
.Cm + Ns
.Op Cm no Ns
.Cm cmd
.Xc
option) can be overridden by a query-specific set of query options.
For example:
.Bd -literal -offset indent
dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
.Ed
.Pp
shows how
.Nm
could be used from the command line to make three lookups: an ANY query for
www.isc.org, a reverse lookup of 127.0.0.1 and a query for the NS records of
isc.org.
A global query option of
.Cm +qr
is applied, so that
.Nm
shows the initial query it made for each lookup.
The final query has a local query option of
.Cm +noqr
which means that
.Nm
will not print the initial query when it looks up the NS records for
isc.org.
.Sh FILES
.Bl -tag -width Ds
.It Pa /etc/resolv.conf
Resolver configuration file.
.El
.Sh SEE ALSO
.Xr host 1 ,
.Xr resolv.conf 5
.Sh STANDARDS
.Rs
.%A P. Mockapetris
.%D November 1987
.%R RFC 1035
.%T Domain Names - Implementation and Specification
.Re
.Sh AUTHORS
.An -nosplit
.An Internet Systems Consortium, Inc .
.Sh BUGS
There are probably too many query options.