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