man.dig.html revision 233da446071f469f0f2fc175a460b2f1f8ef36cc
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - Copyright (C) 2004-2015 Internet Systems Consortium, Inc. ("ISC")
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - Copyright (C) 2000-2003 Internet Software Consortium.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - Permission to use, copy, modify, and/or distribute this software for any
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - purpose with or without fee is hereby granted, provided that the above
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - copyright notice and this permission notice appear in all copies.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync - PERFORMANCE OF THIS SOFTWARE.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<!-- $Id$ -->
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<link rel="up" href="Bv9ARM.ch13.html" title="Manual pages">
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<link rel="prev" href="Bv9ARM.ch13.html" title="Manual pages">
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<a accesskey="p" href="Bv9ARM.ch13.html">Prev</a>�</td>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<td width="20%" align="right">�<a accesskey="n" href="man.host.html">Next</a>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<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>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<div class="cmdsynopsis"><p><code class="command">dig</code> [<code class="option">-h</code>]</p></div>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<p><span><strong class="command">dig</strong></span>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync (domain information groper) is a flexible tool
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync for interrogating DNS name servers. It performs DNS lookups and
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync displays the answers that are returned from the name server(s) that
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync were queried. Most DNS administrators use <span><strong class="command">dig</strong></span> to
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync troubleshoot DNS problems because of its flexibility, ease of use and
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync clarity of output. Other lookup tools tend to have less functionality
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync than <span><strong class="command">dig</strong></span>.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Although <span><strong class="command">dig</strong></span> is normally used with
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync command-line
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync arguments, it also has a batch mode of operation for reading lookup
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync requests from a file. A brief summary of its command-line arguments
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync and options is printed when the <code class="option">-h</code> option is given.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Unlike earlier versions, the BIND 9 implementation of
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <span><strong class="command">dig</strong></span> allows multiple lookups to be issued
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync command line.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Unless it is told to query a specific name server,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <span><strong class="command">dig</strong></span> will try each of the servers listed in
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <code class="filename">/etc/resolv.conf</code>. If no usable server addresses
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync are found, <span><strong class="command">dig</strong></span> will send the query to the local
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync When no command line arguments or options are given,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <span><strong class="command">dig</strong></span> will perform an NS query for "." (the root).
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync It is possible to set per-user defaults for <span><strong class="command">dig</strong></span> via
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <code class="filename">${HOME}/.digrc</code>. This file is read and
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync any options in it
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync are applied before the command line arguments.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync The IN and CH class names overlap with the IN and CH top level
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync domain names. Either use the <code class="option">-t</code> and
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <code class="option">-c</code> options to specify the type and class,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync use the <code class="option">-q</code> the specify the domain name, or
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync use "IN." and "CH." when looking up these top level domains.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync A typical invocation of <span><strong class="command">dig</strong></span> looks like:
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<pre class="programlisting"> dig @server name type </pre>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<dt><span class="term"><code class="constant">server</code></span></dt>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync is the name or IP address of the name server to query. This
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync can be an IPv4 address in dotted-decimal notation or an IPv6
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync address in colon-delimited notation. When the supplied
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <em class="parameter"><code>server</code></em> argument is a hostname,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <span><strong class="command">dig</strong></span> resolves that name before querying
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync that name server.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync If no <em class="parameter"><code>server</code></em> argument is
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync provided, <span><strong class="command">dig</strong></span> consults
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <code class="filename">/etc/resolv.conf</code>; if an
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync address is found there, it queries the name server at
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync that address. If either of the <code class="option">-4</code> or
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <code class="option">-6</code> options are in use, then
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync only addresses for the corresponding transport
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync will be tried. If no usable addresses are found,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <span><strong class="command">dig</strong></span> will send the query to the
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync local host. The reply from the name server that
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync responds is displayed.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<dt><span class="term"><code class="constant">name</code></span></dt>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync is the name of the resource record that is to be looked up.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<dt><span class="term"><code class="constant">type</code></span></dt>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync indicates what type of query is required —
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync ANY, A, MX, SIG, etc.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <em class="parameter"><code>type</code></em> can be any valid query
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync type. If no
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <em class="parameter"><code>type</code></em> argument is supplied,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <span><strong class="command">dig</strong></span> will perform a lookup for an
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Use IPv4 only.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Use IPv6 only.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<dt><span class="term">-b <em class="replaceable"><code>address[<span class="optional">#port</span>]</code></em></span></dt>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Set the source IP address of the query.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync The <em class="parameter"><code>address</code></em> must be a valid address on
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync one of the host's network interfaces, or "0.0.0.0" or "::". An
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync optional port may be specified by appending "#<port>"
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<dt><span class="term">-c <em class="replaceable"><code>class</code></em></span></dt>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Set the query class. The
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync default <em class="parameter"><code>class</code></em> is IN; other classes
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync are HS for Hesiod records or CH for Chaosnet records.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<dt><span class="term">-f <em class="replaceable"><code>file</code></em></span></dt>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Batch mode: <span><strong class="command">dig</strong></span> reads a list of lookup
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync requests to process from the
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync given <em class="parameter"><code>file</code></em>. Each line in the file
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync should be organized in the same way they would be
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync presented as queries to
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <span><strong class="command">dig</strong></span> using the command-line interface.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Do reverse IPv6 lookups using the obsolete RFC1886 IP6.INT
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync domain, which is no longer in use. Obsolete bit string
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync label queries (RFC2874) are not attempted.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<dt><span class="term">-k <em class="replaceable"><code>keyfile</code></em></span></dt>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Sign queries using TSIG using a key read from the given file.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Key files can be generated using
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync <span class="citerefentry"><span class="refentrytitle">tsig-keygen</span>(8)</span>.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync When using TSIG authentication with <span><strong class="command">dig</strong></span>,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync the name server that is queried needs to know the key and
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync algorithm that is being used. In BIND, this is done by
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync providing appropriate <span><strong class="command">key</strong></span>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync and <span><strong class="command">server</strong></span> statements in
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Enable memory usage debugging.
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync Send the query to a non-standard port on the server,
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync instead of the defaut port 53. This option would be used
74fe172698ba936102e120dae998c9ebd09cfbdfvboxsync to test a name server that has been configured to listen
<dt><span class="term">-y <em class="replaceable"><code>[<span class="optional">hmac:</span>]keyname:secret</code></em></span></dt>
<dt><span class="term"><code class="option">+[no]cookie[<span class="optional">=####</span>]</code></span></dt>
e.g. "[ key id = value ]".
accepted. Setting a named flag (e.g. DO) will silently be