host.docbook revision 67d01dcacb2051a03377c8ec5c0e36604c17aea5
2834197ede0bfaec5b57cb1666e0c21f76408570David Lawrence<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
0ba23b0a24e0c17ee50073789704edaeeae2c360Andreas Gustafsson "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson [<!ENTITY mdash "—">]>
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence - Copyright (C) 2004, 2005, 2007-2009, 2014 Internet Systems Consortium, Inc. ("ISC")
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson - Copyright (C) 2000-2002 Internet Software Consortium.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson - Permission to use, copy, modify, and/or distribute this software for any
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson - purpose with or without fee is hereby granted, provided that the above
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson - copyright notice and this permission notice appear in all copies.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson - PERFORMANCE OF THIS SOFTWARE.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <refentryinfo>
dbeb32261081835bb9ba44db68df5dfed0fda411Andreas Gustafsson </refentryinfo>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <refpurpose>DNS lookup utility</refpurpose>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
51b951ab2a5e45e6a3994d033fec9b68e1f07985Mark Andrews </copyright>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <holder>Internet Software Consortium.</holder>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <refsynopsisdiv>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson <arg><option>-N <replaceable class="parameter">ndots</replaceable></option></arg>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <arg><option>-R <replaceable class="parameter">number</replaceable></option></arg>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <arg><option>-W <replaceable class="parameter">wait</replaceable></option></arg>
e21d199dca95aff5d50f133d6b064309e209af00Brian Wellington <arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson </cmdsynopsis>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson </refsynopsisdiv>
51b951ab2a5e45e6a3994d033fec9b68e1f07985Mark Andrews is a simple utility for performing DNS lookups.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson It is normally used to convert names to IP addresses and vice versa.
cfab2f4e039052fd5c71f8de93a9510bec0581f9Andreas Gustafsson When no arguments or options are given,
e01ecff4b1562a24e6de7e9396c60e9dffdb78ceAndreas Gustafsson prints a short summary of its command line arguments and options.
4bc5101166ec97bf88448efb9a65da600e82040eAndreas Gustafsson <para><parameter>name</parameter> is the domain name that is to be
e240e36503adf4d2073adfee98fb17b5b9d10fddAndreas Gustafsson up. It can also be a dotted-decimal IPv4 address or a colon-delimited
51b951ab2a5e45e6a3994d033fec9b68e1f07985Mark Andrews IPv6 address, in which case <command>host</command> will by
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson perform a reverse lookup for that address.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <parameter>server</parameter> is an optional argument which
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson the name or IP address of the name server that <command>host</command>
51b951ab2a5e45e6a3994d033fec9b68e1f07985Mark Andrews should query instead of the server or servers listed in
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson The <option>-a</option> (all) option is equivalent to setting the
2cc3f128610eb9e42d7c386160665583b63882bfAndreas Gustafsson <option>-v</option> option and asking <command>host</command> to make
2cc3f128610eb9e42d7c386160665583b63882bfAndreas Gustafsson a query of type ANY.
d2148c21700b9739ef125a49897288ad2636f706Andreas Gustafsson When the <option>-C</option> option is used, <command>host</command>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson will attempt to display the SOA records for zone
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <parameter>name</parameter> from all the listed
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson authoritative name
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson servers for that zone. The list of name servers is defined by the NS
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson records that are found for the zone.
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson The <option>-c</option> option instructs to make a DNS query of class
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <parameter>class</parameter>. This can be used to lookup
4034406393893f4d07ab07b56da3541155493855Andreas Gustafsson Chaosnet class resource records. The default class is IN (Internet).
c011a692803976aa5100f7a4e6a1fa8a1ea2c3f3Andreas Gustafsson Verbose output is generated by <command>host</command> when
4bc5101166ec97bf88448efb9a65da600e82040eAndreas Gustafsson <option>-d</option> or <option>-v</option> option is used. The two
e240e36503adf4d2073adfee98fb17b5b9d10fddAndreas Gustafsson options are equivalent. They have been provided for backwards
4bc5101166ec97bf88448efb9a65da600e82040eAndreas Gustafsson compatibility. In previous versions, the <option>-d</option> option
e01ecff4b1562a24e6de7e9396c60e9dffdb78ceAndreas Gustafsson switched on debugging traces and <option>-v</option> enabled verbose
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson List mode is selected by the <option>-l</option> option. This makes
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <command>host</command> perform a zone transfer for zone
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence <parameter>name</parameter>. Transfer the zone printing out
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson and address records (A/AAAA). If combined with <option>-a</option>
4334d2e8a16c4e154e8eb6fb7c7c8e8862771c8cBrian Wellington all records will be printed.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson option specifies that reverse lookups of IPv6 addresses should
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson use the IP6.INT domain as defined in RFC1886.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson The default is to use IP6.ARPA.
717e2cf05b12506b40eb03f42ea963c30c7e9f97Brian Wellington The <option>-N</option> option sets the number of dots that have to be
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson in <parameter>name</parameter> for it to be considered
d2148c21700b9739ef125a49897288ad2636f706Andreas Gustafsson default value is that defined using the ndots statement in
e54683130c25e85ab63dde3e8d14578a59479825Brian Wellington <filename>/etc/resolv.conf</filename>, or 1 if no ndots
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson present. Names with fewer dots are interpreted as relative names and
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence will be searched for in the domains listed in the <type>search</type>
4334d2e8a16c4e154e8eb6fb7c7c8e8862771c8cBrian Wellington The number of UDP retries for a lookup can be changed with the
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <option>-R</option> option. <parameter>number</parameter>
7eabdeaeeebf4be93de87af803d020d380eb7273Andreas Gustafsson how many times <command>host</command> will repeat a query
38e62f7bfbe301b4718bc9e8525bf141cc080e71Andreas Gustafsson not get answered. The default number of retries is 1. If
cbe5f076ba5595c3d63daa223ea373bef55561b2Andreas Gustafsson <parameter>number</parameter> is negative or zero, the
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson retries will default to 1.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson Non-recursive queries can be made via the <option>-r</option> option.
717e2cf05b12506b40eb03f42ea963c30c7e9f97Brian Wellington Setting this option clears the <type>RD</type> — recursion
717e2cf05b12506b40eb03f42ea963c30c7e9f97Brian Wellington desired — bit in the query which <command>host</command> makes.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson This should mean that the name server receiving the query will not
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson attempt to resolve <parameter>name</parameter>. The
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <option>-r</option> option enables <command>host</command>
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson the behavior of a name server by making non-recursive queries and
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson expecting to receive answers to those queries that are usually
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson referrals to other name servers.
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson By default, <command>host</command> uses UDP when making
51b951ab2a5e45e6a3994d033fec9b68e1f07985Mark Andrews queries. The
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson <option>-T</option> option makes it use a TCP connection when querying
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson the name server. TCP will be automatically selected for queries that
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson require it, such as zone transfer (AXFR) requests.
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson The <option>-4</option> option forces <command>host</command> to only
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson use IPv4 query transport. The <option>-6</option> option forces
335a4599898f181f18b618a5ac4fe4e083ecd308Andreas Gustafsson <command>host</command> to only use IPv6 query transport.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence The <option>-t</option> option is used to select the query type.
4334d2e8a16c4e154e8eb6fb7c7c8e8862771c8cBrian Wellington <parameter>type</parameter> can be any recognized query
4334d2e8a16c4e154e8eb6fb7c7c8e8862771c8cBrian Wellington NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <command>host</command> automatically selects an appropriate
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence type. By default, it looks for A, AAAA, and MX records, but if the
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <option>-C</option> option was given, queries will be made for SOA
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson records, and if <parameter>name</parameter> is a
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson dotted-decimal IPv4
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson address or colon-delimited IPv6 address, <command>host</command> will
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson query for PTR records. If a query type of IXFR is chosen the starting
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson serial number can be specified by appending an equal followed by the
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson starting serial number (e.g. -t IXFR=12345678).
717e2cf05b12506b40eb03f42ea963c30c7e9f97Brian Wellington The time to wait for a reply can be controlled through the
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson <option>-W</option> and <option>-w</option> options. The
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson <option>-W</option> option makes <command>host</command>
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson <parameter>wait</parameter> seconds. If <parameter>wait</parameter>
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson is less than one, the wait interval is set to one second. When the
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson <option>-w</option> option is used, <command>host</command>
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson effectively wait forever for a reply. The time to wait for a response
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson will be set to the number of seconds given by the hardware's maximum
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson value for an integer quantity.
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson The <option>-s</option> option tells <command>host</command>
7cd4c3ddd1baf5f2b204562fdba3da37c716cc78Andreas Gustafsson <emphasis>not</emphasis> to send the query to the next nameserver
7cd4c3ddd1baf5f2b204562fdba3da37c716cc78Andreas Gustafsson if any server responds with a SERVFAIL response, which is the
19ab334c3f47db2550ff6ad13bbab67ff4090139Andreas Gustafsson reverse of normal stub resolver behavior.
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson The <option>-m</option> can be used to set the memory usage debugging
113251976d99be74da788bdb78300957b77a1381Andreas Gustafsson <parameter>record</parameter>, <parameter>usage</parameter> and
98c7e0d8ba881f06f56716d6f7098d54643f4f2fAndreas Gustafsson The <option>-V</option> option causes <command>host</command>
98c7e0d8ba881f06f56716d6f7098d54643f4f2fAndreas Gustafsson to print the version number and exit.