host.html revision fd2597f75693a2279fdf588bd40dfe2407c42028
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - Copyright (C) 2004, 2005, 2007-2009, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - Copyright (C) 2000-2002 Internet Software Consortium.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - Permission to use, copy, modify, and/or distribute this software for any
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - purpose with or without fee is hereby granted, provided that the above
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - copyright notice and this permission notice appear in all copies.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn - PERFORMANCE OF THIS SOFTWARE.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn<a name="man.host"></a><div class="titlepage"></div>
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn<div class="cmdsynopsis"><p><code class="command">host</code> [<code class="option">-aCdlnrsTwv</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-N <em class="replaceable"><code>ndots</code></em></code>] [<code class="option">-R <em class="replaceable"><code>number</code></em></code>] [<code class="option">-t <em class="replaceable"><code>type</code></em></code>] [<code class="option">-W <em class="replaceable"><code>wait</code></em></code>] [<code class="option">-m <em class="replaceable"><code>flag</code></em></code>] [<code class="option">-4</code>] [<code class="option">-6</code>] [<code class="option">-v</code>] [<code class="option">-V</code>] {name} [server]</p></div>
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn<p><span class="command"><strong>host</strong></span>
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn is a simple utility for performing DNS lookups.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn It is normally used to convert names to IP addresses and vice versa.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn When no arguments or options are given,
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn <span class="command"><strong>host</strong></span>
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn prints a short summary of its command line arguments and options.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn<p><em class="parameter"><code>name</code></em> is the domain name that is to be
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn up. It can also be a dotted-decimal IPv4 address or a colon-delimited
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn IPv6 address, in which case <span class="command"><strong>host</strong></span> will by
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn perform a reverse lookup for that address.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn <em class="parameter"><code>server</code></em> is an optional argument which
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn the name or IP address of the name server that <span class="command"><strong>host</strong></span>
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn should query instead of the server or servers listed in
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn The <code class="option">-a</code> (all) option is equivalent to setting the
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn <code class="option">-v</code> option and asking <span class="command"><strong>host</strong></span> to make
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn a query of type ANY.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn When the <code class="option">-C</code> option is used, <span class="command"><strong>host</strong></span>
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn will attempt to display the SOA records for zone
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <em class="parameter"><code>name</code></em> from all the listed
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma authoritative name
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn servers for that zone. The list of name servers is defined by the NS
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift records that are found for the zone.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn The <code class="option">-c</code> option instructs to make a DNS query of class
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <em class="parameter"><code>class</code></em>. This can be used to lookup
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn Chaosnet class resource records. The default class is IN (Internet).
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn Verbose output is generated by <span class="command"><strong>host</strong></span> when
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <code class="option">-d</code> or <code class="option">-v</code> option is used. The two
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma options are equivalent. They have been provided for backwards
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma compatibility. In previous versions, the <code class="option">-d</code> option
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma switched on debugging traces and <code class="option">-v</code> enabled verbose
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma output. Verbose output can also be enabled by setting the
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <em class="parameter"><code>debug</code></em> option in
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma List mode is selected by the <code class="option">-l</code> option. This makes
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <span class="command"><strong>host</strong></span> perform a zone transfer for zone
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <em class="parameter"><code>name</code></em>. Transfer the zone printing out
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma the NS, PTR
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma and address records (A/AAAA). If combined with <code class="option">-a</code>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma all records will be printed.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma option specifies that reverse lookups of IPv6 addresses should
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma use the IP6.INT domain as defined in RFC1886.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma The default is to use IP6.ARPA.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn The <code class="option">-N</code> option sets the number of dots that have to be
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn in <em class="parameter"><code>name</code></em> for it to be considered
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn absolute. The
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn default value is that defined using the ndots statement in
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn <code class="filename">/etc/resolv.conf</code>, or 1 if no ndots
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn statement is
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn present. Names with fewer dots are interpreted as relative names and
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn will be searched for in the domains listed in the <span class="type">search</span>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma The number of UDP retries for a lookup can be changed with the
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <code class="option">-R</code> option. <em class="parameter"><code>number</code></em>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma how many times <span class="command"><strong>host</strong></span> will repeat a query
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma not get answered. If
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <em class="parameter"><code>number</code></em> is negative or zero, the
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn retries will default to 1. The default value is 1, or
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn the value of the <em class="parameter"><code>attempts</code></em> option in
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <code class="filename">/etc/resolv.conf</code>, if set.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma Non-recursive queries can be made via the <code class="option">-r</code> option.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma Setting this option clears the <span class="type">RD</span> — recursion
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma desired — bit in the query which <span class="command"><strong>host</strong></span> makes.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn This should mean that the name server receiving the query will not
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn attempt to resolve <em class="parameter"><code>name</code></em>. The
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn <code class="option">-r</code> option enables <span class="command"><strong>host</strong></span>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma the behavior of a name server by making non-recursive queries and
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma expecting to receive answers to those queries that are usually
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma referrals to other name servers.
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift By default, <span class="command"><strong>host</strong></span> uses UDP when making
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma queries. The
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <code class="option">-T</code> option makes it use a TCP connection when querying
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma the name server. TCP will be automatically selected for queries that
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma require it, such as zone transfer (AXFR) requests.
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn The <code class="option">-4</code> option forces <span class="command"><strong>host</strong></span> to only
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn use IPv4 query transport. The <code class="option">-6</code> option forces
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <span class="command"><strong>host</strong></span> to only use IPv6 query transport.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma The <code class="option">-t</code> option is used to select the query type.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <em class="parameter"><code>type</code></em> can be any recognized query
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma type: CNAME,
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <span class="command"><strong>host</strong></span> automatically selects an appropriate
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma type. By default, it looks for A, AAAA, and MX records, but if the
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <code class="option">-C</code> option was given, queries will be made for SOA
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma records, and if <em class="parameter"><code>name</code></em> is a
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma dotted-decimal IPv4
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma address or colon-delimited IPv6 address, <span class="command"><strong>host</strong></span> will
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift query for PTR records. If a query type of IXFR is chosen the starting
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift serial number can be specified by appending an equal followed by the
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift starting serial number (e.g. -t IXFR=12345678).
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma The time to wait for a reply can be controlled through the
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <code class="option">-W</code> and <code class="option">-w</code> options. The
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <code class="option">-W</code> option makes <span class="command"><strong>host</strong></span>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <em class="parameter"><code>wait</code></em> seconds. If <em class="parameter"><code>wait</code></em>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma is less than one, the wait interval is set to one second. When the
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn <code class="option">-w</code> option is used, <span class="command"><strong>host</strong></span>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma effectively wait forever for a reply. The time to wait for a response
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma will be set to the number of seconds given by the hardware's maximum
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma value for an integer quantity. By default, <span class="command"><strong>host</strong></span>
9def8137e705ec92bc3a2881a8457795c860fdb1shankar_mbn will wait for 5 seconds for UDP responses and 10 seconds for TCP
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma connections. These defaults can be overridden by the
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <em class="parameter"><code>timeout</code></em> option in
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma The <code class="option">-s</code> option tells <span class="command"><strong>host</strong></span>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <span class="emphasis"><em>not</em></span> to send the query to the next nameserver
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma if any server responds with a SERVFAIL response, which is the
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma reverse of normal stub resolver behavior.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma The <code class="option">-m</code> can be used to set the memory usage debugging
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift <em class="parameter"><code>record</code></em>, <em class="parameter"><code>usage</code></em> and
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma The <code class="option">-V</code> option causes <span class="command"><strong>host</strong></span>
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma to print the version number and exit.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma If <span class="command"><strong>host</strong></span> has been built with IDN (internationalized
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma domain name) support, it can accept and display non-ASCII domain names.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <span class="command"><strong>host</strong></span> appropriately converts character encoding of
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma domain name before sending a request to DNS server or displaying a
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma reply from the server.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma If you'd like to turn off the IDN support for some reason, defines
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma the <code class="envar">IDN_DISABLE</code> environment variable.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma The IDN support is disabled if the variable is set when
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <span class="command"><strong>host</strong></span> runs.
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma<p><span class="citerefentry"><span class="refentrytitle">dig</span>(1)</span>,
074f2520bc04a7a93b4123bc58fb40055c9174d2hajma <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>.