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