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 "&#8212;">]>
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff<!--
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff - Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff - Copyright (C) 2000-2003 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence -
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 -
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.
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence-->
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff<!-- $Id: dig.docbook,v 1.42 2008/10/13 21:18:56 jreed Exp $ -->
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff<refentry id="man.dig">
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff <refentryinfo>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <date>Jun 30, 2000</date>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff </refentryinfo>
7df0472d8a76c83d2137bd9549414a30787d58cfBrian Wellington
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <refmeta>
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff <refentrytitle>dig</refentrytitle>
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff <manvolnum>1</manvolnum>
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff <refmiscinfo>BIND9</refmiscinfo>
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff </refmeta>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <refnamediv>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <refname>dig</refname>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <refpurpose>DNS lookup utility</refpurpose>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </refnamediv>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <docinfo>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <copyright>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <year>2004</year>
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <year>2005</year>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <year>2006</year>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <year>2007</year>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <year>2008</year>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </copyright>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <copyright>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <year>2000</year>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <year>2001</year>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <year>2002</year>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <year>2003</year>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <holder>Internet Software Consortium.</holder>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </copyright>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </docinfo>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <refsynopsisdiv>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <command>dig</command>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg choice="opt">@server</arg>
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>-m</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>
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence <arg><option>-4</option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg><option>-6</option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg choice="opt">name</arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg choice="opt">type</arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg choice="opt">class</arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg choice="opt" rep="repeat">queryopt</arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </cmdsynopsis>
58ff88cca7c169f7fbebc9b6e93bbba1fb345157Michael Graff
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <command>dig</command>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg><option>-h</option></arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <cmdsynopsis>
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <command>dig</command>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg choice="opt" rep="repeat">global-queryopt</arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <arg choice="opt" rep="repeat">query</arg>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </cmdsynopsis>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </refsynopsisdiv>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <refsect1>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <title>DESCRIPTION</title>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <para><command>dig</command>
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 than <command>dig</command>.
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </para>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <para>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Although <command>dig</command> is normally used with
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff command-line
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 from the
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff command line.
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff </para>
58ff88cca7c169f7fbebc9b6e93bbba1fb345157Michael Graff
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <para>
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 in
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <filename>/etc/resolv.conf</filename>.
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence </para>
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <para>
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 </para>
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <para>
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 </para>
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <para>
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 </para>
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff </refsect1>
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <refsect1>
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <title>SIMPLE USAGE</title>
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff <para>
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff A typical invocation of <command>dig</command> looks like:
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <programlisting> dig @server name type </programlisting>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff where:
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <variablelist>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff <varlistentry>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <term><constant>server</constant></term>
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff <listitem>
e24f605ad64182532640dc6721070456b13112d5Michael Graff <para>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff is the name or IP address of the name server to query. This can
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff be an IPv4
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff address in dotted-decimal notation or an IPv6
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff address in colon-delimited notation. When the supplied
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <parameter>server</parameter> argument is a
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff hostname,
4e675038a097065ff13944232cd7c89ac5961984Michael Graff <command>dig</command> resolves that name before
4e675038a097065ff13944232cd7c89ac5961984Michael Graff querying that name
4e675038a097065ff13944232cd7c89ac5961984Michael Graff server. If no <parameter>server</parameter>
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 name
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff server that responds is displayed.
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff </para>
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff </listitem>
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff </varlistentry>
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff <varlistentry>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff <term><constant>name</constant></term>
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff <listitem>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff <para>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff is the name of the resource record that is to be looked up.
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff </para>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff </listitem>
e24f605ad64182532640dc6721070456b13112d5Michael Graff </varlistentry>
e24f605ad64182532640dc6721070456b13112d5Michael Graff
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff <varlistentry>
e24f605ad64182532640dc6721070456b13112d5Michael Graff <term><constant>type</constant></term>
e24f605ad64182532640dc6721070456b13112d5Michael Graff <listitem>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff <para>
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff indicates what type of query is required &mdash;
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graff ANY, A, MX, SIG, etc.
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <parameter>type</parameter> can be any valid query
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff type. If no
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <parameter>type</parameter> argument is supplied,
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <command>dig</command> will perform a lookup for an
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff A record.
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence </para>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff </listitem>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff </varlistentry>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff
e24f605ad64182532640dc6721070456b13112d5Michael Graff </variablelist>
e24f605ad64182532640dc6721070456b13112d5Michael Graff </para>
e24f605ad64182532640dc6721070456b13112d5Michael Graff
e24f605ad64182532640dc6721070456b13112d5Michael Graff </refsect1>
e24f605ad64182532640dc6721070456b13112d5Michael Graff
e24f605ad64182532640dc6721070456b13112d5Michael Graff <refsect1>
e24f605ad64182532640dc6721070456b13112d5Michael Graff <title>OPTIONS</title>
e24f605ad64182532640dc6721070456b13112d5Michael Graff
e24f605ad64182532640dc6721070456b13112d5Michael Graff <para>
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
e24f605ad64182532640dc6721070456b13112d5Michael Graff address on
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff one of the host's network interfaces or "0.0.0.0" or "::". An optional
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff port
e24f605ad64182532640dc6721070456b13112d5Michael Graff may be specified by appending "#&lt;port&gt;"
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff </para>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <para>
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 any valid
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff class, such as HS for Hesiod records or CH for Chaosnet records.
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff </para>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <para>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff The <option>-f</option> option makes <command>dig </command>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff operate
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 number of
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.
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence </para>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff <para>
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 </para>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff <para>
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
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff queries
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.
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff </para>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <para>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff The <option>-4</option> option forces <command>dig</command>
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff to only
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 </para>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff <para>
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff The <option>-t</option> option sets the query type to
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff <parameter>type</parameter>. It can be any valid query type
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff which is
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 <parameter>N</parameter>.
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff </para>
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <para>
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 </para>
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <para>
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff Reverse lookups &mdash; mapping addresses to names &mdash; are simplified by the
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff <option>-x</option> option. <parameter>addr</parameter> is
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff an IPv4
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.
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff </para>
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff <para>
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff To sign the DNS queries sent by <command>dig</command> and
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff their
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
<parameter>key</parameter> is the actual key. The key is a
base-64
encoded string, typically generated by
<citerefentry>
<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>.
Caution should be taken when using the <option>-y</option> option on
multi-user systems as the key can be visible in the output from
<citerefentry>
<refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
</citerefentry>
or in the shell's history file. When
using TSIG authentication with <command>dig</command>, the name
server that is queried needs to know the key and algorithm that is
being used. In BIND, this is done by providing appropriate
<command>key</command> and <command>server</command> statements in
<filename>named.conf</filename>.
</para>
</refsect1>
<refsect1>
<title>QUERY OPTIONS</title>
<para><command>dig</command>
provides a number of query options which affect
the way in which lookups are made and the results displayed. Some of
these set or reset flag bits in the query header, some determine which
sections of the answer get printed, and others determine the timeout
and retry strategies.
</para>
<para>
Each query option is identified by a keyword preceded by a plus sign
(<literal>+</literal>). Some keywords set or reset an
option. These may be preceded
by the string <literal>no</literal> to negate the meaning of
that keyword. Other
keywords assign values to options like the timeout interval. They
have the form <option>+keyword=value</option>.
The query options are:
<variablelist>
<varlistentry>
<term><option>+[no]tcp</option></term>
<listitem>
<para>
Use [do not use] TCP when querying name servers. The default
behavior is to use UDP unless an AXFR or IXFR query is
requested, in
which case a TCP connection is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]vc</option></term>
<listitem>
<para>
Use [do not use] TCP when querying name servers. This alternate
syntax to <parameter>+[no]tcp</parameter> is
provided for backwards
compatibility. The "vc" stands for "virtual circuit".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]ignore</option></term>
<listitem>
<para>
Ignore truncation in UDP responses instead of retrying with TCP.
By
default, TCP retries are performed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+domain=somename</option></term>
<listitem>
<para>
Set the search list to contain the single domain
<parameter>somename</parameter>, as if specified in
a
<command>domain</command> directive in
<filename>/etc/resolv.conf</filename>, and enable
search list
processing as if the <parameter>+search</parameter>
option were given.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]search</option></term>
<listitem>
<para>
Use [do not use] the search list defined by the searchlist or
domain
directive in <filename>resolv.conf</filename> (if
any).
The search list is not used by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]showsearch</option></term>
<listitem>
<para>
Perform [do not perform] a search showing intermediate
results.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]defname</option></term>
<listitem>
<para>
Deprecated, treated as a synonym for <parameter>+[no]search</parameter>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]aaonly</option></term>
<listitem>
<para>
Sets the "aa" flag in the query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]aaflag</option></term>
<listitem>
<para>
A synonym for <parameter>+[no]aaonly</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]adflag</option></term>
<listitem>
<para>
Set [do not set] the AD (authentic data) bit in the query. The
AD bit
currently has a standard meaning only in responses, not in
queries,
but the ability to set the bit in the query is provided for
completeness.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]cdflag</option></term>
<listitem>
<para>
Set [do not set] the CD (checking disabled) bit in the query.
This
requests the server to not perform DNSSEC validation of
responses.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]cl</option></term>
<listitem>
<para>
Display [do not display] the CLASS when printing the record.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]ttlid</option></term>
<listitem>
<para>
Display [do not display] the TTL when printing the record.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]recurse</option></term>
<listitem>
<para>
Toggle the setting of the RD (recursion desired) bit in the
query.
This bit is set by default, which means <command>dig</command>
normally sends recursive queries. Recursion is automatically
disabled
when the <parameter>+nssearch</parameter> or
<parameter>+trace</parameter> query options are
used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]nssearch</option></term>
<listitem>
<para>
When this option is set, <command>dig</command>
attempts to find the
authoritative name servers for the zone containing the name
being
looked up and display the SOA record that each name server has
for the
zone.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]trace</option></term>
<listitem>
<para>
Toggle tracing of the delegation path from the root name servers
for
the name being looked up. Tracing is disabled by default. When
tracing is enabled, <command>dig</command> makes
iterative queries to
resolve the name being looked up. It will follow referrals from
the
root servers, showing the answer from each server that was used
to
resolve the lookup.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]cmd</option></term>
<listitem>
<para>
Toggles the printing of the initial comment in the output
identifying
the version of <command>dig</command> and the query
options that have
been applied. This comment is printed by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]short</option></term>
<listitem>
<para>
Provide a terse answer. The default is to print the answer in a
verbose form.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]identify</option></term>
<listitem>
<para>
Show [or do not show] the IP address and port number that
supplied the
answer when the <parameter>+short</parameter> option
is enabled. If
short form answers are requested, the default is not to show the
source address and port number of the server that provided the
answer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]comments</option></term>
<listitem>
<para>
Toggle the display of comment lines in the output. The default
is to
print comments.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]stats</option></term>
<listitem>
<para>
This query option toggles the printing of statistics: when the
query
was made, the size of the reply and so on. The default
behavior is
to print the query statistics.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]qr</option></term>
<listitem>
<para>
Print [do not print] the query as it is sent.
By default, the query is not printed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]question</option></term>
<listitem>
<para>
Print [do not print] the question section of a query when an
answer is
returned. The default is to print the question section as a
comment.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]answer</option></term>
<listitem>
<para>
Display [do not display] the answer section of a reply. The
default
is to display it.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]authority</option></term>
<listitem>
<para>
Display [do not display] the authority section of a reply. The
default is to display it.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]additional</option></term>
<listitem>
<para>
Display [do not display] the additional section of a reply.
The default is to display it.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]all</option></term>
<listitem>
<para>
Set or clear all display flags.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+time=T</option></term>
<listitem>
<para>
Sets the timeout for a query to
<parameter>T</parameter> seconds. The default
timeout is 5 seconds.
An attempt to set <parameter>T</parameter> to less
than 1 will result
in a query timeout of 1 second being applied.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+tries=T</option></term>
<listitem>
<para>
Sets the number of times to try UDP queries to server to
<parameter>T</parameter> instead of the default, 3.
If
<parameter>T</parameter> is less than or equal to
zero, the number of
tries is silently rounded up to 1.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+retry=T</option></term>
<listitem>
<para>
Sets the number of times to retry UDP queries to server to
<parameter>T</parameter> instead of the default, 2.
Unlike
<parameter>+tries</parameter>, this does not include
the initial
query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+ndots=D</option></term>
<listitem>
<para>
Set the number of dots that have to appear in
<parameter>name</parameter> to <parameter>D</parameter> for it to be
considered absolute. The default value is that defined using
the
ndots statement in <filename>/etc/resolv.conf</filename>, or 1 if no
ndots statement is present. Names with fewer dots are
interpreted as
relative names and will be searched for in the domains listed in
the
<option>search</option> or <option>domain</option> directive in
<filename>/etc/resolv.conf</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+bufsize=B</option></term>
<listitem>
<para>
Set the UDP message buffer size advertised using EDNS0 to
<parameter>B</parameter> bytes. The maximum and minimum sizes
of this buffer are 65535 and 0 respectively. Values outside
this range are rounded up or down appropriately.
Values other than zero will cause a EDNS query to be sent.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+edns=#</option></term>
<listitem>
<para>
Specify the EDNS version to query with. Valid values
are 0 to 255. Setting the EDNS version will cause a
EDNS query to be sent. <option>+noedns</option> clears the
remembered EDNS version.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]multiline</option></term>
<listitem>
<para>
Print records like the SOA records in a verbose multi-line
format with human-readable comments. The default is to print
each record on a single line, to facilitate machine parsing
of the <command>dig</command> output.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]fail</option></term>
<listitem>
<para>
Do not try the next server if you receive a SERVFAIL. The
default is
to not try the next server which is the reverse of normal stub
resolver
behavior.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]besteffort</option></term>
<listitem>
<para>
Attempt to display the contents of messages which are malformed.
The default is to not display malformed answers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]dnssec</option></term>
<listitem>
<para>
Requests DNSSEC records be sent by setting the DNSSEC OK bit
(DO)
in the OPT record in the additional section of the query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]sigchase</option></term>
<listitem>
<para>
Chase DNSSEC signature chains. Requires dig be compiled with
-DDIG_SIGCHASE.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+trusted-key=####</option></term>
<listitem>
<para>
Specifies a file containing trusted keys to be used with
<option>+sigchase</option>. Each DNSKEY record must be
on its own line.
</para>
<para>
If not specified <command>dig</command> will look for
<filename>/etc/trusted-key.key</filename> then
<filename>trusted-key.key</filename> in the current directory.
</para>
<para>
Requires dig be compiled with -DDIG_SIGCHASE.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]topdown</option></term>
<listitem>
<para>
When chasing DNSSEC signature chains perform a top-down
validation.
Requires dig be compiled with -DDIG_SIGCHASE.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]nsid</option></term>
<listitem>
<para>
Include an EDNS name server ID request when sending a query.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
<title>MULTIPLE QUERIES</title>
<para>
The BIND 9 implementation of <command>dig </command>
supports
specifying multiple queries on the command line (in addition to
supporting the <option>-f</option> batch file option). Each of those
queries can be supplied with its own set of flags, options and query
options.
</para>
<para>
In this case, each <parameter>query</parameter> argument
represent an
individual query in the command-line syntax described above. Each
consists of any of the standard options and flags, the name to be
looked up, an optional query type and class and any query options that
should be applied to that query.
</para>
<para>
A global set of query options, which should be applied to all queries,
can also be supplied. These global query options must precede the
first tuple of name, class, type, options, flags, and query options
supplied on the command line. Any global query options (except
the <option>+[no]cmd</option> option) can be
overridden by a query-specific set of query options. For example:
<programlisting>
dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
</programlisting>
shows how <command>dig</command> could be used from the
command line
to make three lookups: an ANY query for <literal>www.isc.org</literal>, a
reverse lookup of 127.0.0.1 and a query for the NS records of
<literal>isc.org</literal>.
A global query option of <parameter>+qr</parameter> is
applied, so
that <command>dig</command> shows the initial query it made
for each
lookup. The final query has a local query option of
<parameter>+noqr</parameter> which means that <command>dig</command>
will not print the initial query when it looks up the NS records for
<literal>isc.org</literal>.
</para>
</refsect1>
<refsect1>
<title>IDN SUPPORT</title>
<para>
If <command>dig</command> has been built with IDN (internationalized
domain name) support, it can accept and display non-ASCII domain names.
<command>dig</command> appropriately converts character encoding of
domain name before sending a request to DNS server or displaying a
reply from the server.
If you'd like to turn off the IDN support for some reason, defines
the <envar>IDN_DISABLE</envar> environment variable.
The IDN support is disabled if the variable is set when
<command>dig</command> runs.
</para>
</refsect1>
<refsect1>
<title>FILES</title>
<para><filename>/etc/resolv.conf</filename>
</para>
<para><filename>${HOME}/.digrc</filename>
</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para><citerefentry>
<refentrytitle>host</refentrytitle><manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>RFC1035</citetitle>.
</para>
</refsect1>
<refsect1>
<title>BUGS</title>
<para>
There are probably too many query options.
</para>
</refsect1>
</refentry><!--
- Local variables:
- mode: sgml
- End:
-->