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