man.dig.html revision 71cef386fae61275b03e203825680b39fedaa8c6
3c803ac3b53ba983a143b03bf688bc67b1a9db2bAdam Moore<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
f5b3e585128358cd928cc6bbd5168f3b62b3c024Adam Moore - Copyright (C) 2000-2018 Internet Systems Consortium, Inc. ("ISC")
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore - This Source Code Form is subject to the terms of the Mozilla Public
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore - License, v. 2.0. If a copy of the MPL was not distributed with this
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore - file, You can obtain one at http://mozilla.org/MPL/2.0/.
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
4fcbec6145d16637205990699912fb90f6a3807cAdam Moore<link rel="home" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
4fcbec6145d16637205990699912fb90f6a3807cAdam Moore<link rel="up" href="Bv9ARM.ch13.html" title="Manual pages">
4fcbec6145d16637205990699912fb90f6a3807cAdam Moore<link rel="prev" href="Bv9ARM.ch13.html" title="Manual pages">
4fcbec6145d16637205990699912fb90f6a3807cAdam Moore<link rel="next" href="man.mdig.html" title="mdig">
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<a accesskey="p" href="Bv9ARM.ch13.html">Prev</a>�</td>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<td width="20%" align="right">�<a accesskey="n" href="man.mdig.html">Next</a>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<a name="man.dig"></a><div class="titlepage"></div>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore — DNS lookup utility
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore [<code class="option">-b <em class="replaceable"><code>address</code></em></code>]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore [<code class="option">-c <em class="replaceable"><code>class</code></em></code>]
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore [<code class="option">-f <em class="replaceable"><code>filename</code></em></code>]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore [<code class="option">-k <em class="replaceable"><code>filename</code></em></code>]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore [<code class="option">-p <em class="replaceable"><code>port#</code></em></code>]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore [<code class="option">-q <em class="replaceable"><code>name</code></em></code>]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore [<code class="option">-t <em class="replaceable"><code>type</code></em></code>]
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore [<code class="option">-x <em class="replaceable"><code>addr</code></em></code>]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore [<code class="option">-y <em class="replaceable"><code>[<span class="optional">hmac:</span>]name:key</code></em></code>]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore [queryopt...]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore [global-queryopt...]
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <p><span class="command"><strong>dig</strong></span> is a flexible tool
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore for interrogating DNS name servers. It performs DNS lookups and
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore displays the answers that are returned from the name server(s) that
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore were queried. Most DNS administrators use <span class="command"><strong>dig</strong></span> to
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore troubleshoot DNS problems because of its flexibility, ease of use and
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore clarity of output. Other lookup tools tend to have less functionality
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore than <span class="command"><strong>dig</strong></span>.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore Although <span class="command"><strong>dig</strong></span> is normally used with
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore command-line
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore arguments, it also has a batch mode of operation for reading lookup
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore requests from a file. A brief summary of its command-line arguments
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore and options is printed when the <code class="option">-h</code> option is given.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore Unlike earlier versions, the BIND 9 implementation of
eb9b6f817df5c660be9f00fc5d27fe33479fdc98Adam Moore <span class="command"><strong>dig</strong></span> allows multiple lookups to be issued
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore command line.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore Unless it is told to query a specific name server,
eb9b6f817df5c660be9f00fc5d27fe33479fdc98Adam Moore <span class="command"><strong>dig</strong></span> will try each of the servers listed in
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <code class="filename">/etc/resolv.conf</code>. If no usable server addresses
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore are found, <span class="command"><strong>dig</strong></span> will send the query to the local
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore When no command line arguments or options are given,
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <span class="command"><strong>dig</strong></span> will perform an NS query for "." (the root).
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore It is possible to set per-user defaults for <span class="command"><strong>dig</strong></span> via
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <code class="filename">${HOME}/.digrc</code>. This file is read and
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore any options in it
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore are applied before the command line arguments.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore The IN and CH class names overlap with the IN and CH top level
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore domain names. Either use the <code class="option">-t</code> and
ee4d8528357b157539bc45a7324cb16d46a88272Adam Moore <code class="option">-c</code> options to specify the type and class,
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore use the <code class="option">-q</code> the specify the domain name, or
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore use "IN." and "CH." when looking up these top level domains.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore A typical invocation of <span class="command"><strong>dig</strong></span> looks like:
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore<pre class="programlisting"> dig @server name type </pre>
23492c030b5a96aa8cfebad905225f03203e680cAdam Moore<div class="variablelist"><dl class="variablelist">
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<dt><span class="term"><code class="constant">server</code></span></dt>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore is the name or IP address of the name server to query. This
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore can be an IPv4 address in dotted-decimal notation or an IPv6
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore address in colon-delimited notation. When the supplied
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <em class="parameter"><code>server</code></em> argument is a hostname,
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <span class="command"><strong>dig</strong></span> resolves that name before querying
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore that name server.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore If no <em class="parameter"><code>server</code></em> argument is
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore provided, <span class="command"><strong>dig</strong></span> consults
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <code class="filename">/etc/resolv.conf</code>; if an
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore address is found there, it queries the name server at
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore that address. If either of the <code class="option">-4</code> or
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <code class="option">-6</code> options are in use, then
eb9b6f817df5c660be9f00fc5d27fe33479fdc98Adam Moore only addresses for the corresponding transport
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore will be tried. If no usable addresses are found,
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <span class="command"><strong>dig</strong></span> will send the query to the
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore local host. The reply from the name server that
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore responds is displayed.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<dt><span class="term"><code class="constant">name</code></span></dt>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore is the name of the resource record that is to be looked up.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<dt><span class="term"><code class="constant">type</code></span></dt>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore indicates what type of query is required —
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore ANY, A, MX, SIG, etc.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <em class="parameter"><code>type</code></em> can be any valid query
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <em class="parameter"><code>type</code></em> argument is supplied,
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <span class="command"><strong>dig</strong></span> will perform a lookup for an
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <div class="variablelist"><dl class="variablelist">
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore Use IPv4 only.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore Use IPv6 only.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<dt><span class="term">-b <em class="replaceable"><code>address[<span class="optional">#port</span>]</code></em></span></dt>
3674931fc5c32e4e1b79f0273b8a7477b5ccd08bAdam Moore Set the source IP address of the query.
3674931fc5c32e4e1b79f0273b8a7477b5ccd08bAdam Moore The <em class="parameter"><code>address</code></em> must be a valid address on
3674931fc5c32e4e1b79f0273b8a7477b5ccd08bAdam Moore one of the host's network interfaces, or "0.0.0.0" or "::". An
3674931fc5c32e4e1b79f0273b8a7477b5ccd08bAdam Moore optional port may be specified by appending "#<port>"
ee1f27f246004acce593dcb50c6a069c1d8edd9eAdam Moore<dt><span class="term">-c <em class="replaceable"><code>class</code></em></span></dt>
3674931fc5c32e4e1b79f0273b8a7477b5ccd08bAdam Moore Set the query class. The
3674931fc5c32e4e1b79f0273b8a7477b5ccd08bAdam Moore default <em class="parameter"><code>class</code></em> is IN; other classes
3674931fc5c32e4e1b79f0273b8a7477b5ccd08bAdam Moore are HS for Hesiod records or CH for Chaosnet records.
3674931fc5c32e4e1b79f0273b8a7477b5ccd08bAdam Moore<dt><span class="term">-f <em class="replaceable"><code>file</code></em></span></dt>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore Batch mode: <span class="command"><strong>dig</strong></span> reads a list of lookup
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore requests to process from the
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore given <em class="parameter"><code>file</code></em>. Each line in the file
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore should be organized in the same way they would be
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore presented as queries to
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore <span class="command"><strong>dig</strong></span> using the command-line interface.
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore Do reverse IPv6 lookups using the obsolete RFC1886 IP6.INT
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore domain, which is no longer in use. Obsolete bit string
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore label queries (RFC2874) are not attempted.
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore<dt><span class="term">-k <em class="replaceable"><code>keyfile</code></em></span></dt>
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore Sign queries using TSIG using a key read from the given file.
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore Key files can be generated using
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore <span class="refentrytitle">tsig-keygen</span>(8)
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore When using TSIG authentication with <span class="command"><strong>dig</strong></span>,
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore the name server that is queried needs to know the key and
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore algorithm that is being used. In BIND, this is done by
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore providing appropriate <span class="command"><strong>key</strong></span>
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore and <span class="command"><strong>server</strong></span> statements in
1a86ff82405008489db03fbd648e982b4dc99ea8Adam Moore Enable memory usage debugging.
91095b24ae0db3610e7924c776f7a86cd681fb1cAdam Moore<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
1a86ff82405008489db03fbd648e982b4dc99ea8Adam Moore Send the query to a non-standard port on the server,
1a86ff82405008489db03fbd648e982b4dc99ea8Adam Moore instead of the default port 53. This option would be used
1a86ff82405008489db03fbd648e982b4dc99ea8Adam Moore to test a name server that has been configured to listen
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore for queries on a non-standard port number.
1a86ff82405008489db03fbd648e982b4dc99ea8Adam Moore<dt><span class="term">-q <em class="replaceable"><code>name</code></em></span></dt>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore The domain name to query. This is useful to distinguish
fd998dcd768f39fdafd1e5ff99c72f295c5ecad9Adam Moore the <em class="parameter"><code>name</code></em> from other arguments.
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore<dt><span class="term">-t <em class="replaceable"><code>type</code></em></span></dt>
62e7a7d39cc0c6d25fec20964c26bc35b9fa116aAdam Moore The resource record type to query. It can be any valid query type
3c803ac3b53ba983a143b03bf688bc67b1a9db2bAdam Moore supported in BIND 9. The default query type is "A", unless the
3c803ac3b53ba983a143b03bf688bc67b1a9db2bAdam Moore <code class="option">-x</code> option is supplied to indicate a reverse lookup.
<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
<em class="parameter"><code>+noqr</code></em> which means that <span class="command"><strong>dig</strong></span>
<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.11.2 (Extended Support Version)</p>