dig.html revision 5347c0fcb04eaea19d9f39795646239f487c6207
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington - Copyright (C) 2000-2011, 2013-2016 Internet Systems Consortium, Inc. ("ISC")
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington - This Source Code Form is subject to the terms of the Mozilla Public
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington - License, v. 2.0. If a copy of the MPL was not distributed with this
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington - file, You can obtain one at http://mozilla.org/MPL/2.0/.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<a name="man.dig"></a><div class="titlepage"></div>
77a123fe3fd0188a9552995da5a36a9f70b0d36fPhill 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>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<div class="cmdsynopsis"><p><code class="command">dig</code> [<code class="option">-h</code>]</p></div>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<p><span class="command"><strong>dig</strong></span>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington (domain information groper) is a flexible tool
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington for interrogating DNS name servers. It performs DNS lookups and
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington displays the answers that are returned from the name server(s) that
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington were queried. Most DNS administrators use <span class="command"><strong>dig</strong></span> to
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington troubleshoot DNS problems because of its flexibility, ease of use and
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington clarity of output. Other lookup tools tend to have less functionality
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington than <span class="command"><strong>dig</strong></span>.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Although <span class="command"><strong>dig</strong></span> is normally used with
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington arguments, it also has a batch mode of operation for reading lookup
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington requests from a file. A brief summary of its command-line arguments
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington and options is printed when the <code class="option">-h</code> option is given.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Unlike earlier versions, the BIND 9 implementation of
77a123fe3fd0188a9552995da5a36a9f70b0d36fPhill Cunnington <span class="command"><strong>dig</strong></span> allows multiple lookups to be issued
77a123fe3fd0188a9552995da5a36a9f70b0d36fPhill Cunnington command line.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Unless it is told to query a specific name server,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <span class="command"><strong>dig</strong></span> will try each of the servers listed in
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <code class="filename">/etc/resolv.conf</code>. If no usable server addresses
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington are found, <span class="command"><strong>dig</strong></span> will send the query to the local
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington When no command line arguments or options are given,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <span class="command"><strong>dig</strong></span> will perform an NS query for "." (the root).
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington It is possible to set per-user defaults for <span class="command"><strong>dig</strong></span> via
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington <code class="filename">${HOME}/.digrc</code>. This file is read and
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington any options in it
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington are applied before the command line arguments.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington The IN and CH class names overlap with the IN and CH top level
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington domain names. Either use the <code class="option">-t</code> and
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <code class="option">-c</code> options to specify the type and class,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington use the <code class="option">-q</code> the specify the domain name, or
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington use "IN." and "CH." when looking up these top level domains.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington A typical invocation of <span class="command"><strong>dig</strong></span> looks like:
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<pre class="programlisting"> dig @server name type </pre>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<div class="variablelist"><dl class="variablelist">
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<dt><span class="term"><code class="constant">server</code></span></dt>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington is the name or IP address of the name server to query. This
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington can be an IPv4 address in dotted-decimal notation or an IPv6
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington address in colon-delimited notation. When the supplied
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <em class="parameter"><code>server</code></em> argument is a hostname,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <span class="command"><strong>dig</strong></span> resolves that name before querying
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington that name server.
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington If no <em class="parameter"><code>server</code></em> argument is
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington provided, <span class="command"><strong>dig</strong></span> consults
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington <code class="filename">/etc/resolv.conf</code>; if an
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington address is found there, it queries the name server at
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington that address. If either of the <code class="option">-4</code> or
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington <code class="option">-6</code> options are in use, then
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington only addresses for the corresponding transport
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington will be tried. If no usable addresses are found,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <span class="command"><strong>dig</strong></span> will send the query to the
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington local host. The reply from the name server that
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington responds is displayed.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<dt><span class="term"><code class="constant">name</code></span></dt>
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington is the name of the resource record that is to be looked up.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<dt><span class="term"><code class="constant">type</code></span></dt>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington indicates what type of query is required —
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington ANY, A, MX, SIG, etc.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <em class="parameter"><code>type</code></em> can be any valid query
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <em class="parameter"><code>type</code></em> argument is supplied,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <span class="command"><strong>dig</strong></span> will perform a lookup for an
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<div class="variablelist"><dl class="variablelist">
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Use IPv4 only.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Use IPv6 only.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<dt><span class="term">-b <em class="replaceable"><code>address[<span class="optional">#port</span>]</code></em></span></dt>
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington Set the source IP address of the query.
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington The <em class="parameter"><code>address</code></em> must be a valid address on
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington one of the host's network interfaces, or "0.0.0.0" or "::". An
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington optional port may be specified by appending "#<port>"
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington<dt><span class="term">-c <em class="replaceable"><code>class</code></em></span></dt>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Set the query class. The
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington default <em class="parameter"><code>class</code></em> is IN; other classes
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington are HS for Hesiod records or CH for Chaosnet records.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<dt><span class="term">-f <em class="replaceable"><code>file</code></em></span></dt>
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington Batch mode: <span class="command"><strong>dig</strong></span> reads a list of lookup
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington requests to process from the
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington given <em class="parameter"><code>file</code></em>. Each line in the file
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington should be organized in the same way they would be
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington presented as queries to
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <span class="command"><strong>dig</strong></span> using the command-line interface.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Do reverse IPv6 lookups using the obsolete RFC1886 IP6.INT
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington domain, which is no longer in use. Obsolete bit string
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington label queries (RFC2874) are not attempted.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<dt><span class="term">-k <em class="replaceable"><code>keyfile</code></em></span></dt>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Sign queries using TSIG using a key read from the given file.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Key files can be generated using
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington <span class="citerefentry"><span class="refentrytitle">tsig-keygen</span>(8)</span>.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington When using TSIG authentication with <span class="command"><strong>dig</strong></span>,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington the name server that is queried needs to know the key and
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington algorithm that is being used. In BIND, this is done by
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington providing appropriate <span class="command"><strong>key</strong></span>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington and <span class="command"><strong>server</strong></span> statements in
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Enable memory usage debugging.
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington Send the query to a non-standard port on the server,
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington instead of the default port 53. This option would be used
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington to test a name server that has been configured to listen
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington for queries on a non-standard port number.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<dt><span class="term">-q <em class="replaceable"><code>name</code></em></span></dt>
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington The domain name to query. This is useful to distinguish
33908fb93167e643fbb21b47d87c5b632df0dc59Phill Cunnington the <em class="parameter"><code>name</code></em> from other arguments.
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington<dt><span class="term">-t <em class="replaceable"><code>type</code></em></span></dt>
<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