1DIG(1)                               BIND9                              DIG(1)
2
3
4

NAME

6       dig - DNS lookup utility
7

SYNOPSIS

9       dig [@server] [-b address] [-c class] [-f filename] [-k filename] [-m]
10           [-p port#] [-q name] [-t type] [-x addr] [-y [hmac:]name:key] [-4]
11           [-6] [name] [type] [class] [queryopt...]
12
13       dig [-h]
14
15       dig [global-queryopt...] [query...]
16

DESCRIPTION

18       dig (domain information groper) is a flexible tool for interrogating
19       DNS name servers. It performs DNS lookups and displays the answers that
20       are returned from the name server(s) that were queried. Most DNS
21       administrators use dig to troubleshoot DNS problems because of its
22       flexibility, ease of use and clarity of output. Other lookup tools tend
23       to have less functionality than dig.
24
25       Although dig is normally used with command-line arguments, it also has
26       a batch mode of operation for reading lookup requests from a file. A
27       brief summary of its command-line arguments and options is printed when
28       the -h option is given. Unlike earlier versions, the BIND 9
29       implementation of dig allows multiple lookups to be issued from the
30       command line.
31
32       Unless it is told to query a specific name server, dig will try each of
33       the servers listed in /etc/resolv.conf.
34
35       When no command line arguments or options are given, dig will perform
36       an NS query for "." (the root).
37
38       It is possible to set per-user defaults for dig via ${HOME}/.digrc.
39       This file is read and any options in it are applied before the command
40       line arguments.
41
42       The IN and CH class names overlap with the IN and CH top level domains
43       names. Either use the -t and -c options to specify the type and class,
44       use the -q the specify the domain name, or use "IN." and "CH." when
45       looking up these top level domains.
46

SIMPLE USAGE

48       A typical invocation of dig looks like:
49
50            dig @server name type
51
52       where:
53
54       server
55           is the name or IP address of the name server to query. This can be
56           an IPv4 address in dotted-decimal notation or an IPv6 address in
57           colon-delimited notation. When the supplied server argument is a
58           hostname, dig resolves that name before querying that name server.
59           If no server argument is provided, dig consults /etc/resolv.conf
60           and queries the name servers listed there. The reply from the name
61           server that responds is displayed.
62
63       name
64           is the name of the resource record that is to be looked up.
65
66       type
67           indicates what type of query is required — ANY, A, MX, SIG, etc.
68           type can be any valid query type. If no type argument is supplied,
69           dig will perform a lookup for an A record.
70

OPTIONS

72       The -b option sets the source IP address of the query to address. This
73       must be a valid address on one of the host´s network interfaces or
74       "0.0.0.0" or "::". An optional port may be specified by appending
75       "#<port>"
76
77       The default query class (IN for internet) is overridden by the -c
78       option.  class is any valid class, such as HS for Hesiod records or CH
79       for Chaosnet records.
80
81       The -f option makes dig operate in batch mode by reading a list of
82       lookup requests to process from the file filename. The file contains a
83       number of queries, one per line. Each entry in the file should be
84       organized in the same way they would be presented as queries to dig
85       using the command-line interface.
86
87       The -m option enables memory usage debugging.
88
89       If a non-standard port number is to be queried, the -p option is used.
90       port# is the port number that dig will send its queries instead of the
91       standard DNS port number 53. This option would be used to test a name
92       server that has been configured to listen for queries on a non-standard
93       port number.
94
95       The -4 option forces dig to only use IPv4 query transport. The -6
96       option forces dig to only use IPv6 query transport.
97
98       The -t option sets the query type to type. It can be any valid query
99       type which is supported in BIND 9. The default query type is "A",
100       unless the -x option is supplied to indicate a reverse lookup. A zone
101       transfer can be requested by specifying a type of AXFR. When an
102       incremental zone transfer (IXFR) is required, type is set to ixfr=N.
103       The incremental zone transfer will contain the changes made to the zone
104       since the serial number in the zone´s SOA record was N.
105
106       The -q option sets the query name to name. This useful do distinguish
107       the name from other arguments.
108
109       Reverse lookups — mapping addresses to names — are simplified by the -x
110       option.  addr is an IPv4 address in dotted-decimal notation, or a
111       colon-delimited IPv6 address. When this option is used, there is no
112       need to provide the name, class and type arguments.  dig automatically
113       performs a lookup for a name like 11.12.13.10.in-addr.arpa and sets the
114       query type and class to PTR and IN respectively. By default, IPv6
115       addresses are looked up using nibble format under the IP6.ARPA domain.
116       To use the older RFC1886 method using the IP6.INT domain specify the -i
117       option. Bit string labels (RFC2874) are now experimental and are not
118       attempted.
119
120       To sign the DNS queries sent by dig and their responses using
121       transaction signatures (TSIG), specify a TSIG key file using the -k
122       option. You can also specify the TSIG key itself on the command line
123       using the -y option; hmac is the type of the TSIG, default HMAC-MD5,
124       name is the name of the TSIG key and key is the actual key. The key is
125       a base-64 encoded string, typically generated by dnssec-keygen(8).
126       Caution should be taken when using the -y option on multi-user systems
127       as the key can be visible in the output from ps(1) or in the shell´s
128       history file. When using TSIG authentication with dig, the name server
129       that is queried needs to know the key and algorithm that is being used.
130       In BIND, this is done by providing appropriate key and server
131       statements in named.conf.
132

QUERY OPTIONS

134       dig provides a number of query options which affect the way in which
135       lookups are made and the results displayed. Some of these set or reset
136       flag bits in the query header, some determine which sections of the
137       answer get printed, and others determine the timeout and retry
138       strategies.
139
140       Each query option is identified by a keyword preceded by a plus sign
141       (+). Some keywords set or reset an option. These may be preceded by the
142       string no to negate the meaning of that keyword. Other keywords assign
143       values to options like the timeout interval. They have the form
144       +keyword=value. The query options are:
145
146       +[no]tcp
147           Use [do not use] TCP when querying name servers. The default
148           behavior is to use UDP unless an AXFR or IXFR query is requested,
149           in which case a TCP connection is used.
150
151       +[no]vc
152           Use [do not use] TCP when querying name servers. This alternate
153           syntax to +[no]tcp is provided for backwards compatibility. The
154           "vc" stands for "virtual circuit".
155
156       +[no]ignore
157           Ignore truncation in UDP responses instead of retrying with TCP. By
158           default, TCP retries are performed.
159
160       +domain=somename
161           Set the search list to contain the single domain somename, as if
162           specified in a domain directive in /etc/resolv.conf, and enable
163           search list processing as if the +search option were given.
164
165       +[no]search
166           Use [do not use] the search list defined by the searchlist or
167           domain directive in resolv.conf (if any). The search list is not
168           used by default.
169
170       +[no]showsearch
171           Perform [do not perform] a search showing intermediate results.
172
173       +[no]defname
174           Deprecated, treated as a synonym for +[no]search
175
176       +[no]aaonly
177           Sets the "aa" flag in the query.
178
179       +[no]aaflag
180           A synonym for +[no]aaonly.
181
182       +[no]adflag
183           Set [do not set] the AD (authentic data) bit in the query. This
184           requests the server to return whether all of the answer and
185           authority sections have all been validated as secure according to
186           the security policy of the server. AD=1 indicates that all records
187           have been validated as secure and the answer is not from a OPT-OUT
188           range. AD=0 indicate that some part of the answer was insecure or
189           not validated.
190
191       +[no]cdflag
192           Set [do not set] the CD (checking disabled) bit in the query. This
193           requests the server to not perform DNSSEC validation of responses.
194
195       +[no]cl
196           Display [do not display] the CLASS when printing the record.
197
198       +[no]ttlid
199           Display [do not display] the TTL when printing the record.
200
201       +[no]recurse
202           Toggle the setting of the RD (recursion desired) bit in the query.
203           This bit is set by default, which means dig normally sends
204           recursive queries. Recursion is automatically disabled when the
205           +nssearch or +trace query options are used.
206
207       +[no]nssearch
208           When this option is set, dig attempts to find the authoritative
209           name servers for the zone containing the name being looked up and
210           display the SOA record that each name server has for the zone.
211
212       +[no]trace
213           Toggle tracing of the delegation path from the root name servers
214           for the name being looked up. Tracing is disabled by default. When
215           tracing is enabled, dig makes iterative queries to resolve the name
216           being looked up. It will follow referrals from the root servers,
217           showing the answer from each server that was used to resolve the
218           lookup.
219
220       +[no]cmd
221           Toggles the printing of the initial comment in the output
222           identifying the version of dig and the query options that have been
223           applied. This comment is printed by default.
224
225       +[no]short
226           Provide a terse answer. The default is to print the answer in a
227           verbose form.
228
229       +[no]identify
230           Show [or do not show] the IP address and port number that supplied
231           the answer when the +short option is enabled. If short form answers
232           are requested, the default is not to show the source address and
233           port number of the server that provided the answer.
234
235       +[no]comments
236           Toggle the display of comment lines in the output. The default is
237           to print comments.
238
239       +[no]stats
240           This query option toggles the printing of statistics: when the
241           query was made, the size of the reply and so on. The default
242           behavior is to print the query statistics.
243
244       +[no]qr
245           Print [do not print] the query as it is sent. By default, the query
246           is not printed.
247
248       +[no]question
249           Print [do not print] the question section of a query when an answer
250           is returned. The default is to print the question section as a
251           comment.
252
253       +[no]answer
254           Display [do not display] the answer section of a reply. The default
255           is to display it.
256
257       +[no]authority
258           Display [do not display] the authority section of a reply. The
259           default is to display it.
260
261       +[no]additional
262           Display [do not display] the additional section of a reply. The
263           default is to display it.
264
265       +[no]all
266           Set or clear all display flags.
267
268       +time=T
269           Sets the timeout for a query to T seconds. The default timeout is 5
270           seconds. An attempt to set T to less than 1 will result in a query
271           timeout of 1 second being applied.
272
273       +tries=T
274           Sets the number of times to try UDP queries to server to T instead
275           of the default, 3. If T is less than or equal to zero, the number
276           of tries is silently rounded up to 1.
277
278       +retry=T
279           Sets the number of times to retry UDP queries to server to T
280           instead of the default, 2. Unlike +tries, this does not include the
281           initial query.
282
283       +ndots=D
284           Set the number of dots that have to appear in name to D for it to
285           be considered absolute. The default value is that defined using the
286           ndots statement in /etc/resolv.conf, or 1 if no ndots statement is
287           present. Names with fewer dots are interpreted as relative names
288           and will be searched for in the domains listed in the search or
289           domain directive in /etc/resolv.conf.
290
291       +bufsize=B
292           Set the UDP message buffer size advertised using EDNS0 to B bytes.
293           The maximum and minimum sizes of this buffer are 65535 and 0
294           respectively. Values outside this range are rounded up or down
295           appropriately. Values other than zero will cause a EDNS query to be
296           sent.
297
298       +edns=#
299           Specify the EDNS version to query with. Valid values are 0 to 255.
300           Setting the EDNS version will cause a EDNS query to be sent.
301           +noedns clears the remembered EDNS version.
302
303       +[no]multiline
304           Print records like the SOA records in a verbose multi-line format
305           with human-readable comments. The default is to print each record
306           on a single line, to facilitate machine parsing of the dig output.
307
308       +[no]onesoa
309           Print only one (starting) SOA record when performing an AXFR. The
310           default is to print both the starting and ending SOA records.
311
312       +[no]fail
313           Do not try the next server if you receive a SERVFAIL. The default
314           is to not try the next server which is the reverse of normal stub
315           resolver behavior.
316
317       +[no]besteffort
318           Attempt to display the contents of messages which are malformed.
319           The default is to not display malformed answers.
320
321       +[no]dnssec
322           Requests DNSSEC records be sent by setting the DNSSEC OK bit (DO)
323           in the OPT record in the additional section of the query.
324
325       +[no]sigchase
326           Chase DNSSEC signature chains. Requires dig be compiled with
327           -DDIG_SIGCHASE.
328
329       +trusted-key=####
330           Specifies a file containing trusted keys to be used with +sigchase.
331           Each DNSKEY record must be on its own line.
332
333           If not specified, dig will look for /etc/trusted-key.key then
334           trusted-key.key in the current directory.
335
336           Requires dig be compiled with -DDIG_SIGCHASE.
337
338       +[no]topdown
339           When chasing DNSSEC signature chains perform a top-down validation.
340           Requires dig be compiled with -DDIG_SIGCHASE.
341
342       +[no]nsid
343           Include an EDNS name server ID request when sending a query.
344

MULTIPLE QUERIES

346       The BIND 9 implementation of dig supports specifying multiple queries
347       on the command line (in addition to supporting the -f batch file
348       option). Each of those queries can be supplied with its own set of
349       flags, options and query options.
350
351       In this case, each query argument represent an individual query in the
352       command-line syntax described above. Each consists of any of the
353       standard options and flags, the name to be looked up, an optional query
354       type and class and any query options that should be applied to that
355       query.
356
357       A global set of query options, which should be applied to all queries,
358       can also be supplied. These global query options must precede the first
359       tuple of name, class, type, options, flags, and query options supplied
360       on the command line. Any global query options (except the +[no]cmd
361       option) can be overridden by a query-specific set of query options. For
362       example:
363
364           dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
365
366       shows how dig could be used from the command line to make three
367       lookups: an ANY query for www.isc.org, a reverse lookup of 127.0.0.1
368       and a query for the NS records of isc.org. A global query option of +qr
369       is applied, so that dig shows the initial query it made for each
370       lookup. The final query has a local query option of +noqr which means
371       that dig will not print the initial query when it looks up the NS
372       records for isc.org.
373

IDN SUPPORT

375       If dig has been built with IDN (internationalized domain name) support,
376       it can accept and display non-ASCII domain names.  dig appropriately
377       converts character encoding of domain name before sending a request to
378       DNS server or displaying a reply from the server. If you´d like to turn
379       off the IDN support for some reason, define the CHARSET=ASCII
380       environment variable. The IDN support is disabled if the variable is
381       set when dig runs.
382

RETURN CODES

384       Dig return codes are:
385
386           0: Everything went well, including things like NXDOMAIN
387
388           1: Usage error
389
390           8: Couldn´t open batch file
391
392           9: No reply from server
393
394           10: Internal error
395

FILES

397       /etc/resolv.conf
398
399       ${HOME}/.digrc
400

SEE ALSO

402       host(1), named(8), dnssec-keygen(8), RFC1035.
403

BUGS

405       There are probably too many query options.
406
408       Copyright © 2004-2010 Internet Systems Consortium, Inc. ("ISC")
409       Copyright © 2000-2003 Internet Software Consortium.
410
411
412
413BIND9                            Jun 30, 2000                           DIG(1)
Impressum