host.docbook revision 51eba00c8f281eda4daac725c0c7d1373a93a5aa
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - Copyright (C) 2000, 2001 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.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<!-- $Id: host.docbook,v 1.1 2001/06/08 16:38:10 gson 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
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<parameter>name</parameter>. The argument is provided for
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssoncompatibility with older implemementations. This option is equivalent
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonto making a query of type AXFR.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonoption specifies that reverse lookups of IPv6 addresses should
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonuse the IP6.INT domain and "nibble" labels as defined in RFC1886.
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas GustafssonThe default is to use IP6.ARPA and binary labels as defined in RFC2874.
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
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafssonquery for PTR records.
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>resolver</refentrytitle><manvolnum>5</manvolnum>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson</citerefentry>,
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
51eba00c8f281eda4daac725c0c7d1373a93a5aaAndreas Gustafsson</citerefentry>.