dig.docbook revision 0db6bf459f7afa1f9dc0690a521df19955c89dbf
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
ca41b452ede6feaa9d8739ec3cae19389a7b0d03Bob Halley "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence [<!ENTITY mdash "—">]>
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff - Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff - Copyright (C) 2000-2003 Internet Software Consortium.
15a44745412679c30a6d022733925af70a38b715David Lawrence - Permission to use, copy, modify, and/or distribute this software for any
15a44745412679c30a6d022733925af70a38b715David Lawrence - purpose with or without fee is hereby granted, provided that the above
15a44745412679c30a6d022733925af70a38b715David 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
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - PERFORMANCE OF THIS SOFTWARE.
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff<!-- $Id: dig.docbook,v 1.42 2008/10/13 21:18:56 jreed Exp $ -->
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff <refentryinfo>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff </refentryinfo>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </refnamediv>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <holder>Internet Software Consortium.</holder>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <refsynopsisdiv>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg><option>-b <replaceable class="parameter">address</replaceable></option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg><option>-f <replaceable class="parameter">filename</replaceable></option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg><option>-k <replaceable class="parameter">filename</replaceable></option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg><option>-p <replaceable class="parameter">port#</replaceable></option></arg>
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <arg><option>-q <replaceable class="parameter">name</replaceable></option></arg>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>name:key</replaceable></option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </cmdsynopsis>
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg choice="opt" rep="repeat">global-queryopt</arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </refsynopsisdiv>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff (domain information groper) is a flexible tool
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff for interrogating DNS name servers. It performs DNS lookups and
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff displays the answers that are returned from the name server(s) that
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff were queried. Most DNS administrators use <command>dig</command> to
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff troubleshoot DNS problems because of its flexibility, ease of use and
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff clarity of output. Other lookup tools tend to have less functionality
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Although <command>dig</command> is normally used with
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff arguments, it also has a batch mode of operation for reading lookup
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff requests from a file. A brief summary of its command-line arguments
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff and options is printed when the <option>-h</option> option is given.
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Unlike earlier versions, the BIND 9 implementation of
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <command>dig</command> allows multiple lookups to be issued
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff command line.
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff Unless it is told to query a specific name server,
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <command>dig</command> will try each of the servers listed
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff When no command line arguments or options are given,
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <command>dig</command> will perform an NS query for "." (the root).
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff It is possible to set per-user defaults for <command>dig</command> via
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <filename>${HOME}/.digrc</filename>. This file is read and
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff any options in it
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff are applied before the command line arguments.
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff The IN and CH class names overlap with the IN and CH top level
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff domains names. Either use the <option>-t</option> and
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <option>-c</option> options to specify the type and class,
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff use the <option>-q</option> the specify the domain name, or
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff use "IN." and "CH." when looking up these top level domains.
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff A typical invocation of <command>dig</command> looks like:
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <programlisting> dig @server name type </programlisting>
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <variablelist>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff <varlistentry>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff is the name or IP address of the name server to query. This can
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff address in dotted-decimal notation or an IPv6
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff address in colon-delimited notation. When the supplied
4e675038a097065ff13944232cd7c89ac5961984Michael Graff <command>dig</command> resolves that name before
4e675038a097065ff13944232cd7c89ac5961984Michael Graff querying that name
4e675038a097065ff13944232cd7c89ac5961984Michael Graff argument is provided,
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <command>dig</command> consults <filename>/etc/resolv.conf</filename>
4e675038a097065ff13944232cd7c89ac5961984Michael Graff and queries the name servers listed there. The reply from the
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff server that responds is displayed.
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff </varlistentry>
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff <varlistentry>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff is the name of the resource record that is to be looked up.
e24f605ad64182532640dc6721070456b13112d5Michael Graff </varlistentry>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff <varlistentry>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff indicates what type of query is required —
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff ANY, A, MX, SIG, etc.
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <parameter>type</parameter> can be any valid query
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <parameter>type</parameter> argument is supplied,
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <command>dig</command> will perform a lookup for an
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff </varlistentry>
e24f605ad64182532640dc6721070456b13112d5Michael Graff </variablelist>
e24f605ad64182532640dc6721070456b13112d5Michael Graff The <option>-b</option> option sets the source IP address of the query
e24f605ad64182532640dc6721070456b13112d5Michael Graff to <parameter>address</parameter>. This must be a valid
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff one of the host's network interfaces or "0.0.0.0" or "::". An optional
e24f605ad64182532640dc6721070456b13112d5Michael Graff may be specified by appending "#<port>"
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff The default query class (IN for internet) is overridden by the
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <option>-c</option> option. <parameter>class</parameter> is
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff class, such as HS for Hesiod records or CH for Chaosnet records.
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff The <option>-f</option> option makes <command>dig </command>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff in batch mode by reading a list of lookup requests to process from the
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff file <parameter>filename</parameter>. The file contains a
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff queries, one per line. Each entry in the file should be organized in
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff the same way they would be presented as queries to
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <command>dig</command> using the command-line interface.
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff The <option>-m</option> option enables memory usage debugging.
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <!-- It enables ISC_MEM_DEBUGTRACE and ISC_MEM_DEBUGRECORD
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence documented in include/isc/mem.h -->
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff If a non-standard port number is to be queried, the
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <option>-p</option> option is used. <parameter>port#</parameter> is
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence the port number that <command>dig</command> will send its
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff instead of the standard DNS port number 53. This option would be used
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff to test a name server that has been configured to listen for queries
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff on a non-standard port number.
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff The <option>-4</option> option forces <command>dig</command>
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff use IPv4 query transport. The <option>-6</option> option forces
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <command>dig</command> to only use IPv6 query transport.
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff The <option>-t</option> option sets the query type to
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <parameter>type</parameter>. It can be any valid query type
efe2f579ba6fbec4229129015780f2d925085b04Michael Graff supported in BIND 9. The default query type is "A", unless the
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff <option>-x</option> option is supplied to indicate a reverse lookup.
efe2f579ba6fbec4229129015780f2d925085b04Michael Graff A zone transfer can be requested by specifying a type of AXFR. When
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff an incremental zone transfer (IXFR) is required,
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <parameter>type</parameter> is set to <literal>ixfr=N</literal>.
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff The incremental zone transfer will contain the changes made to the zone
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff since the serial number in the zone's SOA record was
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff The <option>-q</option> option sets the query name to
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <parameter>name</parameter>. This useful do distinguish the
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <parameter>name</parameter> from other arguments.
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff Reverse lookups — mapping addresses to names — are simplified by the
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <option>-x</option> option. <parameter>addr</parameter> is
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff address in dotted-decimal notation, or a colon-delimited IPv6 address.
e24f605ad64182532640dc6721070456b13112d5Michael Graff When this option is used, there is no need to provide the
4e675038a097065ff13944232cd7c89ac5961984Michael Graff <parameter>name</parameter>, <parameter>class</parameter> and
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <parameter>type</parameter> arguments. <command>dig</command>
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff automatically performs a lookup for a name like
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <literal>11.12.13.10.in-addr.arpa</literal> and sets the
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff query type and
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff class to PTR and IN respectively. By default, IPv6 addresses are
e24f605ad64182532640dc6721070456b13112d5Michael Graff looked up using nibble format under the IP6.ARPA domain.
e24f605ad64182532640dc6721070456b13112d5Michael Graff To use the older RFC1886 method using the IP6.INT domain
e24f605ad64182532640dc6721070456b13112d5Michael Graff specify the <option>-i</option> option. Bit string labels (RFC2874)
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff are now experimental and are not attempted.
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff To sign the DNS queries sent by <command>dig</command> and
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff responses using transaction signatures (TSIG), specify a TSIG key file
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff using the <option>-k</option> option. You can also specify the TSIG
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff key itself on the command line using the <option>-y</option> option;
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <parameter>hmac</parameter> is the type of the TSIG, default HMAC-MD5,
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff <parameter>name</parameter> is the name of the TSIG key and