man.host.html revision 65f32cd8bf0924a9d7b7fde03d1a45407dc6f422
2328307a8f353078dbbebf242007271153e18cd1Bob Halley - Copyright (C) 2004-2014 Internet Systems Consortium, Inc. ("ISC")
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - Copyright (C) 2000-2003 Internet Software Consortium.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - Permission to use, copy, modify, and/or distribute this software for any
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - purpose with or without fee is hereby granted, provided that the above
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - copyright notice and this permission notice appear in all copies.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - PERFORMANCE OF THIS SOFTWARE.
d25afd60ee2286cb171c4960a790f3d7041b6f85Bob Halley<!-- $Id$ -->
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<link rel="up" href="Bv9ARM.ch10.html" title="Manual pages">
7f9e7076849ac56b03c6f578c22a47c81aa5d171Michael Graff<link rel="prev" href="man.dig.html" title="dig">
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<link rel="next" href="man.dnssec-checkds.html" title="dnssec-checkds">
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<table width="100%" summary="Navigation header">
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<a accesskey="p" href="man.dig.html">Prev</a>�</td>
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<th width="60%" align="center">Manual pages</th>
fb3dcb0b607175a5fdae2d4928fb4d5321a0132fMichael Graff<td width="20%" align="right">�<a accesskey="n" href="man.dnssec-checkds.html">Next</a>
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff<a name="man.host"></a><div class="titlepage"></div>
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff<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>
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff<p><span><strong class="command">host</strong></span>
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff is a simple utility for performing DNS lookups.
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff It is normally used to convert names to IP addresses and vice versa.
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff When no arguments or options are given,
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff <span><strong class="command">host</strong></span>
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff prints a short summary of its command line arguments and options.
2328307a8f353078dbbebf242007271153e18cd1Bob Halley<p><em class="parameter"><code>name</code></em> is the domain name that is to be
0c7244d35222b48c016e348bfa59234f6e1a8256Michael Graff up. It can also be a dotted-decimal IPv4 address or a colon-delimited
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff IPv6 address, in which case <span><strong class="command">host</strong></span> will by
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff perform a reverse lookup for that address.
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff <em class="parameter"><code>server</code></em> is an optional argument which
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff the name or IP address of the name server that <span><strong class="command">host</strong></span>
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff should query instead of the server or servers listed in
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff <code class="filename">/etc/resolv.conf</code>.
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff The <code class="option">-a</code> (all) option is equivalent to setting the
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff <code class="option">-v</code> option and asking <span><strong class="command">host</strong></span> to make
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff a query of type ANY.
0c7244d35222b48c016e348bfa59234f6e1a8256Michael Graff When the <code class="option">-C</code> option is used, <span><strong class="command">host</strong></span>
0c7244d35222b48c016e348bfa59234f6e1a8256Michael Graff will attempt to display the SOA records for zone
0c7244d35222b48c016e348bfa59234f6e1a8256Michael Graff <em class="parameter"><code>name</code></em> from all the listed
97ed1e3750506dee46916dcdaf91537083a026b4Michael Graff authoritative name
97ed1e3750506dee46916dcdaf91537083a026b4Michael Graff servers for that zone. The list of name servers is defined by the NS
97ed1e3750506dee46916dcdaf91537083a026b4Michael Graff records that are found for the zone.
97ed1e3750506dee46916dcdaf91537083a026b4Michael Graff The <code class="option">-c</code> option instructs to make a DNS query of class
97ed1e3750506dee46916dcdaf91537083a026b4Michael Graff <em class="parameter"><code>class</code></em>. This can be used to lookup
e89cd0396e7857d1509e12d6dc6c7e9fcb8e4814Michael Graff Chaosnet class resource records. The default class is IN (Internet).
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff Verbose output is generated by <span><strong class="command">host</strong></span> when
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff <code class="option">-d</code> or <code class="option">-v</code> option is used. The two
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff options are equivalent. They have been provided for backwards
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff compatibility. In previous versions, the <code class="option">-d</code> option
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff switched on debugging traces and <code class="option">-v</code> enabled verbose
e75eee32066733e5d07c954ebdb1cb8bd6038764Michael Graff List mode is selected by the <code class="option">-l</code> option. This makes
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff <span><strong class="command">host</strong></span> perform a zone transfer for zone
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff <em class="parameter"><code>name</code></em>. Transfer the zone printing out
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff and address records (A/AAAA). If combined with <code class="option">-a</code>
7f9e7076849ac56b03c6f578c22a47c81aa5d171Michael Graff all records will be printed.
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff option specifies that reverse lookups of IPv6 addresses should
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff use the IP6.INT domain as defined in RFC1886.
bb039bc91ef7d5b82cdba64e0a8a965790e06700Michael Graff The default is to use IP6.ARPA.
3740b569ae76295b941d57a724a43beb75b533baBob Halley The <code class="option">-N</code> option sets the number of dots that have to be
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff in <em class="parameter"><code>name</code></em> for it to be considered
81231fc4c34b7fb8613ce7ee449866edab2e3c80Michael Graff absolute. The
81231fc4c34b7fb8613ce7ee449866edab2e3c80Michael Graff default value is that defined using the ndots statement in
81231fc4c34b7fb8613ce7ee449866edab2e3c80Michael Graff <code class="filename">/etc/resolv.conf</code>, or 1 if no ndots
7251d776466396a2a8f2769c8fa0c13e4db8ef9cMichael Graff present. Names with fewer dots are interpreted as relative names and
81231fc4c34b7fb8613ce7ee449866edab2e3c80Michael Graff will be searched for in the domains listed in the <span class="type">search</span>
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff or <span class="type">domain</span> directive in
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff <code class="filename">/etc/resolv.conf</code>.
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff The number of UDP retries for a lookup can be changed with the
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff <code class="option">-R</code> option. <em class="parameter"><code>number</code></em>
3740b569ae76295b941d57a724a43beb75b533baBob Halley how many times <span><strong class="command">host</strong></span> will repeat a query
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff not get answered. The default number of retries is 1. If
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff <em class="parameter"><code>number</code></em> is negative or zero, the
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff retries will default to 1.
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff Non-recursive queries can be made via the <code class="option">-r</code> option.
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff Setting this option clears the <span class="type">RD</span> — recursion
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff desired — bit in the query which <span><strong class="command">host</strong></span> makes.
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff This should mean that the name server receiving the query will not
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff attempt to resolve <em class="parameter"><code>name</code></em>. The
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff <code class="option">-r</code> option enables <span><strong class="command">host</strong></span>
0c7244d35222b48c016e348bfa59234f6e1a8256Michael Graff the behavior of a name server by making non-recursive queries and
0c7244d35222b48c016e348bfa59234f6e1a8256Michael Graff expecting to receive answers to those queries that are usually
fb3dcb0b607175a5fdae2d4928fb4d5321a0132fMichael Graff referrals to other name servers.
81231fc4c34b7fb8613ce7ee449866edab2e3c80Michael Graff By default, <span><strong class="command">host</strong></span> uses UDP when making
81231fc4c34b7fb8613ce7ee449866edab2e3c80Michael Graff <code class="option">-T</code> option makes it use a TCP connection when querying
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff the name server. TCP will be automatically selected for queries that
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff require it, such as zone transfer (AXFR) requests.
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff The <code class="option">-4</code> option forces <span><strong class="command">host</strong></span> to only
93e065e7a6bac6484323d743109761f8102d0e5cMichael Graff use IPv4 query transport. The <code class="option">-6</code> option forces
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff <span><strong class="command">host</strong></span> to only use IPv6 query transport.
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff The <code class="option">-t</code> option is used to select the query type.
3740b569ae76295b941d57a724a43beb75b533baBob Halley <em class="parameter"><code>type</code></em> can be any recognized query
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff <span><strong class="command">host</strong></span> automatically selects an appropriate
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff type. By default, it looks for A, AAAA, and MX records, but if the
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff <code class="option">-C</code> option was given, queries will be made for SOA
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff records, and if <em class="parameter"><code>name</code></em> is a
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff dotted-decimal IPv4
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff address or colon-delimited IPv6 address, <span><strong class="command">host</strong></span> will
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff query for PTR records. If a query type of IXFR is chosen the starting
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff serial number can be specified by appending an equal followed by the
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff starting serial number (e.g. -t IXFR=12345678).
e89cd0396e7857d1509e12d6dc6c7e9fcb8e4814Michael Graff The time to wait for a reply can be controlled through the
7f9e7076849ac56b03c6f578c22a47c81aa5d171Michael Graff <code class="option">-W</code> and <code class="option">-w</code> options. The
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff <code class="option">-W</code> option makes <span><strong class="command">host</strong></span>
7251d776466396a2a8f2769c8fa0c13e4db8ef9cMichael Graff <em class="parameter"><code>wait</code></em> seconds. If <em class="parameter"><code>wait</code></em>
28866ad7789b23f5c69e4e48add34d6f0b2fccd6Michael Graff is less than one, the wait interval is set to one second. When the
7f9e7076849ac56b03c6f578c22a47c81aa5d171Michael Graff <code class="option">-w</code> option is used, <span><strong class="command">host</strong></span>
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff effectively wait forever for a reply. The time to wait for a response
7251d776466396a2a8f2769c8fa0c13e4db8ef9cMichael Graff will be set to the number of seconds given by the hardware's maximum
7251d776466396a2a8f2769c8fa0c13e4db8ef9cMichael Graff value for an integer quantity.
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff The <code class="option">-s</code> option tells <span><strong class="command">host</strong></span>
3740b569ae76295b941d57a724a43beb75b533baBob Halley <span class="emphasis"><em>not</em></span> to send the query to the next nameserver
b73eb944cdde0deebad48a4a12c35f904bc05f4eMichael Graff if any server responds with a SERVFAIL response, which is the
3740b569ae76295b941d57a724a43beb75b533baBob Halley reverse of normal stub resolver behavior.
3740b569ae76295b941d57a724a43beb75b533baBob Halley The <code class="option">-m</code> can be used to set the memory usage debugging
0ab04d76c8b47210c91cb960854a17b28e2daa35Bob Halley <em class="parameter"><code>record</code></em>, <em class="parameter"><code>usage</code></em> and
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff If <span><strong class="command">host</strong></span> has been built with IDN (internationalized
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff domain name) support, it can accept and display non-ASCII domain names.
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff <span><strong class="command">host</strong></span> appropriately converts character encoding of
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff domain name before sending a request to DNS server or displaying a
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff reply from the server.
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff If you'd like to turn off the IDN support for some reason, defines
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff the <code class="envar">IDN_DISABLE</code> environment variable.
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff The IDN support is disabled if the variable is set when
3740b569ae76295b941d57a724a43beb75b533baBob Halley <span><strong class="command">host</strong></span> runs.
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff<p><code class="filename">/etc/resolv.conf</code>
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff<p><span class="citerefentry"><span class="refentrytitle">dig</span>(1)</span>,
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>.
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<table width="100%" summary="Navigation footer">
3740b569ae76295b941d57a724a43beb75b533baBob Halley<a accesskey="p" href="man.dig.html">Prev</a>�</td>
6d05b41aaef2a56d8d806b2cbf3ab08a1b4990e6Michael Graff<td width="20%" align="center"><a accesskey="u" href="Bv9ARM.ch10.html">Up</a></td>
bb039bc91ef7d5b82cdba64e0a8a965790e06700Michael Graff<td width="40%" align="right">�<a accesskey="n" href="man.dnssec-checkds.html">Next</a>
7f9e7076849ac56b03c6f578c22a47c81aa5d171Michael Graff<td width="40%" align="left" valign="top">dig�</td>
c2be3539e9357b08db26f8003a3c46fc247a93bfMichael Graff<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
a21e2e7fea21498dde43d69f9679d7233f13955aMichael Graff<td width="40%" align="right" valign="top">�<span class="application">dnssec-checkds</span>