]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bind9/bin/dig/dig.1
This commit was generated by cvs2svn to compensate for changes in r153200,
[FreeBSD/FreeBSD.git] / contrib / bind9 / bin / dig / dig.1
1 .\" Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000-2003  Internet Software Consortium.
3 .\"
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\"
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 .\" AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 .\" PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .\" $Id: dig.1,v 1.14.2.4.2.6 2004/06/23 09:11:01 marka Exp $
17 .\"
18 .TH "DIG" "1" "Jun 30, 2000" "BIND9" ""
19 .SH NAME
20 dig \- DNS lookup utility
21 .SH SYNOPSIS
22 .sp
23 \fBdig\fR [ \fB@server\fR ]  [ \fB-b \fIaddress\fB\fR ]  [ \fB-c \fIclass\fB\fR ]  [ \fB-f \fIfilename\fB\fR ]  [ \fB-k \fIfilename\fB\fR ]  [ \fB-p \fIport#\fB\fR ]  [ \fB-t \fItype\fB\fR ]  [ \fB-x \fIaddr\fB\fR ]  [ \fB-y \fIname:key\fB\fR ]  [ \fB-4\fR ]  [ \fB-6\fR ]  [ \fBname\fR ]  [ \fBtype\fR ]  [ \fBclass\fR ]  [ \fBqueryopt\fR\fI...\fR ] 
24 .sp
25 \fBdig\fR [ \fB-h\fR ] 
26 .sp
27 \fBdig\fR [ \fBglobal-queryopt\fR\fI...\fR ]  [ \fBquery\fR\fI...\fR ] 
28 .SH "DESCRIPTION"
29 .PP
30 \fBdig\fR (domain information groper) is a flexible tool
31 for interrogating DNS name servers. It performs DNS lookups and
32 displays the answers that are returned from the name server(s) that
33 were queried. Most DNS administrators use \fBdig\fR to
34 troubleshoot DNS problems because of its flexibility, ease of use and
35 clarity of output. Other lookup tools tend to have less functionality
36 than \fBdig\fR.
37 .PP
38 Although \fBdig\fR is normally used with command-line
39 arguments, it also has a batch mode of operation for reading lookup
40 requests from a file. A brief summary of its command-line arguments
41 and options is printed when the \fB-h\fR option is given.
42 Unlike earlier versions, the BIND9 implementation of
43 \fBdig\fR allows multiple lookups to be issued from the
44 command line.
45 .PP
46 Unless it is told to query a specific name server,
47 \fBdig\fR will try each of the servers listed in
48 \fI/etc/resolv.conf\fR.
49 .PP
50 When no command line arguments or options are given, will perform an
51 NS query for "." (the root).
52 .PP
53 It is possible to set per-user defaults for \fBdig\fR via
54 \fI${HOME}/.digrc\fR. This file is read and any options in it
55 are applied before the command line arguments.
56 .SH "SIMPLE USAGE"
57 .PP
58 A typical invocation of \fBdig\fR looks like:
59 .sp
60 .nf
61  dig @server name type 
62 .sp
63 .fi
64 where:
65 .TP
66 \fBserver\fR
67 is the name or IP address of the name server to query. This can be an IPv4
68 address in dotted-decimal notation or an IPv6
69 address in colon-delimited notation. When the supplied
70 \fIserver\fR argument is a hostname,
71 \fBdig\fR resolves that name before querying that name
72 server. If no \fIserver\fR argument is provided,
73 \fBdig\fR consults \fI/etc/resolv.conf\fR
74 and queries the name servers listed there. The reply from the name
75 server that responds is displayed.
76 .TP
77 \fBname\fR
78 is the name of the resource record that is to be looked up.
79 .TP
80 \fBtype\fR
81 indicates what type of query is required \(em
82 ANY, A, MX, SIG, etc.
83 \fItype\fR can be any valid query type. If no
84 \fItype\fR argument is supplied,
85 \fBdig\fR will perform a lookup for an A record.
86 .SH "OPTIONS"
87 .PP
88 The \fB-b\fR option sets the source IP address of the query
89 to \fIaddress\fR. This must be a valid address on
90 one of the host's network interfaces or "0.0.0.0" or "::". An optional port
91 may be specified by appending "#<port>"
92 .PP
93 The default query class (IN for internet) is overridden by the
94 \fB-c\fR option. \fIclass\fR is any valid
95 class, such as HS for Hesiod records or CH for CHAOSNET records.
96 .PP
97 The \fB-f\fR option makes \fBdig \fR operate
98 in batch mode by reading a list of lookup requests to process from the
99 file \fIfilename\fR. The file contains a number of
100 queries, one per line. Each entry in the file should be organised in
101 the same way they would be presented as queries to
102 \fBdig\fR using the command-line interface.
103 .PP
104 If a non-standard port number is to be queried, the
105 \fB-p\fR option is used. \fIport#\fR is
106 the port number that \fBdig\fR will send its queries
107 instead of the standard DNS port number 53. This option would be used
108 to test a name server that has been configured to listen for queries
109 on a non-standard port number.
110 .PP
111 The \fB-4\fR option forces \fBdig\fR to only
112 use IPv4 query transport. The \fB-6\fR option forces
113 \fBdig\fR to only use IPv6 query transport.
114 .PP
115 The \fB-t\fR option sets the query type to
116 \fItype\fR. It can be any valid query type which is
117 supported in BIND9. The default query type "A", unless the
118 \fB-x\fR option is supplied to indicate a reverse lookup.
119 A zone transfer can be requested by specifying a type of AXFR. When
120 an incremental zone transfer (IXFR) is required,
121 \fItype\fR is set to ixfr=N.
122 The incremental zone transfer will contain the changes made to the zone
123 since the serial number in the zone's SOA record was
124 \fIN\fR.
125 .PP
126 Reverse lookups - mapping addresses to names - are simplified by the
127 \fB-x\fR option. \fIaddr\fR is an IPv4
128 address in dotted-decimal notation, or a colon-delimited IPv6 address.
129 When this option is used, there is no need to provide the
130 \fIname\fR, \fIclass\fR and
131 \fItype\fR arguments. \fBdig\fR
132 automatically performs a lookup for a name like
133 11.12.13.10.in-addr.arpa and sets the query type and
134 class to PTR and IN respectively. By default, IPv6 addresses are
135 looked up using nibble format under the IP6.ARPA domain.
136 To use the older RFC1886 method using the IP6.INT domain 
137 specify the \fB-i\fR option. Bit string labels (RFC2874)
138 are now experimental and are not attempted.
139 .PP
140 To sign the DNS queries sent by \fBdig\fR and their
141 responses using transaction signatures (TSIG), specify a TSIG key file
142 using the \fB-k\fR option. You can also specify the TSIG
143 key itself on the command line using the \fB-y\fR option;
144 \fIname\fR is the name of the TSIG key and
145 \fIkey\fR is the actual key. The key is a base-64
146 encoded string, typically generated by \fBdnssec-keygen\fR(8).
147 Caution should be taken when using the \fB-y\fR option on
148 multi-user systems as the key can be visible in the output from
149 \fBps\fR(1) or in the shell's history file. When
150 using TSIG authentication with \fBdig\fR, the name
151 server that is queried needs to know the key and algorithm that is
152 being used. In BIND, this is done by providing appropriate
153 \fBkey\fR and \fBserver\fR statements in
154 \fInamed.conf\fR.
155 .SH "QUERY OPTIONS"
156 .PP
157 \fBdig\fR provides a number of query options which affect
158 the way in which lookups are made and the results displayed. Some of
159 these set or reset flag bits in the query header, some determine which
160 sections of the answer get printed, and others determine the timeout
161 and retry strategies.
162 .PP
163 Each query option is identified by a keyword preceded by a plus sign
164 (+). Some keywords set or reset an option. These may be preceded
165 by the string no to negate the meaning of that keyword. Other
166 keywords assign values to options like the timeout interval. They
167 have the form \fB+keyword=value\fR.
168 The query options are:
169 .TP
170 \fB+[no]tcp\fR
171 Use [do not use] TCP when querying name servers. The default
172 behaviour is to use UDP unless an AXFR or IXFR query is requested, in
173 which case a TCP connection is used.
174 .TP
175 \fB+[no]vc\fR
176 Use [do not use] TCP when querying name servers. This alternate
177 syntax to \fI+[no]tcp\fR is provided for backwards
178 compatibility. The "vc" stands for "virtual circuit".
179 .TP
180 \fB+[no]ignore\fR
181 Ignore truncation in UDP responses instead of retrying with TCP. By
182 default, TCP retries are performed.
183 .TP
184 \fB+domain=somename\fR
185 Set the search list to contain the single domain
186 \fIsomename\fR, as if specified in a
187 \fBdomain\fR directive in
188 \fI/etc/resolv.conf\fR, and enable search list
189 processing as if the \fI+search\fR option were given.
190 .TP
191 \fB+[no]search\fR
192 Use [do not use] the search list defined by the searchlist or domain
193 directive in \fIresolv.conf\fR (if any).
194 The search list is not used by default.
195 .TP
196 \fB+[no]defname\fR
197 Deprecated, treated as a synonym for \fI+[no]search\fR
198 .TP
199 \fB+[no]aaonly\fR
200 Sets the "aa" flag in the query.
201 .TP
202 \fB+[no]aaflag\fR
203 A synonym for \fI+[no]aaonly\fR.
204 .TP
205 \fB+[no]adflag\fR
206 Set [do not set] the AD (authentic data) bit in the query. The AD bit
207 currently has a standard meaning only in responses, not in queries,
208 but the ability to set the bit in the query is provided for
209 completeness.
210 .TP
211 \fB+[no]cdflag\fR
212 Set [do not set] the CD (checking disabled) bit in the query. This
213 requests the server to not perform DNSSEC validation of responses.
214 .TP
215 \fB+[no]cl\fR
216 Display [do not display] the CLASS when printing the record.
217 .TP
218 \fB+[no]ttlid\fR
219 Display [do not display] the TTL when printing the record.
220 .TP
221 \fB+[no]recurse\fR
222 Toggle the setting of the RD (recursion desired) bit in the query.
223 This bit is set by default, which means \fBdig\fR
224 normally sends recursive queries. Recursion is automatically disabled
225 when the \fI+nssearch\fR or
226 \fI+trace\fR query options are used.
227 .TP
228 \fB+[no]nssearch\fR
229 When this option is set, \fBdig\fR attempts to find the
230 authoritative name servers for the zone containing the name being
231 looked up and display the SOA record that each name server has for the
232 zone.
233 .TP
234 \fB+[no]trace\fR
235 Toggle tracing of the delegation path from the root name servers for
236 the name being looked up. Tracing is disabled by default. When
237 tracing is enabled, \fBdig\fR makes iterative queries to
238 resolve the name being looked up. It will follow referrals from the
239 root servers, showing the answer from each server that was used to
240 resolve the lookup.
241 .TP
242 \fB+[no]cmd\fR
243 toggles the printing of the initial comment in the output identifying
244 the version of \fBdig\fR and the query options that have
245 been applied. This comment is printed by default.
246 .TP
247 \fB+[no]short\fR
248 Provide a terse answer. The default is to print the answer in a
249 verbose form.
250 .TP
251 \fB+[no]identify\fR
252 Show [or do not show] the IP address and port number that supplied the
253 answer when the \fI+short\fR option is enabled. If
254 short form answers are requested, the default is not to show the
255 source address and port number of the server that provided the answer.
256 .TP
257 \fB+[no]comments\fR
258 Toggle the display of comment lines in the output. The default is to
259 print comments.
260 .TP
261 \fB+[no]stats\fR
262 This query option toggles the printing of statistics: when the query
263 was made, the size of the reply and so on. The default behaviour is
264 to print the query statistics.
265 .TP
266 \fB+[no]qr\fR
267 Print [do not print] the query as it is sent.
268 By default, the query is not printed.
269 .TP
270 \fB+[no]question\fR
271 Print [do not print] the question section of a query when an answer is
272 returned. The default is to print the question section as a comment.
273 .TP
274 \fB+[no]answer\fR
275 Display [do not display] the answer section of a reply. The default
276 is to display it.
277 .TP
278 \fB+[no]authority\fR
279 Display [do not display] the authority section of a reply. The
280 default is to display it.
281 .TP
282 \fB+[no]additional\fR
283 Display [do not display] the additional section of a reply.
284 The default is to display it.
285 .TP
286 \fB+[no]all\fR
287 Set or clear all display flags.
288 .TP
289 \fB+time=T\fR
290 Sets the timeout for a query to
291 \fIT\fR seconds. The default time out is 5 seconds.
292 An attempt to set \fIT\fR to less than 1 will result
293 in a query timeout of 1 second being applied.
294 .TP
295 \fB+tries=T\fR
296 Sets the number of times to try UDP queries to server to
297 \fIT\fR instead of the default, 3. If
298 \fIT\fR is less than or equal to zero, the number of
299 tries is silently rounded up to 1.
300 .TP
301 \fB+retry=T\fR
302 Sets the number of times to retry UDP queries to server to
303 \fIT\fR instead of the default, 2. Unlike
304 \fI+tries\fR, this does not include the initial
305 query.
306 .TP
307 \fB+ndots=D\fR
308 Set the number of dots that have to appear in
309 \fIname\fR to \fID\fR for it to be
310 considered absolute. The default value is that defined using the
311 ndots statement in \fI/etc/resolv.conf\fR, or 1 if no
312 ndots statement is present. Names with fewer dots are interpreted as
313 relative names and will be searched for in the domains listed in the
314 \fBsearch\fR or \fBdomain\fR directive in
315 \fI/etc/resolv.conf\fR.
316 .TP
317 \fB+bufsize=B\fR
318 Set the UDP message buffer size advertised using EDNS0 to
319 \fIB\fR bytes. The maximum and minimum sizes of this
320 buffer are 65535 and 0 respectively. Values outside this range are
321 rounded up or down appropriately.
322 .TP
323 \fB+[no]multiline\fR
324 Print records like the SOA records in a verbose multi-line
325 format with human-readable comments. The default is to print
326 each record on a single line, to facilitate machine parsing 
327 of the \fBdig\fR output.
328 .TP
329 \fB+[no]fail\fR
330 Do not try the next server if you receive a SERVFAIL. The default is
331 to not try the next server which is the reverse of normal stub resolver
332 behaviour.
333 .TP
334 \fB+[no]besteffort\fR
335 Attempt to display the contents of messages which are malformed.
336 The default is to not display malformed answers.
337 .TP
338 \fB+[no]dnssec\fR
339 Requests DNSSEC records be sent by setting the DNSSEC OK bit (DO)
340 in the OPT record in the additional section of the query.
341 .TP
342 \fB+[no]sigchase\fR
343 Chase DNSSEC signature chains. Requires dig be compiled with
344 -DDIG_SIGCHASE.
345 .TP
346 \fB+trusted-key=####\fR
347 Specify a trusted key to be used with \fB+sigchase\fR.
348 Requires dig be compiled with -DDIG_SIGCHASE.
349 .TP
350 \fB+[no]topdown\fR
351 When chasing DNSSEC signature chains perform a top down validation.
352 Requires dig be compiled with -DDIG_SIGCHASE.
353 .SH "MULTIPLE QUERIES"
354 .PP
355 The BIND 9 implementation of \fBdig \fR supports
356 specifying multiple queries on the command line (in addition to
357 supporting the \fB-f\fR batch file option). Each of those
358 queries can be supplied with its own set of flags, options and query
359 options.
360 .PP
361 In this case, each \fIquery\fR argument represent an
362 individual query in the command-line syntax described above. Each
363 consists of any of the standard options and flags, the name to be
364 looked up, an optional query type and class and any query options that
365 should be applied to that query.
366 .PP
367 A global set of query options, which should be applied to all queries,
368 can also be supplied. These global query options must precede the
369 first tuple of name, class, type, options, flags, and query options
370 supplied on the command line. Any global query options (except
371 the \fB+[no]cmd\fR option) can be
372 overridden by a query-specific set of query options. For example:
373 .sp
374 .nf
375 dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
376 .sp
377 .fi
378 shows how \fBdig\fR could be used from the command line
379 to make three lookups: an ANY query for www.isc.org, a
380 reverse lookup of 127.0.0.1 and a query for the NS records of
381 isc.org.
382 A global query option of \fI+qr\fR is applied, so
383 that \fBdig\fR shows the initial query it made for each
384 lookup. The final query has a local query option of
385 \fI+noqr\fR which means that \fBdig\fR
386 will not print the initial query when it looks up the NS records for
387 isc.org.
388 .SH "FILES"
389 .PP
390 \fI/etc/resolv.conf\fR
391 .PP
392 \fI${HOME}/.digrc\fR
393 .SH "SEE ALSO"
394 .PP
395 \fBhost\fR(1),
396 \fBnamed\fR(8),
397 \fBdnssec-keygen\fR(8),
398 \fIRFC1035\fR.
399 .SH "BUGS"
400 .PP
401 There are probably too many query options.