host.html revision cedb0bd0c1e3c461b7e479a16d3adfd5b150f1f4
0b637179ccd82ca5e61ba7f890573085478c52d9Tinderbox User - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington - Copyright (C) 2000-2002 Internet Software Consortium.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater - Permission to use, copy, modify, and distribute this software for any
615eff12e0e3565c52758292e10080a25d872941William King - purpose with or without fee is hereby granted, provided that the above
615eff12e0e3565c52758292e10080a25d872941William King - 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.
615eff12e0e3565c52758292e10080a25d872941William King<!-- $Id: host.html,v 1.21 2005/10/13 03:13:57 marka Exp $ -->
615eff12e0e3565c52758292e10080a25d872941William King<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
615eff12e0e3565c52758292e10080a25d872941William King<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
615eff12e0e3565c52758292e10080a25d872941William King<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
615eff12e0e3565c52758292e10080a25d872941William King<a name="man.host"></a><div class="titlepage"></div>
615eff12e0e3565c52758292e10080a25d872941William King<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>] {name} [server]</p></div>
79d91e915023ffa5fac1bb2f91f19210bb18407cBrian Wellington<a name="id2525921"></a><h2>DESCRIPTION</h2>
ab123a8e1b6573e622189a1d39d0af33150a56f8David Lawrence<p><span><strong class="command">host</strong></span>
615eff12e0e3565c52758292e10080a25d872941William King is a simple utility for performing DNS lookups.
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence It is normally used to convert names to IP addresses and vice versa.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews When no arguments or options are given,
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence <span><strong class="command">host</strong></span>
fd9f6afdff9faf55411dfd5f828529601cab0511Andreas Gustafsson prints a short summary of its command line arguments and options.
a9bc95f22ef2dd4a12e79be99412c9f18b814a5dBrian Wellington<p><em class="parameter"><code>name</code></em> is the domain name that is to be
a9bc95f22ef2dd4a12e79be99412c9f18b814a5dBrian Wellington up. It can also be a dotted-decimal IPv4 address or a colon-delimited
615eff12e0e3565c52758292e10080a25d872941William King IPv6 address, in which case <span><strong class="command">host</strong></span> will by
615eff12e0e3565c52758292e10080a25d872941William King perform a reverse lookup for that address.
615eff12e0e3565c52758292e10080a25d872941William King <em class="parameter"><code>server</code></em> is an optional argument which
a781910430028650d388fd932dd94ce6eb6e9d8dBrian Wellington the name or IP address of the name server that <span><strong class="command">host</strong></span>
a781910430028650d388fd932dd94ce6eb6e9d8dBrian Wellington should query instead of the server or servers listed in
a781910430028650d388fd932dd94ce6eb6e9d8dBrian Wellington <code class="filename">/etc/resolv.conf</code>.
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence The <code class="option">-a</code> (all) option is equivalent to setting the
615eff12e0e3565c52758292e10080a25d872941William King <code class="option">-v</code> option and asking <span><strong class="command">host</strong></span> to make
615eff12e0e3565c52758292e10080a25d872941William King a query of type ANY.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews When the <code class="option">-C</code> option is used, <span><strong class="command">host</strong></span>
615eff12e0e3565c52758292e10080a25d872941William King will attempt to display the SOA records for zone
bbf31e6b623af575138669bdd7031232867b9166Mark Andrews <em class="parameter"><code>name</code></em> from all the listed
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews authoritative name
615eff12e0e3565c52758292e10080a25d872941William King servers for that zone. The list of name servers is defined by the NS
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews records that are found for the zone.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews The <code class="option">-c</code> option instructs to make a DNS query of class
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews <em class="parameter"><code>class</code></em>. This can be used to lookup
615eff12e0e3565c52758292e10080a25d872941William King Chaosnet class resource records. The default class is IN (Internet).
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews Verbose output is generated by <span><strong class="command">host</strong></span> when
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews <code class="option">-d</code> or <code class="option">-v</code> option is used. The two
615eff12e0e3565c52758292e10080a25d872941William King options are equivalent. They have been provided for backwards
bbf31e6b623af575138669bdd7031232867b9166Mark Andrews compatibility. In previous versions, the <code class="option">-d</code> option
bbf31e6b623af575138669bdd7031232867b9166Mark Andrews switched on debugging traces and <code class="option">-v</code> enabled verbose
bbf31e6b623af575138669bdd7031232867b9166Mark Andrews List mode is selected by the <code class="option">-l</code> option. This makes
bbf31e6b623af575138669bdd7031232867b9166Mark Andrews <span><strong class="command">host</strong></span> perform a zone transfer for zone
fcd7c22fdff859e47d290981bb08cd3fc07369a1Tinderbox User <em class="parameter"><code>name</code></em>. Transfer the zone printing out
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews and address records (A/AAAA). If combined with <code class="option">-a</code>
ab123a8e1b6573e622189a1d39d0af33150a56f8David Lawrence all records will be printed.
615eff12e0e3565c52758292e10080a25d872941William King option specifies that reverse lookups of IPv6 addresses should
ab123a8e1b6573e622189a1d39d0af33150a56f8David Lawrence use the IP6.INT domain as defined in RFC1886.
615eff12e0e3565c52758292e10080a25d872941William King The default is to use IP6.ARPA.
615eff12e0e3565c52758292e10080a25d872941William King The <code class="option">-N</code> option sets the number of dots that have to be
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington in <em class="parameter"><code>name</code></em> for it to be considered
615eff12e0e3565c52758292e10080a25d872941William King absolute. The
4124057bf54f0fc75b06b35487130bbd9249ee7fBrian Wellington default value is that defined using the ndots statement in
1b6d529cb5ee0ad44f8518e1b8c2cbca54bbdf18David Lawrence <code class="filename">/etc/resolv.conf</code>, or 1 if no ndots
615eff12e0e3565c52758292e10080a25d872941William King statement is
615eff12e0e3565c52758292e10080a25d872941William King present. Names with fewer dots are interpreted as relative names and
615eff12e0e3565c52758292e10080a25d872941William King will be searched for in the domains listed in the <span class="type">search</span>
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington or <span class="type">domain</span> directive in
615eff12e0e3565c52758292e10080a25d872941William King <code class="filename">/etc/resolv.conf</code>.
615eff12e0e3565c52758292e10080a25d872941William King The number of UDP retries for a lookup can be changed with the
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence <code class="option">-R</code> option. <em class="parameter"><code>number</code></em>
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington how many times <span><strong class="command">host</strong></span> will repeat a query
b869f35f43100c71c6d06bd23934b4a2c5ed4cb7Brian Wellington not get answered. The default number of retries is 1. If
b869f35f43100c71c6d06bd23934b4a2c5ed4cb7Brian Wellington <em class="parameter"><code>number</code></em> is negative or zero, the
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington retries will default to 1.
b869f35f43100c71c6d06bd23934b4a2c5ed4cb7Brian Wellington Non-recursive queries can be made via the <code class="option">-r</code> option.
b869f35f43100c71c6d06bd23934b4a2c5ed4cb7Brian Wellington Setting this option clears the <span class="type">RD</span> — recursion
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington desired — bit in the query which <span><strong class="command">host</strong></span> makes.
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington This should mean that the name server receiving the query will not
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington attempt to resolve <em class="parameter"><code>name</code></em>. The
446aa1ec8cb8f231d8649cfd705c90c6d0976143David Lawrence <code class="option">-r</code> option enables <span><strong class="command">host</strong></span>
b3ef06344abad0105be99b622e615dcbd87911e1Brian Wellington the behaviour of a name server by making non-recursive queries and
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington expecting to receive answers to those queries that are usually
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington referrals to other name servers.
b869f35f43100c71c6d06bd23934b4a2c5ed4cb7Brian Wellington By default <span><strong class="command">host</strong></span> uses UDP when making
615eff12e0e3565c52758292e10080a25d872941William King <code class="option">-T</code> option makes it use a TCP connection when querying
b3ef06344abad0105be99b622e615dcbd87911e1Brian Wellington the name server. TCP will be automatically selected for queries that
615eff12e0e3565c52758292e10080a25d872941William King require it, such as zone transfer (AXFR) requests.
615eff12e0e3565c52758292e10080a25d872941William King The <code class="option">-4</code> option forces <span><strong class="command">host</strong></span> to only
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence use IPv4 query transport. The <code class="option">-6</code> option forces
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington <span><strong class="command">host</strong></span> to only use IPv6 query transport.
446aa1ec8cb8f231d8649cfd705c90c6d0976143David Lawrence The <code class="option">-t</code> option is used to select the query type.
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington <em class="parameter"><code>type</code></em> can be any recognised query
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington <span><strong class="command">host</strong></span> automatically selects an appropriate
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington type. By default it looks for A records, but if the
446aa1ec8cb8f231d8649cfd705c90c6d0976143David Lawrence <code class="option">-C</code> option was given, queries will be made for SOA
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington records, and if <em class="parameter"><code>name</code></em> is a
b3ef06344abad0105be99b622e615dcbd87911e1Brian Wellington dotted-decimal IPv4
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington address or colon-delimited IPv6 address, <span><strong class="command">host</strong></span> will
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington query for PTR records. If a query type of IXFR is chosen the starting
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington serial number can be specified by appending an equal followed by the
615eff12e0e3565c52758292e10080a25d872941William King starting serial number (e.g. -t IXFR=12345678).
446aa1ec8cb8f231d8649cfd705c90c6d0976143David Lawrence The time to wait for a reply can be controlled through the
615eff12e0e3565c52758292e10080a25d872941William King <code class="option">-W</code> and <code class="option">-w</code> options. The
b3ef06344abad0105be99b622e615dcbd87911e1Brian Wellington <code class="option">-W</code> option makes <span><strong class="command">host</strong></span>
615eff12e0e3565c52758292e10080a25d872941William King <em class="parameter"><code>wait</code></em> seconds. If <em class="parameter"><code>wait</code></em>
4fe8755480c108a1232b7189fd5434ab35a6b623Brian Wellington is less than one, the wait interval is set to one second. When the
615eff12e0e3565c52758292e10080a25d872941William King <code class="option">-w</code> option is used, <span><strong class="command">host</strong></span>
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington effectively wait forever for a reply. The time to wait for a response
a9bc95f22ef2dd4a12e79be99412c9f18b814a5dBrian Wellington will be set to the number of seconds given by the hardware's maximum
4124057bf54f0fc75b06b35487130bbd9249ee7fBrian Wellington value for an integer quantity.
4124057bf54f0fc75b06b35487130bbd9249ee7fBrian Wellington The <code class="option">-s</code> option tells <span><strong class="command">host</strong></span>
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington <span class="emphasis"><em>not</em></span> to send the query to the next nameserver
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington if any server responds with a SERVFAIL response, which is the
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington reverse of normal stub resolver behaviour.
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington The <code class="option">-m</code> can be used to set the memory usage debugging
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington <em class="parameter"><code>record</code></em>, <em class="parameter"><code>usage</code></em> and
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington <em class="parameter"><code>trace</code></em>.
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington<a name="id2526286"></a><h2>IDN SUPPORT</h2>
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington If <span><strong class="command">host</strong></span> has been built with IDN (internationalized
6eb6af6732194157224e2b8d81a02a9e80c4530aMark Andrews domain name) support, it can accept and display non-ASCII domain names.
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington <span><strong class="command">host</strong></span> appropriately converts character encoding of
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington domain name before sending a request to DNS server or displaying a
b3ef06344abad0105be99b622e615dcbd87911e1Brian Wellington reply from the server.
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington If you'd like to turn off the IDN support for some reason, defines
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington the <code class="envar">IDN_DISABLE</code> environment variable.
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington The IDN support is disabled if the variable is set when
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington <span><strong class="command">host</strong></span> runs.
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington<p><code class="filename">/etc/resolv.conf</code>
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington<p><span class="citerefentry"><span class="refentrytitle">dig</span>(1)</span>,
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>.