1170222Sdougb<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 2170222Sdougb "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 3153816Sdougb [<!ENTITY mdash "—">]> 4135446Strhodes<!-- 5193149Sdougb - Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") 6135446Strhodes - Copyright (C) 2000-2002 Internet Software Consortium. 7135446Strhodes - 8174187Sdougb - Permission to use, copy, modify, and/or distribute this software for any 9135446Strhodes - purpose with or without fee is hereby granted, provided that the above 10135446Strhodes - copyright notice and this permission notice appear in all copies. 11135446Strhodes - 12135446Strhodes - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 13135446Strhodes - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 14135446Strhodes - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 15135446Strhodes - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 16135446Strhodes - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 17135446Strhodes - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 18135446Strhodes - PERFORMANCE OF THIS SOFTWARE. 19135446Strhodes--> 20135446Strhodes 21234010Sdougb<!-- $Id: host.docbook,v 1.20 2009/01/20 23:47:56 tbox Exp $ --> 22170222Sdougb<refentry id="man.host"> 23135446Strhodes 24170222Sdougb <refentryinfo> 25170222Sdougb <date>Jun 30, 2000</date> 26170222Sdougb </refentryinfo> 27135446Strhodes 28170222Sdougb <refmeta> 29170222Sdougb <refentrytitle>host</refentrytitle> 30170222Sdougb <manvolnum>1</manvolnum> 31170222Sdougb <refmiscinfo>BIND9</refmiscinfo> 32170222Sdougb </refmeta> 33135446Strhodes 34170222Sdougb <refnamediv> 35170222Sdougb <refname>host</refname> 36170222Sdougb <refpurpose>DNS lookup utility</refpurpose> 37170222Sdougb </refnamediv> 38135446Strhodes 39153816Sdougb <docinfo> 40153816Sdougb <copyright> 41153816Sdougb <year>2004</year> 42153816Sdougb <year>2005</year> 43170222Sdougb <year>2007</year> 44186462Sdougb <year>2008</year> 45193149Sdougb <year>2009</year> 46153816Sdougb <holder>Internet Systems Consortium, Inc. ("ISC")</holder> 47153816Sdougb </copyright> 48153816Sdougb <copyright> 49153816Sdougb <year>2000</year> 50153816Sdougb <year>2001</year> 51153816Sdougb <year>2002</year> 52153816Sdougb <holder>Internet Software Consortium.</holder> 53153816Sdougb </copyright> 54153816Sdougb </docinfo> 55153816Sdougb 56170222Sdougb <refsynopsisdiv> 57170222Sdougb <cmdsynopsis> 58170222Sdougb <command>host</command> 59170222Sdougb <arg><option>-aCdlnrsTwv</option></arg> 60170222Sdougb <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg> 61170222Sdougb <arg><option>-N <replaceable class="parameter">ndots</replaceable></option></arg> 62170222Sdougb <arg><option>-R <replaceable class="parameter">number</replaceable></option></arg> 63170222Sdougb <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg> 64170222Sdougb <arg><option>-W <replaceable class="parameter">wait</replaceable></option></arg> 65170222Sdougb <arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg> 66170222Sdougb <arg><option>-4</option></arg> 67170222Sdougb <arg><option>-6</option></arg> 68170222Sdougb <arg choice="req">name</arg> 69170222Sdougb <arg choice="opt">server</arg> 70170222Sdougb </cmdsynopsis> 71170222Sdougb </refsynopsisdiv> 72135446Strhodes 73170222Sdougb <refsect1> 74170222Sdougb <title>DESCRIPTION</title> 75135446Strhodes 76170222Sdougb <para><command>host</command> 77170222Sdougb is a simple utility for performing DNS lookups. 78170222Sdougb It is normally used to convert names to IP addresses and vice versa. 79170222Sdougb When no arguments or options are given, 80170222Sdougb <command>host</command> 81170222Sdougb prints a short summary of its command line arguments and options. 82170222Sdougb </para> 83135446Strhodes 84170222Sdougb <para><parameter>name</parameter> is the domain name that is to be 85170222Sdougb looked 86170222Sdougb up. It can also be a dotted-decimal IPv4 address or a colon-delimited 87170222Sdougb IPv6 address, in which case <command>host</command> will by 88170222Sdougb default 89170222Sdougb perform a reverse lookup for that address. 90170222Sdougb <parameter>server</parameter> is an optional argument which 91170222Sdougb is either 92170222Sdougb the name or IP address of the name server that <command>host</command> 93170222Sdougb should query instead of the server or servers listed in 94170222Sdougb <filename>/etc/resolv.conf</filename>. 95170222Sdougb </para> 96135446Strhodes 97170222Sdougb <para> 98170222Sdougb The <option>-a</option> (all) option is equivalent to setting the 99170222Sdougb <option>-v</option> option and asking <command>host</command> to make 100170222Sdougb a query of type ANY. 101170222Sdougb </para> 102135446Strhodes 103170222Sdougb <para> 104170222Sdougb When the <option>-C</option> option is used, <command>host</command> 105170222Sdougb will attempt to display the SOA records for zone 106170222Sdougb <parameter>name</parameter> from all the listed 107170222Sdougb authoritative name 108170222Sdougb servers for that zone. The list of name servers is defined by the NS 109170222Sdougb records that are found for the zone. 110170222Sdougb </para> 111135446Strhodes 112170222Sdougb <para> 113170222Sdougb The <option>-c</option> option instructs to make a DNS query of class 114170222Sdougb <parameter>class</parameter>. This can be used to lookup 115170222Sdougb Hesiod or 116170222Sdougb Chaosnet class resource records. The default class is IN (Internet). 117170222Sdougb </para> 118135446Strhodes 119170222Sdougb <para> 120170222Sdougb Verbose output is generated by <command>host</command> when 121170222Sdougb the 122170222Sdougb <option>-d</option> or <option>-v</option> option is used. The two 123170222Sdougb options are equivalent. They have been provided for backwards 124170222Sdougb compatibility. In previous versions, the <option>-d</option> option 125170222Sdougb switched on debugging traces and <option>-v</option> enabled verbose 126170222Sdougb output. 127170222Sdougb </para> 128135446Strhodes 129170222Sdougb <para> 130170222Sdougb List mode is selected by the <option>-l</option> option. This makes 131170222Sdougb <command>host</command> perform a zone transfer for zone 132170222Sdougb <parameter>name</parameter>. Transfer the zone printing out 133170222Sdougb the NS, PTR 134170222Sdougb and address records (A/AAAA). If combined with <option>-a</option> 135170222Sdougb all records will be printed. 136170222Sdougb </para> 137135446Strhodes 138170222Sdougb <para> 139170222Sdougb The <option>-i</option> 140170222Sdougb option specifies that reverse lookups of IPv6 addresses should 141170222Sdougb use the IP6.INT domain as defined in RFC1886. 142170222Sdougb The default is to use IP6.ARPA. 143170222Sdougb </para> 144135446Strhodes 145170222Sdougb <para> 146170222Sdougb The <option>-N</option> option sets the number of dots that have to be 147170222Sdougb in <parameter>name</parameter> for it to be considered 148170222Sdougb absolute. The 149170222Sdougb default value is that defined using the ndots statement in 150170222Sdougb <filename>/etc/resolv.conf</filename>, or 1 if no ndots 151170222Sdougb statement is 152170222Sdougb present. Names with fewer dots are interpreted as relative names and 153170222Sdougb will be searched for in the domains listed in the <type>search</type> 154170222Sdougb or <type>domain</type> directive in 155170222Sdougb <filename>/etc/resolv.conf</filename>. 156170222Sdougb </para> 157135446Strhodes 158170222Sdougb <para> 159170222Sdougb The number of UDP retries for a lookup can be changed with the 160170222Sdougb <option>-R</option> option. <parameter>number</parameter> 161170222Sdougb indicates 162170222Sdougb how many times <command>host</command> will repeat a query 163170222Sdougb that does 164170222Sdougb not get answered. The default number of retries is 1. If 165170222Sdougb <parameter>number</parameter> is negative or zero, the 166170222Sdougb number of 167170222Sdougb retries will default to 1. 168170222Sdougb </para> 169135446Strhodes 170170222Sdougb <para> 171170222Sdougb Non-recursive queries can be made via the <option>-r</option> option. 172170222Sdougb Setting this option clears the <type>RD</type> — recursion 173170222Sdougb desired — bit in the query which <command>host</command> makes. 174170222Sdougb This should mean that the name server receiving the query will not 175170222Sdougb attempt to resolve <parameter>name</parameter>. The 176170222Sdougb <option>-r</option> option enables <command>host</command> 177170222Sdougb to mimic 178174187Sdougb the behavior of a name server by making non-recursive queries and 179170222Sdougb expecting to receive answers to those queries that are usually 180170222Sdougb referrals to other name servers. 181170222Sdougb </para> 182135446Strhodes 183170222Sdougb <para> 184193149Sdougb By default, <command>host</command> uses UDP when making 185170222Sdougb queries. The 186170222Sdougb <option>-T</option> option makes it use a TCP connection when querying 187170222Sdougb the name server. TCP will be automatically selected for queries that 188170222Sdougb require it, such as zone transfer (AXFR) requests. 189170222Sdougb </para> 190135446Strhodes 191170222Sdougb <para> 192170222Sdougb The <option>-4</option> option forces <command>host</command> to only 193170222Sdougb use IPv4 query transport. The <option>-6</option> option forces 194170222Sdougb <command>host</command> to only use IPv6 query transport. 195170222Sdougb </para> 196135446Strhodes 197170222Sdougb <para> 198170222Sdougb The <option>-t</option> option is used to select the query type. 199174187Sdougb <parameter>type</parameter> can be any recognized query 200170222Sdougb type: CNAME, 201170222Sdougb NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified, 202170222Sdougb <command>host</command> automatically selects an appropriate 203170222Sdougb query 204193149Sdougb type. By default, it looks for A, AAAA, and MX records, but if the 205170222Sdougb <option>-C</option> option was given, queries will be made for SOA 206170222Sdougb records, and if <parameter>name</parameter> is a 207170222Sdougb dotted-decimal IPv4 208170222Sdougb address or colon-delimited IPv6 address, <command>host</command> will 209170222Sdougb query for PTR records. If a query type of IXFR is chosen the starting 210170222Sdougb serial number can be specified by appending an equal followed by the 211170222Sdougb starting serial number (e.g. -t IXFR=12345678). 212170222Sdougb </para> 213135446Strhodes 214170222Sdougb <para> 215170222Sdougb The time to wait for a reply can be controlled through the 216170222Sdougb <option>-W</option> and <option>-w</option> options. The 217170222Sdougb <option>-W</option> option makes <command>host</command> 218170222Sdougb wait for 219170222Sdougb <parameter>wait</parameter> seconds. If <parameter>wait</parameter> 220170222Sdougb is less than one, the wait interval is set to one second. When the 221170222Sdougb <option>-w</option> option is used, <command>host</command> 222170222Sdougb will 223170222Sdougb effectively wait forever for a reply. The time to wait for a response 224170222Sdougb will be set to the number of seconds given by the hardware's maximum 225170222Sdougb value for an integer quantity. 226170222Sdougb </para> 227135446Strhodes 228170222Sdougb <para> 229170222Sdougb The <option>-s</option> option tells <command>host</command> 230170222Sdougb <emphasis>not</emphasis> to send the query to the next nameserver 231170222Sdougb if any server responds with a SERVFAIL response, which is the 232174187Sdougb reverse of normal stub resolver behavior. 233170222Sdougb </para> 234135446Strhodes 235170222Sdougb <para> 236170222Sdougb The <option>-m</option> can be used to set the memory usage debugging 237170222Sdougb flags 238170222Sdougb <parameter>record</parameter>, <parameter>usage</parameter> and 239170222Sdougb <parameter>trace</parameter>. 240170222Sdougb </para> 241170222Sdougb </refsect1> 242135446Strhodes 243170222Sdougb <refsect1> 244170222Sdougb <title>IDN SUPPORT</title> 245170222Sdougb <para> 246170222Sdougb If <command>host</command> has been built with IDN (internationalized 247170222Sdougb domain name) support, it can accept and display non-ASCII domain names. 248170222Sdougb <command>host</command> appropriately converts character encoding of 249170222Sdougb domain name before sending a request to DNS server or displaying a 250170222Sdougb reply from the server. 251170222Sdougb If you'd like to turn off the IDN support for some reason, defines 252170222Sdougb the <envar>IDN_DISABLE</envar> environment variable. 253170222Sdougb The IDN support is disabled if the variable is set when 254170222Sdougb <command>host</command> runs. 255170222Sdougb </para> 256170222Sdougb </refsect1> 257135446Strhodes 258170222Sdougb <refsect1> 259170222Sdougb <title>FILES</title> 260170222Sdougb <para><filename>/etc/resolv.conf</filename> 261170222Sdougb </para> 262170222Sdougb </refsect1> 263170222Sdougb 264170222Sdougb <refsect1> 265170222Sdougb <title>SEE ALSO</title> 266170222Sdougb <para><citerefentry> 267170222Sdougb <refentrytitle>dig</refentrytitle><manvolnum>1</manvolnum> 268170222Sdougb </citerefentry>, 269170222Sdougb <citerefentry> 270170222Sdougb <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum> 271170222Sdougb </citerefentry>. 272170222Sdougb </para> 273170222Sdougb 274170222Sdougb </refsect1> 275170222Sdougb</refentry><!-- 276170222Sdougb - Local variables: 277170222Sdougb - mode: sgml 278170222Sdougb - End: 279170222Sdougb--> 280