host.docbook revision f9f11eb54be19b7deedf3978496f71d81432a5ee
333fe280eb574439ef3f828d8755dd9e243ec855Andreas Gustafsson<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson [<!ENTITY mdash "—">]>
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson - Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews - Copyright (C) 2000-2002 Internet Software Consortium.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - Permission to use, copy, modify, and/or distribute this software for any
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - purpose with or without fee is hereby granted, provided that the above
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - copyright notice and this permission notice appear in all copies.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
97bb3725292d3f74bcb0a32be6a76b2da34ba494Andreas Gustafsson - PERFORMANCE OF THIS SOFTWARE.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson<!-- $Id: host.docbook,v 1.19 2009/01/20 20:06:29 jreed Exp $ -->
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <refentryinfo>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson </refentryinfo>
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews <refnamediv>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <refpurpose>DNS lookup utility</refpurpose>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <refsynopsisdiv>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <arg><option>-N <replaceable class="parameter">ndots</replaceable></option></arg>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <arg><option>-R <replaceable class="parameter">number</replaceable></option></arg>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <arg><option>-W <replaceable class="parameter">wait</replaceable></option></arg>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson </cmdsynopsis>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson </refsynopsisdiv>
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson is a simple utility for performing DNS lookups.
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews It is normally used to convert names to IP addresses and vice versa.
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews When no arguments or options are given,
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews prints a short summary of its command line arguments and options.
f9cdef0ba5cd21db91318f290c25b0ab3d28f3dfMark Andrews <para><parameter>name</parameter> is the domain name that is to be
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson up. It can also be a dotted-decimal IPv4 address or a colon-delimited
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson IPv6 address, in which case <command>host</command> will by
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson perform a reverse lookup for that address.
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson <parameter>server</parameter> is an optional argument which
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson the name or IP address of the name server that <command>host</command>
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson should query instead of the server or servers listed in
97bb3725292d3f74bcb0a32be6a76b2da34ba494Andreas Gustafsson The <option>-a</option> (all) option is equivalent to setting the
97bb3725292d3f74bcb0a32be6a76b2da34ba494Andreas Gustafsson <option>-v</option> option and asking <command>host</command> to make
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson a query of type ANY.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson When the <option>-C</option> option is used, <command>host</command>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson will attempt to display the SOA records for zone
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <parameter>name</parameter> from all the listed
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson authoritative name
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson servers for that zone. The list of name servers is defined by the NS
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson records that are found for the zone.
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews The <option>-c</option> option instructs to make a DNS query of class
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews <parameter>class</parameter>. This can be used to lookup
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews Chaosnet class resource records. The default class is IN (Internet).
e1cbf95aec7cb11a66285ccbffa552c501d2ac3cMark Andrews Verbose output is generated by <command>host</command> when
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson <option>-d</option> or <option>-v</option> option is used. The two
4034406393893f4d07ab07b56da3541155493855Andreas Gustafsson options are equivalent. They have been provided for backwards
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson compatibility. In previous versions, the <option>-d</option> option
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson switched on debugging traces and <option>-v</option> enabled verbose
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson List mode is selected by the <option>-l</option> option. This makes
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews <command>host</command> perform a zone transfer for zone
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews <parameter>name</parameter>. Transfer the zone printing out
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson and address records (A/AAAA). If combined with <option>-a</option>
20d0c8c5bb06be9925d568adce9a031e08ef7172Andreas Gustafsson all records will be printed.
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson option specifies that reverse lookups of IPv6 addresses should
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson use the IP6.INT domain as defined in RFC1886.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson The default is to use IP6.ARPA.
250ed9e230b3903b1b264dd1ed2f691fc7cd2f8fAndreas Gustafsson 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
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson default value is that defined using the ndots statement in
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <filename>/etc/resolv.conf</filename>, or 1 if no ndots
20d0c8c5bb06be9925d568adce9a031e08ef7172Andreas Gustafsson present. Names with fewer dots are interpreted as relative names and
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson will be searched for in the domains listed in the <type>search</type>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson The number of UDP retries for a lookup can be changed with the
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <option>-R</option> option. <parameter>number</parameter>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson how many times <command>host</command> will repeat a query
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews not get answered. The default number of retries is 1. If
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <parameter>number</parameter> is negative or zero, the
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson retries will default to 1.
f9cdef0ba5cd21db91318f290c25b0ab3d28f3dfMark Andrews Non-recursive queries can be made via the <option>-r</option> option.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson Setting this option clears the <type>RD</type> — recursion
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson desired — bit in the query which <command>host</command> makes.
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson This should mean that the name server receiving the query will not
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson attempt to resolve <parameter>name</parameter>. The
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <option>-r</option> option enables <command>host</command>
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson the behavior of a name server by making non-recursive queries and
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson expecting to receive answers to those queries that are usually
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson referrals to other name servers.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson By default, <command>host</command> uses UDP when making
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson <option>-T</option> option makes it use a TCP connection when querying
97bb3725292d3f74bcb0a32be6a76b2da34ba494Andreas Gustafsson the name server. TCP will be automatically selected for queries that
97bb3725292d3f74bcb0a32be6a76b2da34ba494Andreas Gustafsson require it, such as zone transfer (AXFR) requests.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson The <option>-4</option> option forces <command>host</command> to only
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson use IPv4 query transport. The <option>-6</option> option forces
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <command>host</command> to only use IPv6 query transport.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson The <option>-t</option> option is used to select the query type.
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews <parameter>type</parameter> can be any recognized query
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews <command>host</command> automatically selects an appropriate
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews type. By default, it looks for A, AAAA, and MX records, but if the
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews <option>-C</option> option was given, queries will be made for SOA
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews records, and if <parameter>name</parameter> is a
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews dotted-decimal IPv4
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews address or colon-delimited IPv6 address, <command>host</command> will
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews query for PTR records. If a query type of IXFR is chosen the starting
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson serial number can be specified by appending an equal followed by the
e1cbf95aec7cb11a66285ccbffa552c501d2ac3cMark Andrews starting serial number (e.g. -t IXFR=12345678).
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson The time to wait for a reply can be controlled through the
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <option>-W</option> and <option>-w</option> options. The
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <option>-W</option> option makes <command>host</command>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <parameter>wait</parameter> seconds. If <parameter>wait</parameter>
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson is less than one, the wait interval is set to one second. When the
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <option>-w</option> option is used, <command>host</command>
3970098dcd2a7122541667b4b56cea8abce8ccf2Mark Andrews effectively wait forever for a reply. The time to wait for a response
3970098dcd2a7122541667b4b56cea8abce8ccf2Mark Andrews will be set to the number of seconds given by the hardware's maximum
3970098dcd2a7122541667b4b56cea8abce8ccf2Mark Andrews value for an integer quantity.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson The <option>-s</option> option tells <command>host</command>
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews <emphasis>not</emphasis> to send the query to the next nameserver
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson if any server responds with a SERVFAIL response, which is the
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson reverse of normal stub resolver behavior.
2fd63cf561135572339d4e2ff0c06695e3dcf1baMark Andrews The <option>-m</option> can be used to set the memory usage debugging
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <parameter>record</parameter>, <parameter>usage</parameter> and
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson If <command>host</command> has been built with IDN (internationalized
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson domain name) support, it can accept and display non-ASCII domain names.
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <command>host</command> appropriately converts character encoding of
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson domain name before sending a request to DNS server or displaying a
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson reply from the server.
20d0c8c5bb06be9925d568adce9a031e08ef7172Andreas Gustafsson If you'd like to turn off the IDN support for some reason, defines
97bb3725292d3f74bcb0a32be6a76b2da34ba494Andreas Gustafsson the <envar>IDN_DISABLE</envar> environment variable.
f9cdef0ba5cd21db91318f290c25b0ab3d28f3dfMark Andrews The IDN support is disabled if the variable is set when
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson <refentrytitle>dig</refentrytitle><manvolnum>1</manvolnum>
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson </citerefentry>,
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson <citerefentry>
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
a6a23642eaf383add7a0be045c01e7dd8278ccafAndreas Gustafsson </citerefentry>.
97bb3725292d3f74bcb0a32be6a76b2da34ba494Andreas Gustafsson - Local variables: