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