dig.html revision b49958b502ee45022010a0b1bed3968f598895a4
a7038d1a0513c8e804937ebc95fc9cb3a46c04f5Mark Andrews - Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - Copyright (C) 2000-2003 Internet Software Consortium.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - Permission to use, copy, modify, and distribute this software for any
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - purpose with or without fee is hereby granted, provided that the above
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
15a44745412679c30a6d022733925af70a38b715David Lawrence - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15a44745412679c30a6d022733925af70a38b715David Lawrence - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15a44745412679c30a6d022733925af70a38b715David Lawrence - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15a44745412679c30a6d022733925af70a38b715David Lawrence - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15a44745412679c30a6d022733925af70a38b715David Lawrence - PERFORMANCE OF THIS SOFTWARE.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley<!-- $Id: dig.html,v 1.44 2008/10/03 01:11:33 tbox Exp $ -->
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
e4e071ae12aee942fefc2c0a3280e402938669deBob Halley<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halley<a name="man.dig"></a><div class="titlepage"></div>
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence<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>[<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>
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence<div class="cmdsynopsis"><p><code class="command">dig</code> [<code class="option">-h</code>]</p></div>
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley<p><span><strong class="command">dig</strong></span>
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington (domain information groper) is a flexible tool
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington for interrogating DNS name servers. It performs DNS lookups and
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington displays the answers that are returned from the name server(s) that
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington were queried. Most DNS administrators use <span><strong class="command">dig</strong></span> to
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington troubleshoot DNS problems because of its flexibility, ease of use and
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington clarity of output. Other lookup tools tend to have less functionality
bcff3198111e329e89cde7dac9d432b002477d80Mark Andrews than <span><strong class="command">dig</strong></span>.
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington Although <span><strong class="command">dig</strong></span> is normally used with
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington arguments, it also has a batch mode of operation for reading lookup
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington requests from a file. A brief summary of its command-line arguments
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington and options is printed when the <code class="option">-h</code> option is given.
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley Unlike earlier versions, the BIND 9 implementation of
84cb41f729e2a8526300dd7a6cffaa66da5cf6cdMark Andrews <span><strong class="command">dig</strong></span> allows multiple lookups to be issued
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington command line.
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington Unless it is told to query a specific name server,
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington <span><strong class="command">dig</strong></span> will try each of the servers listed
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington <code class="filename">/etc/resolv.conf</code>.
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington When no command line arguments or options are given,
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington <span><strong class="command">dig</strong></span> will perform an NS query for "." (the root).
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington It is possible to set per-user defaults for <span><strong class="command">dig</strong></span> via
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington <code class="filename">${HOME}/.digrc</code>. This file is read and
125d72976ab6b8fa6629a5ace276a86e9fef91acBrian Wellington any options in it
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley are applied before the command line arguments.
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley The IN and CH class names overlap with the IN and CH top level
308c7ad5f68301d19f023af616f62f3e7cbce632Andreas Gustafsson domains names. Either use the <code class="option">-t</code> and
04b8111f2137a9cf9b0b71228f76b3e40ffa1173Brian Wellington <code class="option">-c</code> options to specify the type and class,
04b8111f2137a9cf9b0b71228f76b3e40ffa1173Brian Wellington use the <code class="option">-q</code> the specify the domain name, or
ccad3c9ecbe8a1060ff7b407a318ccd592de536eBrian Wellington use "IN." and "CH." when looking up these top level domains.
ccad3c9ecbe8a1060ff7b407a318ccd592de536eBrian Wellington<a name="id2543585"></a><h2>SIMPLE USAGE</h2>
8224be5129daebea8f0f5e8be5f925679ec893f1Brian Wellington A typical invocation of <span><strong class="command">dig</strong></span> looks like:
d14b749789121d9d502fa1348e9e73270e9b039fBob Halley<pre class="programlisting"> dig @server name type </pre>
73af6575e00f8cf4942abce177f435797b9cfe41Brian Wellington<dt><span class="term"><code class="constant">server</code></span></dt>
3864eb0e9a73148ac744893b5367169761184db5Mark Andrews is the name or IP address of the name server to query. This can
afbc02482008c58af2c98000209165f6880835f7Mark Andrews address in dotted-decimal notation or an IPv6
e1f16346db02486f751c6db683fffe53c866c186Andreas Gustafsson address in colon-delimited notation. When the supplied
e1f16346db02486f751c6db683fffe53c866c186Andreas Gustafsson <em class="parameter"><code>server</code></em> argument is a
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews <span><strong class="command">dig</strong></span> resolves that name before
6850cdd4497424c9d42ade487edfde9fb9a47de9Brian Wellington querying that name
20a313a4581e7f85fb2ce37430a146b3538da841Mark Andrews server. If no <em class="parameter"><code>server</code></em>
20a313a4581e7f85fb2ce37430a146b3538da841Mark Andrews argument is provided,
b20ee662a7c847c9ef7b96ab9e5e34543efe5c0dMark Andrews <span><strong class="command">dig</strong></span> consults <code class="filename">/etc/resolv.conf</code>
b55c30f2de6e1baaa3a9ba69b92f428f2c255ac3Mark Andrews and queries the name servers listed there. The reply from the
6a56be50dd11702cb65347a57894ffd96a7e3501Andreas Gustafsson server that responds is displayed.
15af30dfc1c54a02d252dcf4c6f3b8759eaf0327Bob Halley<dt><span class="term"><code class="constant">name</code></span></dt>
58cbc05eb0b80510182496ad905cd407f3624dbeBrian Wellington is the name of the resource record that is to be looked up.
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews<dt><span class="term"><code class="constant">type</code></span></dt>
a9ef4854464fcc56d95f72331b6e09e9563bb5f3Andreas Gustafsson indicates what type of query is required —
2c64908ae0d5b5a1cfead295d7526e7be550d3d3Mark Andrews ANY, A, MX, SIG, etc.
01446841be2b73f9a2ead74056df2d5342414041Andreas Gustafsson <em class="parameter"><code>type</code></em> can be any valid query
b6279d0b4b19f041b29775e637074e09f38e5e11Brian Wellington <em class="parameter"><code>type</code></em> argument is supplied,
231ffa6c85cd04d5d83f80643e26fdc3ff510138Brian Wellington <span><strong class="command">dig</strong></span> will perform a lookup for an
5bd76af084edfdcd1cb4db9453ac781d32dde6f7Mark Andrews The <code class="option">-b</code> option sets the source IP address of the query
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley to <em class="parameter"><code>address</code></em>. This must be a valid
894a2f61c9e3e51463bf21957c003d7c5636bdc5David Lawrence one of the host's network interfaces or "0.0.0.0" or "::". An optional
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley may be specified by appending "#<port>"
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley The default query class (IN for internet) is overridden by the
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley <code class="option">-c</code> option. <em class="parameter"><code>class</code></em> is
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley class, such as HS for Hesiod records or CH for Chaosnet records.
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley The <code class="option">-f</code> option makes <span><strong class="command">dig </strong></span>
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley in batch mode by reading a list of lookup requests to process from the
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley file <em class="parameter"><code>filename</code></em>. The file contains a
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley queries, one per line. Each entry in the file should be organized in
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley the same way they would be presented as queries to
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley <span><strong class="command">dig</strong></span> using the command-line interface.
25e43e68b7431d5e4ff8b5427108cd7f5f9bcf3eBob Halley If a non-standard port number is to be queried, the
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley <code class="option">-p</code> option is used. <em class="parameter"><code>port#</code></em> is
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence the port number that <span><strong class="command">dig</strong></span> will send its
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence instead of the standard DNS port number 53. This option would be used
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence to test a name server that has been configured to listen for queries
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence on a non-standard port number.
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence The <code class="option">-4</code> option forces <span><strong class="command">dig</strong></span>
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence use IPv4 query transport. The <code class="option">-6</code> option forces
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley <span><strong class="command">dig</strong></span> to only use IPv6 query transport.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley The <code class="option">-t</code> option sets the query type to
<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