host.docbook revision dafcb997e390efa4423883dafd100c975c4095d6
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - Copyright (C) 2000-2002 Internet Software Consortium.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - Permission to use, copy, modify, and distribute this software for any
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - purpose with or without fee is hereby granted, provided that the above
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - PERFORMANCE OF THIS SOFTWARE.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews<!-- $Id: host.docbook,v 1.5 2004/03/05 04:57:30 marka Exp $ -->
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson</refentryinfo>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<refpurpose>DNS lookup utility</refpurpose>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<refsynopsisdiv>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson <arg><option>-N <replaceable class="parameter">ndots</replaceable></option></arg>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson <arg><option>-R <replaceable class="parameter">number</replaceable></option></arg>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson <arg><option>-W <replaceable class="parameter">wait</replaceable></option></arg>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson</refsynopsisdiv>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonis a simple utility for performing DNS lookups.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonIt is normally used to convert names to IP addresses and vice versa.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonWhen no arguments or options are given,
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonprints a short summary of its command line arguments and options.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<parameter>name</parameter> is the domain name that is to be looked
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonup. It can also be a dotted-decimal IPv4 address or a colon-delimited
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonIPv6 address, in which case <command>host</command> will by default
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonperform a reverse lookup for that address.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<parameter>server</parameter> is an optional argument which is either
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonthe name or IP address of the name server that <command>host</command>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonshould query instead of the server or servers listed in
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonThe <option>-a</option> (all) option is equivalent to setting the
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-v</option> option and asking <command>host</command> to make
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssona query of type ANY.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonWhen the <option>-C</option> option is used, <command>host</command>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonwill attempt to display the SOA records for zone
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<parameter>name</parameter> from all the listed authoritative name
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonservers for that zone. The list of name servers is defined by the NS
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonrecords that are found for the zone.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonThe <option>-c</option> option instructs to make a DNS query of class
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<parameter>class</parameter>. This can be used to lookup Hesiod or
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonChaosnet class resource records. The default class is IN (Internet).
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonVerbose output is generated by <command>host</command> when the
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-d</option> or <option>-v</option> option is used. The two
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonoptions are equivalent. They have been provided for backwards
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssoncompatibility. In previous versions, the <option>-d</option> option
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonswitched on debugging traces and <option>-v</option> enabled verbose
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonList mode is selected by the <option>-l</option> option. This makes
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<command>host</command> perform a zone transfer for zone
b8fff4f0d70bb9c5e53023ad0dae0acda67b5cdaMark Andrews<parameter>name</parameter>. Transfer the zone printing out the NS, PTR
b8fff4f0d70bb9c5e53023ad0dae0acda67b5cdaMark Andrewsand address records (A/AAAA). If combined with <option>-a</option>
b8fff4f0d70bb9c5e53023ad0dae0acda67b5cdaMark Andrewsall records will be printed.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonoption specifies that reverse lookups of IPv6 addresses should
ec3984e9df6fd9b7811daa0dacb1b3dd1423ebf3Mark Andrewsuse the IP6.INT domain as defined in RFC1886.
ec3984e9df6fd9b7811daa0dacb1b3dd1423ebf3Mark AndrewsThe default is to use IP6.ARPA.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonThe <option>-N</option> option sets the number of dots that have to be
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonin <parameter>name</parameter> for it to be considered absolute. The
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssondefault value is that defined using the ndots statement in
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<filename>/etc/resolv.conf</filename>, or 1 if no ndots statement is
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonpresent. Names with fewer dots are interpreted as relative names and
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonwill be searched for in the domains listed in the <type>search</type>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonThe number of UDP retries for a lookup can be changed with the
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-R</option> option. <parameter>number</parameter> indicates
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonhow many times <command>host</command> will repeat a query that does
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonnot get answered. The default number of retries is 1. If
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<parameter>number</parameter> is negative or zero, the number of
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonretries will default to 1.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonNon-recursive queries can be made via the <option>-r</option> option.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonSetting this option clears the <type>RD</type> — recursion
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssondesired — bit in the query which <command>host</command> makes.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonThis should mean that the name server receiving the query will not
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonattempt to resolve <parameter>name</parameter>. The
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-r</option> option enables <command>host</command> to mimic
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonthe behaviour of a name server by making non-recursive queries and
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonexpecting to receive answers to those queries that are usually
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonreferrals to other name servers.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonBy default <command>host</command> uses UDP when making queries. The
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-T</option> option makes it use a TCP connection when querying
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonthe name server. TCP will be automatically selected for queries that
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonrequire it, such as zone transfer (AXFR) requests.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonThe <option>-t</option> option is used to select the query type.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<parameter>type</parameter> can be any recognised query type: CNAME,
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonNS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<command>host</command> automatically selects an appropriate query
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssontype. By default it looks for A records, but if the
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-C</option> option was given, queries will be made for SOA
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonrecords, and if <parameter>name</parameter> is a dotted-decimal IPv4
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonaddress or colon-delimited IPv6 address, <command>host</command> will
b8fff4f0d70bb9c5e53023ad0dae0acda67b5cdaMark Andrewsquery for PTR records. If a query type of IXFR is chosen the starting
b8fff4f0d70bb9c5e53023ad0dae0acda67b5cdaMark Andrewsserial number can be specified by appending an equal followed by the
b8fff4f0d70bb9c5e53023ad0dae0acda67b5cdaMark Andrewsstarting serial number (e.g. -t IXFR=12345678).
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonThe time to wait for a reply can be controlled through the
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-W</option> and <option>-w</option> options. The
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-W</option> option makes <command>host</command> wait for
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<parameter>wait</parameter> seconds. If <parameter>wait</parameter>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonis less than one, the wait interval is set to one second. When the
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<option>-w</option> option is used, <command>host</command> will
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssoneffectively wait forever for a reply. The time to wait for a response
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonwill be set to the number of seconds given by the hardware's maximum
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonvalue for an integer quantity.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<refentrytitle>dig</refentrytitle><manvolnum>1</manvolnum>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson</citerefentry>,
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson</citerefentry>.