man.dig.html revision d8620c7234281056fdfd2ee40cf16636b8281092
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews - 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
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews - copyright notice and this permission notice appear in all copies.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
83a28ca274521e15086fc39febde507bcc4e145eMark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - PERFORMANCE OF THIS SOFTWARE.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<!-- $Id$ -->
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<link rel="up" href="Bv9ARM.ch10.html" title="Manual pages">
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<link rel="prev" href="Bv9ARM.ch10.html" title="Manual pages">
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<link rel="next" href="man.host.html" title="host">
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<table width="100%" summary="Navigation header">
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<tr><th colspan="3" align="center">dig</th></tr>
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox User<a accesskey="p" href="Bv9ARM.ch10.html">Prev</a>�</td>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<th width="60%" align="center">Manual pages</th>
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<td width="20%" align="right">�<a accesskey="n" href="man.host.html">Next</a>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<a name="man.dig"></a><div class="titlepage"></div>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<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">-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>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<div class="cmdsynopsis"><p><code class="command">dig</code> [<code class="option">-h</code>]</p></div>
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews<p><span><strong class="command">dig</strong></span>
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews (domain information groper) is a flexible tool
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews for interrogating DNS name servers. It performs DNS lookups and
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews displays the answers that are returned from the name server(s) that
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews were queried. Most DNS administrators use <span><strong class="command">dig</strong></span> to
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews troubleshoot DNS problems because of its flexibility, ease of use and
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt clarity of output. Other lookup tools tend to have less functionality
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews than <span><strong class="command">dig</strong></span>.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews Although <span><strong class="command">dig</strong></span> is normally used with
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews command-line
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews arguments, it also has a batch mode of operation for reading lookup
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews requests from a file. A brief summary of its command-line arguments
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews and options is printed when the <code class="option">-h</code> option is given.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews Unlike earlier versions, the BIND 9 implementation of
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <span><strong class="command">dig</strong></span> allows multiple lookups to be issued
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews command line.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt Unless it is told to query a specific name server,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt <span><strong class="command">dig</strong></span> will try each of the servers listed in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt <code class="filename">/etc/resolv.conf</code>. If no usable server addreses
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt are found, <span><strong class="command">dig</strong></span> will send the query to the local
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt When no command line arguments or options are given,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt <span><strong class="command">dig</strong></span> will perform an NS query for "." (the root).
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt It is possible to set per-user defaults for <span><strong class="command">dig</strong></span> via
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt <code class="filename">${HOME}/.digrc</code>. This file is read and
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt any options in it
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt are applied before the command line arguments.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews The IN and CH class names overlap with the IN and CH top level
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews domains names. Either use the <code class="option">-t</code> and
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <code class="option">-c</code> options to specify the type and class,
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews use the <code class="option">-q</code> the specify the domain name, or
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews use "IN." and "CH." when looking up these top level domains.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews A typical invocation of <span><strong class="command">dig</strong></span> looks like:
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<pre class="programlisting"> dig @server name type </pre>
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<dt><span class="term"><code class="constant">server</code></span></dt>
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews is the name or IP address of the name server to query. This
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews can be an IPv4 address in dotted-decimal notation or an IPv6
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews address in colon-delimited notation. When the supplied
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <em class="parameter"><code>server</code></em> argument is a hostname,
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <span><strong class="command">dig</strong></span> resolves that name before querying
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews that name server.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews If no <em class="parameter"><code>server</code></em> argument is
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews provided, <span><strong class="command">dig</strong></span> consults
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <code class="filename">/etc/resolv.conf</code>; if an
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews address is found there, it queries the name server at
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews that address. If either of the <code class="option">-4</code> or
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <code class="option">-6</code> options are in use, then
42782931073786f98d3d0a617351db40066949a4Mukund Sivaraman only addresses for the corresponding transport
42782931073786f98d3d0a617351db40066949a4Mukund Sivaraman will be tried. If no usable addresses are found,
42782931073786f98d3d0a617351db40066949a4Mukund Sivaraman <span><strong class="command">dig</strong></span> will send the query to the
42782931073786f98d3d0a617351db40066949a4Mukund Sivaraman local host. The reply from the name server that
42782931073786f98d3d0a617351db40066949a4Mukund Sivaraman responds is displayed.
42782931073786f98d3d0a617351db40066949a4Mukund Sivaraman<dt><span class="term"><code class="constant">name</code></span></dt>
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews is the name of the resource record that is to be looked up.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews<dt><span class="term"><code class="constant">type</code></span></dt>
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews indicates what type of query is required —
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews ANY, A, MX, SIG, etc.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <em class="parameter"><code>type</code></em> can be any valid query
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <em class="parameter"><code>type</code></em> argument is supplied,
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <span><strong class="command">dig</strong></span> will perform a lookup for an
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews The <code class="option">-b</code> option sets the source IP address of the query
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews to <em class="parameter"><code>address</code></em>. This must be a valid
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews one of the host's network interfaces or "0.0.0.0" or "::". An optional
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews may be specified by appending "#<port>"
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews The default query class (IN for internet) is overridden by the
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <code class="option">-c</code> option. <em class="parameter"><code>class</code></em> is
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews class, such as HS for Hesiod records or CH for Chaosnet records.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews The <code class="option">-f</code> option makes <span><strong class="command">dig </strong></span>
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews in batch mode by reading a list of lookup requests to process from the
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews file <em class="parameter"><code>filename</code></em>. The file contains a
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews queries, one per line. Each entry in the file should be organized in
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews the same way they would be presented as queries to
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <span><strong class="command">dig</strong></span> using the command-line interface.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews The <code class="option">-m</code> option enables memory usage debugging.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt If a non-standard port number is to be queried, the
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <code class="option">-p</code> option is used. <em class="parameter"><code>port#</code></em> is
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt the port number that <span><strong class="command">dig</strong></span> will send its
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews instead of the standard DNS port number 53. This option would be used
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews to test a name server that has been configured to listen for queries
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews on a non-standard port number.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews The <code class="option">-4</code> option forces <span><strong class="command">dig</strong></span>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt use IPv4 query transport. The <code class="option">-6</code> option forces
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews <span><strong class="command">dig</strong></span> to only use IPv6 query transport.
<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
<em class="parameter"><code>name</code></em> to <em class="parameter"><code>D</code></em> for it to be