dig.html revision d9f0b06dc2bba47e3fe63afdf41c638d3517ceff
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley - Copyright (C) 2004-2011, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
93ca8abdf86dfe69d40c0bc5389151e0672780afTinderbox User - Copyright (C) 2000-2003 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - copyright notice and this permission notice appear in all copies.
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt - PERFORMANCE OF THIS SOFTWARE.
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<a name="man.dig"></a><div class="titlepage"></div>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<div class="cmdsynopsis"><p><code class="command">dig</code> [@server] [<code class="option">-b <em class="replaceable"><code>address</code></em></code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-f <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-k <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-m</code>] [<code class="option">-p <em class="replaceable"><code>port#</code></em></code>] [<code class="option">-q <em class="replaceable"><code>name</code></em></code>] [<code class="option">-t <em class="replaceable"><code>type</code></em></code>] [<code class="option">-v</code>] [<code class="option">-x <em class="replaceable"><code>addr</code></em></code>] [<code class="option">-y <em class="replaceable"><code>[<span class="optional">hmac:</span>]name:key</code></em></code>] [<code class="option">-4</code>] [<code class="option">-6</code>] [name] [type] [class] [queryopt...]</p></div>
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt<div class="cmdsynopsis"><p><code class="command">dig</code> [<code class="option">-h</code>]</p></div>
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt<p><span><strong class="command">dig</strong></span>
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt (domain information groper) is a flexible tool
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt for interrogating DNS name servers. It performs DNS lookups and
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt displays the answers that are returned from the name server(s) that
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt were queried. Most DNS administrators use <span><strong class="command">dig</strong></span> to
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence troubleshoot DNS problems because of its flexibility, ease of use and
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence clarity of output. Other lookup tools tend to have less functionality
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews than <span><strong class="command">dig</strong></span>.
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews Although <span><strong class="command">dig</strong></span> is normally used with
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews command-line
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews arguments, it also has a batch mode of operation for reading lookup
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews requests from a file. A brief summary of its command-line arguments
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence and options is printed when the <code class="option">-h</code> option is given.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley Unlike earlier versions, the BIND 9 implementation of
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence <span><strong class="command">dig</strong></span> allows multiple lookups to be issued
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt command line.
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews Unless it is told to query a specific name server,
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews <span><strong class="command">dig</strong></span> will try each of the servers listed in
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews <code class="filename">/etc/resolv.conf</code>. If no usable server addresses
12a3ab37fe6556406acdf92fc7c5f198d603ca2eMark Andrews are found, <span><strong class="command">dig</strong></span> will send the query to the local
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews When no command line arguments or options are given,
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <span><strong class="command">dig</strong></span> will perform an NS query for "." (the root).
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews It is possible to set per-user defaults for <span><strong class="command">dig</strong></span> via
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence <code class="filename">${HOME}/.digrc</code>. This file is read and
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews any options in it
2d9bd38ec3fbbfe920757b8972d94f664a9b354bMark Andrews are applied before the command line arguments.
ebb4655236b95b36982d999800497d2dd3096a7fMark Andrews The IN and CH class names overlap with the IN and CH top level
ebb4655236b95b36982d999800497d2dd3096a7fMark Andrews domain names. Either use the <code class="option">-t</code> and
ebb4655236b95b36982d999800497d2dd3096a7fMark Andrews <code class="option">-c</code> options to specify the type and class,
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews use the <code class="option">-q</code> the specify the domain name, or
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence use "IN." and "CH." when looking up these top level domains.
9e5854255178c04170bc98839282d4cf3fae7443Mark Andrews A typical invocation of <span><strong class="command">dig</strong></span> looks like:
f7a6d4f915ce622d988916397f313b33ae954afcMark Andrews<pre class="programlisting"> dig @server name type </pre>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<dt><span class="term"><code class="constant">server</code></span></dt>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence is the name or IP address of the name server to query. This
c32b87bc54abacf95fb3b063d72b7d1855c1643bMichael Graff can be an IPv4 address in dotted-decimal notation or an IPv6
7f9f8c13c5e5e26e0ba2b82c0900d11ecf6269ceMark Andrews address in colon-delimited notation. When the supplied
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence <em class="parameter"><code>server</code></em> argument is a hostname,
c3e6fbe4b7471d843d015e3f1737b7edb9d0c547Mark Andrews <span><strong class="command">dig</strong></span> resolves that name before querying
c3e6fbe4b7471d843d015e3f1737b7edb9d0c547Mark Andrews that name server.
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence If no <em class="parameter"><code>server</code></em> argument is
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence provided, <span><strong class="command">dig</strong></span> consults
fe9b24391db337a7ff2845f89a932ae82ebef5ecMark Andrews <code class="filename">/etc/resolv.conf</code>; if an
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews address is found there, it queries the name server at
9514777adda314e7db802fc139ac42332e54baa9Mark Andrews that address. If either of the <code class="option">-4</code> or
5e47b4200ed81b8e18e165fe3a626d9992003db4Mark Andrews <code class="option">-6</code> options are in use, then
5e47b4200ed81b8e18e165fe3a626d9992003db4Mark Andrews only addresses for the corresponding transport
5e47b4200ed81b8e18e165fe3a626d9992003db4Mark Andrews will be tried. If no usable addresses are found,
5e47b4200ed81b8e18e165fe3a626d9992003db4Mark Andrews <span><strong class="command">dig</strong></span> will send the query to the
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley local host. The reply from the name server that
2320f230995995595438a9d9301d84931fd266ceMark Andrews responds is displayed.
620a452ebe92fff63e85c5930a6e6dc8d9455918Mark Andrews<dt><span class="term"><code class="constant">name</code></span></dt>
6dcb47e37f9f0cdb94bdabc3fa157ff07983c590Mark Andrews is the name of the resource record that is to be looked up.
2c4c405aeb7d3900ec2d4e4de888d47eae04ff82Mark Andrews<dt><span class="term"><code class="constant">type</code></span></dt>
43b3337ba58d70ca34f4d91e8c6c5e13a54af690Mark Andrews indicates what type of query is required —
f10370fd44f05fecc808d89c01b2d50df2b232f3Mark Andrews ANY, A, MX, SIG, etc.
f10370fd44f05fecc808d89c01b2d50df2b232f3Mark Andrews <em class="parameter"><code>type</code></em> can be any valid query
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews <em class="parameter"><code>type</code></em> argument is supplied,
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews <span><strong class="command">dig</strong></span> will perform a lookup for an
66c9805347f24da946c17a881e489ffe2e89c25dMark Andrews The <code class="option">-b</code> option sets the source IP address of the query
4c6bf2d14ee70f1966d4c18475f93211fbc928e1Mark Andrews to <em class="parameter"><code>address</code></em>. This must be a valid
66c9805347f24da946c17a881e489ffe2e89c25dMark Andrews one of the host's network interfaces or "0.0.0.0" or "::". An optional
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley may be specified by appending "#<port>"
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley The default query class (IN for internet) is overridden by the
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <code class="option">-c</code> option. <em class="parameter"><code>class</code></em> is
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews class, such as HS for Hesiod records or CH for Chaosnet records.
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews The <code class="option">-f</code> option makes <span><strong class="command">dig </strong></span>
a9558a6c63d9c6dbb2f3800b39ccb008652fcde3Mark Andrews in batch mode by reading a list of lookup requests to process from the
a9558a6c63d9c6dbb2f3800b39ccb008652fcde3Mark Andrews file <em class="parameter"><code>filename</code></em>. The file contains a
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews queries, one per line. Each entry in the file should be organized in
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews the same way they would be presented as queries to
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrence <span><strong class="command">dig</strong></span> using the command-line interface.
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt The <code class="option">-m</code> option enables memory usage debugging.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley If a non-standard port number is to be queried, the
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <code class="option">-p</code> option is used. <em class="parameter"><code>port#</code></em> is
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt the port number that <span><strong class="command">dig</strong></span> will send its
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley instead of the standard DNS port number 53. This option would be used
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley to test a name server that has been configured to listen for queries
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt on a non-standard port number.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley The <code class="option">-4</code> option forces <span><strong class="command">dig</strong></span>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley use IPv4 query transport. The <code class="option">-6</code> option forces
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt <span><strong class="command">dig</strong></span> to only use IPv6 query transport.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley The <code class="option">-t</code> option sets the query type to
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <em class="parameter"><code>type</code></em>. It can be any valid query type
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley supported in BIND 9. The default query type is "A", unless the
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <code class="option">-x</code> option is supplied to indicate a reverse lookup.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley A zone transfer can be requested by specifying a type of AXFR. When
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley an incremental zone transfer (IXFR) is required,
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley <em class="parameter"><code>type</code></em> is set to <code class="literal">ixfr=N</code>.
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt The incremental zone transfer will contain the changes made to the zone
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley since the serial number in the zone's SOA record was
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt The <code class="option">-q</code> option sets the query name to
18483fce5b9d1e02748bdcb916014cedea654f78Mark Andrews <em class="parameter"><code>name</code></em>. This is useful to distinguish the
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt <em class="parameter"><code>name</code></em> from other arguments.
<em class="parameter"><code>type</code></em> arguments. <span><strong class="command">dig</strong></span>
looked up using nibble format under the IP6.ARPA domain.
To use the older RFC1886 method using the IP6.INT domain
<span><strong class="command">key</strong></span> and <span><strong class="command">server</strong></span> statements in
e.g. "[ key id = value ]".
<dt><span class="term"><code class="option">+[no]sit[<span class="optional">=####</span>]</code></span></dt>