dig.docbook revision d4f032db535ad5194d442fec535123f269422055
03831d35f7499c87d51205817c93e9a8d42c4baestevel<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
03831d35f7499c87d51205817c93e9a8d42c4baestevel "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
03831d35f7499c87d51205817c93e9a8d42c4baestevel [<!ENTITY mdash "—">]>
03831d35f7499c87d51205817c93e9a8d42c4baestevel - Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
03831d35f7499c87d51205817c93e9a8d42c4baestevel - Copyright (C) 2000-2003 Internet Software Consortium.
03831d35f7499c87d51205817c93e9a8d42c4baestevel - Permission to use, copy, modify, and/or distribute this software for any
03831d35f7499c87d51205817c93e9a8d42c4baestevel - purpose with or without fee is hereby granted, provided that the above
03831d35f7499c87d51205817c93e9a8d42c4baestevel - copyright notice and this permission notice appear in all copies.
03831d35f7499c87d51205817c93e9a8d42c4baestevel - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
03831d35f7499c87d51205817c93e9a8d42c4baestevel - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
03831d35f7499c87d51205817c93e9a8d42c4baestevel - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
03831d35f7499c87d51205817c93e9a8d42c4baestevel - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
03831d35f7499c87d51205817c93e9a8d42c4baestevel - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
03831d35f7499c87d51205817c93e9a8d42c4baestevel - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
03831d35f7499c87d51205817c93e9a8d42c4baestevel - PERFORMANCE OF THIS SOFTWARE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel<!-- $Id: dig.docbook,v 1.41 2008/10/03 00:55:33 jreed Exp $ -->
03831d35f7499c87d51205817c93e9a8d42c4baestevel <refentryinfo>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </refentryinfo>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <refnamediv>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </refnamediv>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <copyright>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </copyright>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <copyright>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </copyright>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <refsynopsisdiv>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <cmdsynopsis>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-b <replaceable class="parameter">address</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-f <replaceable class="parameter">filename</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-k <replaceable class="parameter">filename</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-p <replaceable class="parameter">port#</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-q <replaceable class="parameter">name</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>name:key</replaceable></option></arg>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </cmdsynopsis>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <cmdsynopsis>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </cmdsynopsis>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <cmdsynopsis>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </cmdsynopsis>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </refsynopsisdiv>
03831d35f7499c87d51205817c93e9a8d42c4baestevel (domain information groper) is a flexible tool
03831d35f7499c87d51205817c93e9a8d42c4baestevel for interrogating DNS name servers. It performs DNS lookups and
03831d35f7499c87d51205817c93e9a8d42c4baestevel displays the answers that are returned from the name server(s) that
03831d35f7499c87d51205817c93e9a8d42c4baestevel were queried. Most DNS administrators use <command>dig</command> to
03831d35f7499c87d51205817c93e9a8d42c4baestevel troubleshoot DNS problems because of its flexibility, ease of use and
03831d35f7499c87d51205817c93e9a8d42c4baestevel clarity of output. Other lookup tools tend to have less functionality
03831d35f7499c87d51205817c93e9a8d42c4baestevel Although <command>dig</command> is normally used with
03831d35f7499c87d51205817c93e9a8d42c4baestevel command-line
03831d35f7499c87d51205817c93e9a8d42c4baestevel arguments, it also has a batch mode of operation for reading lookup
03831d35f7499c87d51205817c93e9a8d42c4baestevel requests from a file. A brief summary of its command-line arguments
03831d35f7499c87d51205817c93e9a8d42c4baestevel and options is printed when the <option>-h</option> option is given.
03831d35f7499c87d51205817c93e9a8d42c4baestevel Unlike earlier versions, the BIND 9 implementation of
03831d35f7499c87d51205817c93e9a8d42c4baestevel <command>dig</command> allows multiple lookups to be issued
03831d35f7499c87d51205817c93e9a8d42c4baestevel command line.
03831d35f7499c87d51205817c93e9a8d42c4baestevel Unless it is told to query a specific name server,
03831d35f7499c87d51205817c93e9a8d42c4baestevel <command>dig</command> will try each of the servers listed
03831d35f7499c87d51205817c93e9a8d42c4baestevel When no command line arguments or options are given,
03831d35f7499c87d51205817c93e9a8d42c4baestevel <command>dig</command> will perform an NS query for "." (the root).
03831d35f7499c87d51205817c93e9a8d42c4baestevel It is possible to set per-user defaults for <command>dig</command> via
03831d35f7499c87d51205817c93e9a8d42c4baestevel <filename>${HOME}/.digrc</filename>. This file is read and
03831d35f7499c87d51205817c93e9a8d42c4baestevel any options in it
03831d35f7499c87d51205817c93e9a8d42c4baestevel are applied before the command line arguments.
03831d35f7499c87d51205817c93e9a8d42c4baestevel The IN and CH class names overlap with the IN and CH top level
03831d35f7499c87d51205817c93e9a8d42c4baestevel domains names. Either use the <option>-t</option> and
03831d35f7499c87d51205817c93e9a8d42c4baestevel <option>-c</option> options to specify the type and class,
03831d35f7499c87d51205817c93e9a8d42c4baestevel use the <option>-q</option> the specify the domain name, or
03831d35f7499c87d51205817c93e9a8d42c4baestevel use "IN." and "CH." when looking up these top level domains.
03831d35f7499c87d51205817c93e9a8d42c4baestevel </refsect1>
03831d35f7499c87d51205817c93e9a8d42c4baestevel A typical invocation of <command>dig</command> looks like:
03831d35f7499c87d51205817c93e9a8d42c4baestevel <programlisting> dig @server name type </programlisting>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <variablelist>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <varlistentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel is the name or IP address of the name server to query. This can
03831d35f7499c87d51205817c93e9a8d42c4baestevel address in dotted-decimal notation or an IPv6
03831d35f7499c87d51205817c93e9a8d42c4baestevel address in colon-delimited notation. When the supplied
03831d35f7499c87d51205817c93e9a8d42c4baestevel querying that name
03831d35f7499c87d51205817c93e9a8d42c4baestevel argument is provided,
03831d35f7499c87d51205817c93e9a8d42c4baestevel <command>dig</command> consults <filename>/etc/resolv.conf</filename>
03831d35f7499c87d51205817c93e9a8d42c4baestevel and queries the name servers listed there. The reply from the
03831d35f7499c87d51205817c93e9a8d42c4baestevel server that responds is displayed.
03831d35f7499c87d51205817c93e9a8d42c4baestevel </listitem>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </varlistentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <varlistentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel is the name of the resource record that is to be looked up.
03831d35f7499c87d51205817c93e9a8d42c4baestevel </listitem>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </varlistentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <varlistentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel indicates what type of query is required —
03831d35f7499c87d51205817c93e9a8d42c4baestevel ANY, A, MX, SIG, etc.
03831d35f7499c87d51205817c93e9a8d42c4baestevel type. If no
03831d35f7499c87d51205817c93e9a8d42c4baestevel </listitem>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </varlistentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </variablelist>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </refsect1>
03831d35f7499c87d51205817c93e9a8d42c4baestevel The <option>-b</option> option sets the source IP address of the query
03831d35f7499c87d51205817c93e9a8d42c4baestevel to <parameter>address</parameter>. This must be a valid
03831d35f7499c87d51205817c93e9a8d42c4baestevel one of the host's network interfaces or "0.0.0.0" or "::". An optional
03831d35f7499c87d51205817c93e9a8d42c4baestevel may be specified by appending "#<port>"
03831d35f7499c87d51205817c93e9a8d42c4baestevel The default query class (IN for internet) is overridden by the
03831d35f7499c87d51205817c93e9a8d42c4baestevel <option>-c</option> option. <parameter>class</parameter> is
03831d35f7499c87d51205817c93e9a8d42c4baestevel class, such as HS for Hesiod records or CH for Chaosnet records.
03831d35f7499c87d51205817c93e9a8d42c4baestevel The <option>-f</option> option makes <command>dig </command>
03831d35f7499c87d51205817c93e9a8d42c4baestevel in batch mode by reading a list of lookup requests to process from the
03831d35f7499c87d51205817c93e9a8d42c4baestevel file <parameter>filename</parameter>. The file contains a
03831d35f7499c87d51205817c93e9a8d42c4baestevel queries, one per line. Each entry in the file should be organized in
03831d35f7499c87d51205817c93e9a8d42c4baestevel the same way they would be presented as queries to
03831d35f7499c87d51205817c93e9a8d42c4baestevel <command>dig</command> using the command-line interface.
03831d35f7499c87d51205817c93e9a8d42c4baestevel If a non-standard port number is to be queried, the
03831d35f7499c87d51205817c93e9a8d42c4baestevel <option>-p</option> option is used. <parameter>port#</parameter> is
03831d35f7499c87d51205817c93e9a8d42c4baestevel the port number that <command>dig</command> will send its
03831d35f7499c87d51205817c93e9a8d42c4baestevel instead of the standard DNS port number 53. This option would be used
03831d35f7499c87d51205817c93e9a8d42c4baestevel to test a name server that has been configured to listen for queries
03831d35f7499c87d51205817c93e9a8d42c4baestevel on a non-standard port number.
03831d35f7499c87d51205817c93e9a8d42c4baestevel The <option>-4</option> option forces <command>dig</command>
03831d35f7499c87d51205817c93e9a8d42c4baestevel use IPv4 query transport. The <option>-6</option> option forces
03831d35f7499c87d51205817c93e9a8d42c4baestevel <command>dig</command> to only use IPv6 query transport.
03831d35f7499c87d51205817c93e9a8d42c4baestevel The <option>-t</option> option sets the query type to
03831d35f7499c87d51205817c93e9a8d42c4baestevel <parameter>type</parameter>. It can be any valid query type
03831d35f7499c87d51205817c93e9a8d42c4baestevel supported in BIND 9. The default query type is "A", unless the
03831d35f7499c87d51205817c93e9a8d42c4baestevel <option>-x</option> option is supplied to indicate a reverse lookup.
03831d35f7499c87d51205817c93e9a8d42c4baestevel A zone transfer can be requested by specifying a type of AXFR. When
03831d35f7499c87d51205817c93e9a8d42c4baestevel an incremental zone transfer (IXFR) is required,
03831d35f7499c87d51205817c93e9a8d42c4baestevel <parameter>type</parameter> is set to <literal>ixfr=N</literal>.
03831d35f7499c87d51205817c93e9a8d42c4baestevel The incremental zone transfer will contain the changes made to the zone
03831d35f7499c87d51205817c93e9a8d42c4baestevel since the serial number in the zone's SOA record was
03831d35f7499c87d51205817c93e9a8d42c4baestevel The <option>-q</option> option sets the query name to
03831d35f7499c87d51205817c93e9a8d42c4baestevel <parameter>name</parameter>. This useful do distinguish the
03831d35f7499c87d51205817c93e9a8d42c4baestevel Reverse lookups — mapping addresses to names — are simplified by the
03831d35f7499c87d51205817c93e9a8d42c4baestevel <option>-x</option> option. <parameter>addr</parameter> is
03831d35f7499c87d51205817c93e9a8d42c4baestevel address in dotted-decimal notation, or a colon-delimited IPv6 address.
03831d35f7499c87d51205817c93e9a8d42c4baestevel When this option is used, there is no need to provide the
03831d35f7499c87d51205817c93e9a8d42c4baestevel <parameter>name</parameter>, <parameter>class</parameter> and
03831d35f7499c87d51205817c93e9a8d42c4baestevel <parameter>type</parameter> arguments. <command>dig</command>
03831d35f7499c87d51205817c93e9a8d42c4baestevel automatically performs a lookup for a name like
03831d35f7499c87d51205817c93e9a8d42c4baestevel <literal>11.12.13.10.in-addr.arpa</literal> and sets the
03831d35f7499c87d51205817c93e9a8d42c4baestevel query type and
03831d35f7499c87d51205817c93e9a8d42c4baestevel class to PTR and IN respectively. By default, IPv6 addresses are
03831d35f7499c87d51205817c93e9a8d42c4baestevel looked up using nibble format under the IP6.ARPA domain.
03831d35f7499c87d51205817c93e9a8d42c4baestevel To use the older RFC1886 method using the IP6.INT domain
03831d35f7499c87d51205817c93e9a8d42c4baestevel specify the <option>-i</option> option. Bit string labels (RFC2874)
03831d35f7499c87d51205817c93e9a8d42c4baestevel are now experimental and are not attempted.
03831d35f7499c87d51205817c93e9a8d42c4baestevel To sign the DNS queries sent by <command>dig</command> and
03831d35f7499c87d51205817c93e9a8d42c4baestevel responses using transaction signatures (TSIG), specify a TSIG key file
03831d35f7499c87d51205817c93e9a8d42c4baestevel using the <option>-k</option> option. You can also specify the TSIG
03831d35f7499c87d51205817c93e9a8d42c4baestevel key itself on the command line using the <option>-y</option> option;
03831d35f7499c87d51205817c93e9a8d42c4baestevel <parameter>hmac</parameter> is the type of the TSIG, default HMAC-MD5,
03831d35f7499c87d51205817c93e9a8d42c4baestevel <parameter>name</parameter> is the name of the TSIG key and
03831d35f7499c87d51205817c93e9a8d42c4baestevel <parameter>key</parameter> is the actual key. The key is a
03831d35f7499c87d51205817c93e9a8d42c4baestevel encoded string, typically generated by
03831d35f7499c87d51205817c93e9a8d42c4baestevel <citerefentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </citerefentry>.
03831d35f7499c87d51205817c93e9a8d42c4baestevel Caution should be taken when using the <option>-y</option> option on
03831d35f7499c87d51205817c93e9a8d42c4baestevel multi-user systems as the key can be visible in the output from
03831d35f7499c87d51205817c93e9a8d42c4baestevel <citerefentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
03831d35f7499c87d51205817c93e9a8d42c4baestevel </citerefentry>
03831d35f7499c87d51205817c93e9a8d42c4baestevel or in the shell's history file. When
03831d35f7499c87d51205817c93e9a8d42c4baestevel using TSIG authentication with <command>dig</command>, the name
03831d35f7499c87d51205817c93e9a8d42c4baestevel server that is queried needs to know the key and algorithm that is
03831d35f7499c87d51205817c93e9a8d42c4baestevel being used. In BIND, this is done by providing appropriate
03831d35f7499c87d51205817c93e9a8d42c4baestevel <command>key</command> and <command>server</command> statements in
03831d35f7499c87d51205817c93e9a8d42c4baestevel </refsect1>
03831d35f7499c87d51205817c93e9a8d42c4baestevel provides a number of query options which affect
03831d35f7499c87d51205817c93e9a8d42c4baestevel the way in which lookups are made and the results displayed. Some of
03831d35f7499c87d51205817c93e9a8d42c4baestevel these set or reset flag bits in the query header, some determine which
03831d35f7499c87d51205817c93e9a8d42c4baestevel sections of the answer get printed, and others determine the timeout
03831d35f7499c87d51205817c93e9a8d42c4baestevel and retry strategies.
03831d35f7499c87d51205817c93e9a8d42c4baestevel Each query option is identified by a keyword preceded by a plus sign
03831d35f7499c87d51205817c93e9a8d42c4baestevel (<literal>+</literal>). Some keywords set or reset an