dig.docbook revision 16134801ce8fffbb6c42bb54d544c3397a45ad06
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews [<!ENTITY mdash "&#8212;">]>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<!--
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater - Copyright (C) 2004-2011, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington - Copyright (C) 2000-2003 Internet Software Consortium.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington -
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Permission to use, copy, modify, and/or distribute this software for any
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - purpose with or without fee is hereby granted, provided that the above
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - copyright notice and this permission notice appear in all copies.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - PERFORMANCE OF THIS SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein-->
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<!-- $Id: dig.docbook,v 1.51 2011/11/04 11:02:50 jreed Exp $ -->
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews<refentry id="man.dig">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refentryinfo>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <date>June 30, 2000</date>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </refentryinfo>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refmeta>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refentrytitle>dig</refentrytitle>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <manvolnum>1</manvolnum>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refmiscinfo>BIND9</refmiscinfo>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater </refmeta>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refnamediv>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <refname>dig</refname>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refpurpose>DNS lookup utility</refpurpose>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </refnamediv>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <docinfo>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <copyright>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2004</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2005</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2006</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2007</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2008</year>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <year>2009</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2010</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2011</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2013</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2014</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </copyright>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <copyright>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2000</year>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <year>2001</year>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <year>2002</year>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <year>2003</year>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <holder>Internet Software Consortium.</holder>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater </copyright>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater </docinfo>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <refsynopsisdiv>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <cmdsynopsis>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <command>dig</command>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <arg choice="opt">@server</arg>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <arg><option>-b <replaceable class="parameter">address</replaceable></option></arg>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <arg><option>-f <replaceable class="parameter">filename</replaceable></option></arg>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <arg><option>-k <replaceable class="parameter">filename</replaceable></option></arg>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <arg><option>-m</option></arg>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <arg><option>-p <replaceable class="parameter">port#</replaceable></option></arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg><option>-q <replaceable class="parameter">name</replaceable></option></arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>name:key</replaceable></option></arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg><option>-4</option></arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg><option>-6</option></arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg choice="opt">name</arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg choice="opt">type</arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg choice="opt">class</arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg choice="opt" rep="repeat">queryopt</arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </cmdsynopsis>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <cmdsynopsis>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <command>dig</command>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg><option>-h</option></arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </cmdsynopsis>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <cmdsynopsis>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <command>dig</command>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg choice="opt" rep="repeat">global-queryopt</arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <arg choice="opt" rep="repeat">query</arg>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </cmdsynopsis>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </refsynopsisdiv>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refsect1>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <title>DESCRIPTION</title>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para><command>dig</command>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (domain information groper) is a flexible tool
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein for interrogating DNS name servers. It performs DNS lookups and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein displays the answers that are returned from the name server(s) that
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein were queried. Most DNS administrators use <command>dig</command> to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein troubleshoot DNS problems because of its flexibility, ease of use and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein clarity of output. Other lookup tools tend to have less functionality
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein than <command>dig</command>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Although <command>dig</command> is normally used with
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein command-line
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein arguments, it also has a batch mode of operation for reading lookup
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein requests from a file. A brief summary of its command-line arguments
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein and options is printed when the <option>-h</option> option is given.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Unlike earlier versions, the BIND 9 implementation of
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <command>dig</command> allows multiple lookups to be issued
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein from the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein command line.
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Unless it is told to query a specific name server,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <command>dig</command> will try each of the servers listed in
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <filename>/etc/resolv.conf</filename>. If no usable server addresses
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein are found, <command>dig</command> will send the query to the local
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein host.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein When no command line arguments or options are given,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <command>dig</command> will perform an NS query for "." (the root).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein It is possible to set per-user defaults for <command>dig</command> via
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <filename>${HOME}/.digrc</filename>. This file is read and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein any options in it
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews are applied before the command line arguments.
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews </para>
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews <para>
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews The IN and CH class names overlap with the IN and CH top level
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews domain names. Either use the <option>-t</option> and
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews <option>-c</option> options to specify the type and class,
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews use the <option>-q</option> the specify the domain name, or
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews use "IN." and "CH." when looking up these top level domains.
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews </para>
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </refsect1>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refsect1>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <title>SIMPLE USAGE</title>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews A typical invocation of <command>dig</command> looks like:
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews <programlisting> dig @server name type </programlisting>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein where:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <variablelist>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <varlistentry>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <term><constant>server</constant></term>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <listitem>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein is the name or IP address of the name server to query. This
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein can be an IPv4 address in dotted-decimal notation or an IPv6
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein address in colon-delimited notation. When the supplied
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <parameter>server</parameter> argument is a hostname,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <command>dig</command> resolves that name before querying
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein that name server.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein If no <parameter>server</parameter> argument is
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein provided, <command>dig</command> consults
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews <filename>/etc/resolv.conf</filename>; if an
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews address is found there, it queries the name server at
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews that address. If either of the <option>-4</option> or
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews <option>-6</option> options are in use, then
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews only addresses for the corresponding transport
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews will be tried. If no usable addresses are found,
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews <command>dig</command> will send the query to the
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews local host. The reply from the name server that
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews responds is displayed.
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews </para>
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews </listitem>
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews </varlistentry>
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews <varlistentry>
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews <term><constant>name</constant></term>
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews <listitem>
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews <para>
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews is the name of the resource record that is to be looked up.
52ece689e0265f9a3e518de5b2539e749f6d35acMark Andrews </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </listitem>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </varlistentry>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <varlistentry>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <term><constant>type</constant></term>
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews <listitem>
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews <para>
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews indicates what type of query is required &mdash;
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews ANY, A, MX, SIG, etc.
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews <parameter>type</parameter> can be any valid query
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews type. If no
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <parameter>type</parameter> argument is supplied,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <command>dig</command> will perform a lookup for an
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein A record.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </listitem>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </varlistentry>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater </variablelist>
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater </para>
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater </refsect1>
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater <refsect1>
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater <title>OPTIONS</title>
1c51f79aba598e5e20bde66aea0237e347f6d5ceAutomatic Updater
1c51f79aba598e5e20bde66aea0237e347f6d5ceAutomatic Updater <para>
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater The <option>-b</option> option sets the source IP address of the query
1c51f79aba598e5e20bde66aea0237e347f6d5ceAutomatic Updater to <parameter>address</parameter>. This must be a valid
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater address on
6283056805887de88040698685b8e1936a1f7a2dAutomatic Updater one of the host's network interfaces or "0.0.0.0" or "::". An optional
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein port
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein may be specified by appending "#&lt;port&gt;"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein The default query class (IN for internet) is overridden by the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <option>-c</option> option. <parameter>class</parameter> is
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein any valid
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein class, such as HS for Hesiod records or CH for Chaosnet records.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater The <option>-f</option> option makes <command>dig </command>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater operate
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater in batch mode by reading a list of lookup requests to process from the
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater file <parameter>filename</parameter>. The file contains a
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater number of
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater queries, one per line. Each entry in the file should be organized in
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater the same way they would be presented as queries to
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <command>dig</command> using the command-line interface.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater </para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater The <option>-m</option> option enables memory usage debugging.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <!-- It enables ISC_MEM_DEBUGTRACE and ISC_MEM_DEBUGRECORD
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater documented in include/isc/mem.h -->
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater </para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater If a non-standard port number is to be queried, the
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <option>-p</option> option is used. <parameter>port#</parameter> is
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater the port number that <command>dig</command> will send its
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater queries
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater instead of the standard DNS port number 53. This option would be used
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater to test a name server that has been configured to listen for queries
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater on a non-standard port number.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater </para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater The <option>-4</option> option forces <command>dig</command>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater to only
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater use IPv4 query transport. The <option>-6</option> option forces
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <command>dig</command> to only use IPv6 query transport.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater </para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater The <option>-t</option> option sets the query type to
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <parameter>type</parameter>. It can be any valid query type
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater which is
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater supported in BIND 9. The default query type is "A", unless the
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <option>-x</option> option is supplied to indicate a reverse lookup.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater A zone transfer can be requested by specifying a type of AXFR. When
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater an incremental zone transfer (IXFR) is required,
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <parameter>type</parameter> is set to <literal>ixfr=N</literal>.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater The incremental zone transfer will contain the changes made to the zone
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater since the serial number in the zone's SOA record was
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <parameter>N</parameter>.
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater </para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <para>
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater The <option>-q</option> option sets the query name to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <parameter>name</parameter>. This is useful to distinguish the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <parameter>name</parameter> from other arguments.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Reverse lookups &mdash; mapping addresses to names &mdash; are simplified by the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <option>-x</option> option. <parameter>addr</parameter> is
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein an IPv4
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein address in dotted-decimal notation, or a colon-delimited IPv6 address.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein When this option is used, there is no need to provide the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <parameter>name</parameter>, <parameter>class</parameter> and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <parameter>type</parameter> arguments. <command>dig</command>
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater automatically performs a lookup for a name like
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater <literal>11.12.13.10.in-addr.arpa</literal> and sets the
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater query type and
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater class to PTR and IN respectively. By default, IPv6 addresses are
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater looked up using nibble format under the IP6.ARPA domain.
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater To use the older RFC1886 method using the IP6.INT domain
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater specify the <option>-i</option> option. Bit string labels (RFC2874)
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater are now experimental and are not attempted.
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater </para>
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater <para>
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater To sign the DNS queries sent by <command>dig</command> and
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater their
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater responses using transaction signatures (TSIG), specify a TSIG key file
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater using the <option>-k</option> option. You can also specify the TSIG
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater key itself on the command line using the <option>-y</option> option;
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater <parameter>hmac</parameter> is the type of the TSIG, default HMAC-MD5,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <parameter>name</parameter> is the name of the TSIG key and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <parameter>key</parameter> is the actual key. The key is a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein base-64
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein encoded string, typically generated by
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <citerefentry>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews </citerefentry>.
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews Caution should be taken when using the <option>-y</option> option on
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews multi-user systems as the key can be visible in the output from
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews <citerefentry>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </citerefentry>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein or in the shell's history file. When
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein using TSIG authentication with <command>dig</command>, the name
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater server that is queried needs to know the key and algorithm that is
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein being used. In BIND, this is done by providing appropriate
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <command>key</command> and <command>server</command> statements in
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews <filename>named.conf</filename>.
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews </para>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews </refsect1>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <refsect1>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews <title>QUERY OPTIONS</title>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews <para><command>dig</command>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews provides a number of query options which affect
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein the way in which lookups are made and the results displayed. Some of
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews these set or reset flag bits in the query header, some determine which
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein sections of the answer get printed, and others determine the timeout
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews and retry strategies.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews <para>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews Each query option is identified by a keyword preceded by a plus sign
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews (<literal>+</literal>). Some keywords set or reset an
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews option. These may be preceded
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews by the string <literal>no</literal> to negate the meaning of
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews that keyword. Other
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews keywords assign values to options like the timeout interval. They
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews have the form <option>+keyword=value</option>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein The query options are:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater <variablelist>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <varlistentry>
c6c78f699b55b3344fb6b17ddc854cbae4610468Automatic Updater <term><option>+[no]tcp</option></term>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <listitem>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Use [do not use] TCP when querying name servers. The default
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater behavior is to use UDP unless an AXFR or IXFR query is
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein requested, in
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein which case a TCP connection is used.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </para>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </listitem>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </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. This requests the server to return whether
all of the answer and authority sections have all
been validated as secure according to the security
policy of the server. AD=1 indicates that all records
have been validated as secure and the answer is not
from a OPT-OUT range. AD=0 indicate that some part
of the answer was insecure or not validated. This
bit is set by default.
</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>
<para>
<command>+dnssec</command> is also set when +trace is
set to better emulate the default queries from a nameserver.
</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]rrcomments</option></term>
<listitem>
<para>
Toggle the display of per-record comments in the output (for
example, human-readable key information about DNSKEY records).
The default is not to print record comments unless multiline
mode is active.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]crypto</option></term>
<listitem>
<para>
Toggle the display of cryptographic fields in DNSSEC records.
The contents of these field are unnecessary to debug most DNSSEC
validation failures and removing them makes it easier to see
the common failures. The default is to display the fields.
When omitted they are replaced by the string "[omitted]" or
in the DNSKEY case the key id is displayed as the replacement,
e.g. "[ key id = value ]".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+split=W</option></term>
<listitem>
<para>
Split long hex- or base64-formatted fields in resource
records into chunks of <parameter>W</parameter> characters
(where <parameter>W</parameter> is rounded up to the nearest
multiple of 4).
<parameter>+nosplit</parameter> or
<parameter>+split=0</parameter> causes fields not to be
split at all. The default is 56 characters, or 44 characters
when multiline mode is active.
</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. EDNS is set to
0 by default.
</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]onesoa</option></term>
<listitem>
<para>
Print only one (starting) SOA record when performing
an AXFR. The default is to print both the starting and
ending SOA records.
</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>
<varlistentry>
<term><option>+[no]keepopen</option></term>
<listitem>
<para>
Keep the TCP socket open between queries and reuse it rather
than creating a new TCP socket for each lookup. The default
is <option>+nokeepopen</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]sit<optional>=####</optional></option></term>
<listitem>
<para>
Send a Source Identity Token EDNS option, with optional value.
Replaying a SIT from a previous response will allow the
server to identify a previous client. The default is
<option>+nosit</option>. Currently using experimental value
65001 for the option code.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]subnet=addr/prefix</option></term>
<listitem>
<para>
Send an EDNS Client Subnet option with the speciifed
IP address or network prefix.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]expire</option></term>
<listitem>
<para>
Send an EDNS Expire option. Currently using experimental
value 65002 for the option code.
</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:
-->