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