dig.html revision 60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - Copyright (C) 2000-2003 Internet Software Consortium
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - Permission to use, copy, modify, and distribute this software for any
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - purpose with or without fee is hereby granted, provided that the above
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - copyright notice and this permission notice appear in all copies.
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny - PERFORMANCE OF THIS SOFTWARE.
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny<a name="id2456614"></a><div class="titlepage"></div>
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny<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">-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>
2962b3d1e072ff2ebbe343095812dad697d6bf1dSumit Bose<div class="cmdsynopsis"><p><code class="command">dig</code> [<code class="option">-h</code>]</p></div>
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny<p><span><strong class="command">dig</strong></span>
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny (domain information groper) is a flexible tool
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny for interrogating DNS name servers. It performs DNS lookups and
bd92e8ee315d4da9350b9ef0358c88a7b54aeebeStephen Gallagher displays the answers that are returned from the name server(s) that
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny were queried. Most DNS administrators use <span><strong class="command">dig</strong></span> to
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny troubleshoot DNS problems because of its flexibility, ease of use and
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny clarity of output. Other lookup tools tend to have less functionality
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny than <span><strong class="command">dig</strong></span>.
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny Although <span><strong class="command">dig</strong></span> is normally used with
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny command-line
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny arguments, it also has a batch mode of operation for reading lookup
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny requests from a file. A brief summary of its command-line arguments
8b1f2574ce7a964965a18ab047ab09c4694380c4Jan Zeleny and options is printed when the <code class="option">-h</code> option is given.
8edf0e447266d68f10264eb3f3ea514cd1687041Jakub Hrozek Unlike earlier versions, the BIND9 implementation of
8edf0e447266d68f10264eb3f3ea514cd1687041Jakub Hrozek <span><strong class="command">dig</strong></span> allows multiple lookups to be issued
36a12aea020a935ffa40505fa02860c3d921ad0cSumit Bose command line.
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose Unless it is told to query a specific name server,
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose <span><strong class="command">dig</strong></span> will try each of the servers listed
36a12aea020a935ffa40505fa02860c3d921ad0cSumit Bose When no command line arguments or options are given, will perform an
881c4ba834b23ae651ac01db667801f314eb0a5dJan Zeleny NS query for "." (the root).
00c283ca719717ed483958571982d0e9ff95c4b1Sumit Bose It is possible to set per-user defaults for <span><strong class="command">dig</strong></span> via
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose <code class="filename">${HOME}/.digrc</code>. This file is read and
791abc91fd8b2a7f73511ab8051df1065f9f54b2Simo Sorce any options in it
791abc91fd8b2a7f73511ab8051df1065f9f54b2Simo Sorce are applied before the command line arguments.
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose A typical invocation of <span><strong class="command">dig</strong></span> looks like:
3d28e0e560b787b5c57ed7327d184310342a7e38Jakub Hrozek<pre class="programlisting"> dig @server name type </pre>
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose<dt><span class="term"><code class="constant">server</code></span></dt>
1c82a31a254c2fca6dfa3e3b52986b75221d8742Sumit Bose is the name or IP address of the name server to query. This can
1c82a31a254c2fca6dfa3e3b52986b75221d8742Sumit Bose address in dotted-decimal notation or an IPv6
d32b165fad7b89462f49c82349e1df5a2343afa2Sumit Bose address in colon-delimited notation. When the supplied
d32b165fad7b89462f49c82349e1df5a2343afa2Sumit Bose <em class="parameter"><code>server</code></em> argument is a
d32b165fad7b89462f49c82349e1df5a2343afa2Sumit Bose <span><strong class="command">dig</strong></span> resolves that name before
d32b165fad7b89462f49c82349e1df5a2343afa2Sumit Bose querying that name
0f3df54840ec9a050cc0b1b68269c3f28c859e64Sumit Bose server. If no <em class="parameter"><code>server</code></em>
0f3df54840ec9a050cc0b1b68269c3f28c859e64Sumit Bose argument is provided,
0f3df54840ec9a050cc0b1b68269c3f28c859e64Sumit Bose <span><strong class="command">dig</strong></span> consults <code class="filename">/etc/resolv.conf</code>
0f3df54840ec9a050cc0b1b68269c3f28c859e64Sumit Bose and queries the name servers listed there. The reply from the
0f3df54840ec9a050cc0b1b68269c3f28c859e64Sumit Bose server that responds is displayed.
0f3df54840ec9a050cc0b1b68269c3f28c859e64Sumit Bose<dt><span class="term"><code class="constant">name</code></span></dt>
0f3df54840ec9a050cc0b1b68269c3f28c859e64Sumit Bose is the name of the resource record that is to be looked up.
0f3df54840ec9a050cc0b1b68269c3f28c859e64Sumit Bose<dt><span class="term"><code class="constant">type</code></span></dt>
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose indicates what type of query is required —
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose ANY, A, MX, SIG, etc.
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose <em class="parameter"><code>type</code></em> can be any valid query
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose <em class="parameter"><code>type</code></em> argument is supplied,
ed4a9bd4d0f7fb359bed66a8d63a92e7be633aaeSumit Bose <span><strong class="command">dig</strong></span> will perform a lookup for an
<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
<em class="parameter"><code>name</code></em> to <em class="parameter"><code>D</code></em> for it to be