man.dig.html revision 8c9957e63274e6ea44d182703116307b1a65dabb
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber - Copyright (C) 2000-2003 Internet Software Consortium.
2a31251cc5f428f96ee3d322a78556310a681e14Stéphane Graber - Permission to use, copy, modify, and distribute this software for any
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge - purpose with or without fee is hereby granted, provided that the above
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge - copyright notice and this permission notice appear in all copies.
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge - PERFORMANCE OF THIS SOFTWARE.
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<!-- $Id: man.dig.html,v 1.10 2005/10/26 06:23:18 marka Exp $ -->
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<link rel="up" href="Bv9ARM.ch10.html" title="Manual pages">
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<link rel="prev" href="Bv9ARM.ch10.html" title="Manual pages">
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<link rel="next" href="man.host.html" title="host">
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<table width="100%" summary="Navigation header">
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<tr><th colspan="3" align="center">dig</th></tr>
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<a accesskey="p" href="Bv9ARM.ch10.html">Prev</a>�</td>
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<th width="60%" align="center">Manual pages</th>
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<td width="20%" align="right">�<a accesskey="n" href="man.host.html">Next</a>
807f4c9e1eaae674c76fd3a97d0b4a8810004177Jamie Strandboge<a name="man.dig"></a><div class="titlepage"></div>
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber<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">-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>name:key</code></em></code>] [<code class="option">-4</code>] [<code class="option">-6</code>] [name] [type] [class] [queryopt...]</p></div>
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber<div class="cmdsynopsis"><p><code class="command">dig</code> [<code class="option">-h</code>]</p></div>
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber<p><span><strong class="command">dig</strong></span>
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber (domain information groper) is a flexible tool
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber for interrogating DNS name servers. It performs DNS lookups and
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber displays the answers that are returned from the name server(s) that
b03f1f4ac3666abd032ddc617823213568ad577bStéphane Graber were queried. Most DNS administrators use <span><strong class="command">dig</strong></span> to
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber troubleshoot DNS problems because of its flexibility, ease of use and
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber clarity of output. Other lookup tools tend to have less functionality
4845c17aff570c25e05c5347dfdcd577cb108d47Serge Hallyn than <span><strong class="command">dig</strong></span>.
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber Although <span><strong class="command">dig</strong></span> is normally used with
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber arguments, it also has a batch mode of operation for reading lookup
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber requests from a file. A brief summary of its command-line arguments
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber and options is printed when the <code class="option">-h</code> option is given.
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber Unlike earlier versions, the BIND9 implementation of
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber <span><strong class="command">dig</strong></span> allows multiple lookups to be issued
98b745498bf97637f68311f944903777f3ee1e67Stéphane Graber command line.
98b745498bf97637f68311f944903777f3ee1e67Stéphane Graber Unless it is told to query a specific name server,
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber <span><strong class="command">dig</strong></span> will try each of the servers listed
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber <code class="filename">/etc/resolv.conf</code>.
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber When no command line arguments or options are given, will perform an
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber NS query for "." (the root).
056f8bba0d86ca2ba481a932f23faff9db2ef588Stéphane Graber It is possible to set per-user defaults for <span><strong class="command">dig</strong></span> via
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber <code class="filename">${HOME}/.digrc</code>. This file is read and
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber any options in it
c08a0b7c4e459f32a939391bc5c9667eb7c7ab5cSerge Hallyn are applied before the command line arguments.
549a40b6128892112895299e445e0564c3faaea2Stéphane Graber A typical invocation of <span><strong class="command">dig</strong></span> looks like:
564ad051ce487e5f684feb4ace09545ef9e1b9d5Stéphane Graber<pre class="programlisting"> dig @server name type </pre>
564ad051ce487e5f684feb4ace09545ef9e1b9d5Stéphane Graber<dt><span class="term"><code class="constant">server</code></span></dt>
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber is the name or IP address of the name server to query. This can
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber address in dotted-decimal notation or an IPv6
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber address in colon-delimited notation. When the supplied
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber <em class="parameter"><code>server</code></em> argument is a
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber <span><strong class="command">dig</strong></span> resolves that name before
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber querying that name
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber server. If no <em class="parameter"><code>server</code></em>
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber argument is provided,
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber <span><strong class="command">dig</strong></span> consults <code class="filename">/etc/resolv.conf</code>
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber and queries the name servers listed there. The reply from the
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber server that responds is displayed.
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber<dt><span class="term"><code class="constant">name</code></span></dt>
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber is the name of the resource record that is to be looked up.
7e4c9a30feb3905902a158cde099f4510a54d5efStéphane Graber<dt><span class="term"><code class="constant">type</code></span></dt>
7e4c9a30feb3905902a158cde099f4510a54d5efStéphane Graber indicates what type of query is required —
7e4c9a30feb3905902a158cde099f4510a54d5efStéphane Graber ANY, A, MX, SIG, etc.
7e4c9a30feb3905902a158cde099f4510a54d5efStéphane Graber <em class="parameter"><code>type</code></em> can be any valid query
7e4c9a30feb3905902a158cde099f4510a54d5efStéphane Graber <em class="parameter"><code>type</code></em> argument is supplied,
7e4c9a30feb3905902a158cde099f4510a54d5efStéphane Graber <span><strong class="command">dig</strong></span> will perform a lookup for an
9a1d96120f578d35227895aff3852ef10a9e1b1dStéphane Graber The <code class="option">-b</code> option sets the source IP address of the query
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn to <em class="parameter"><code>address</code></em>. This must be a valid
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn one of the host's network interfaces or "0.0.0.0" or "::". An optional
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn may be specified by appending "#<port>"
773bd28258371ad0058ff946c5cf94419920ffddSerge Hallyn The default query class (IN for internet) is overridden by the
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn <code class="option">-c</code> option. <em class="parameter"><code>class</code></em> is
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn class, such as HS for Hesiod records or CH for CHAOSNET records.
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn The <code class="option">-f</code> option makes <span><strong class="command">dig </strong></span>
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn in batch mode by reading a list of lookup requests to process from the
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn file <em class="parameter"><code>filename</code></em>. The file contains a
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn queries, one per line. Each entry in the file should be organised in
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn the same way they would be presented as queries to
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn <span><strong class="command">dig</strong></span> using the command-line interface.
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn If a non-standard port number is to be queried, the
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn <code class="option">-p</code> option is used. <em class="parameter"><code>port#</code></em> is
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn the port number that <span><strong class="command">dig</strong></span> will send its
773bd28258371ad0058ff946c5cf94419920ffddSerge Hallyn instead of the standard DNS port number 53. This option would be used
773bd28258371ad0058ff946c5cf94419920ffddSerge Hallyn to test a name server that has been configured to listen for queries
773bd28258371ad0058ff946c5cf94419920ffddSerge Hallyn on a non-standard port number.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn The <code class="option">-4</code> option forces <span><strong class="command">dig</strong></span>
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn use IPv4 query transport. The <code class="option">-6</code> option forces
94a77f3fd8be2fb87f7d1465521fac3ec4b7e6b5Serge Hallyn <span><strong class="command">dig</strong></span> to only use IPv6 query transport.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn The <code class="option">-t</code> option sets the query type to
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <em class="parameter"><code>type</code></em>. It can be any valid query type
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn supported in BIND9. The default query type "A", unless the
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <code class="option">-x</code> option is supplied to indicate a reverse lookup.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn A zone transfer can be requested by specifying a type of AXFR. When
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn an incremental zone transfer (IXFR) is required,
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <em class="parameter"><code>type</code></em> is set to <code class="literal">ixfr=N</code>.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn The incremental zone transfer will contain the changes made to the zone
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn since the serial number in the zone's SOA record was
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn The <code class="option">-q</code> option sets the query name to
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <em class="parameter"><code>name</code></em>. This useful do distingish the
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <em class="parameter"><code>name</code></em> from other arguments.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn Reverse lookups - mapping addresses to names - are simplified by the
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <code class="option">-x</code> option. <em class="parameter"><code>addr</code></em> is
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn address in dotted-decimal notation, or a colon-delimited IPv6 address.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn When this option is used, there is no need to provide the
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <em class="parameter"><code>name</code></em>, <em class="parameter"><code>class</code></em> and
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <em class="parameter"><code>type</code></em> arguments. <span><strong class="command">dig</strong></span>
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn automatically performs a lookup for a name like
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn <code class="literal">11.12.13.10.in-addr.arpa</code> and sets the
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn query type and
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn class to PTR and IN respectively. By default, IPv6 addresses are
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn looked up using nibble format under the IP6.ARPA domain.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn To use the older RFC1886 method using the IP6.INT domain
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn specify the <code class="option">-i</code> option. Bit string labels (RFC2874)
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn are now experimental and are not attempted.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn To sign the DNS queries sent by <span><strong class="command">dig</strong></span> and
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn responses using transaction signatures (TSIG), specify a TSIG key file
<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