xref: /minix/external/bsd/bind/dist/bin/dig/host.docbook (revision 00b67f09)
1<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2               "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3	       [<!ENTITY mdash "&#8212;">]>
4<!--
5 - Copyright (C) 2004, 2005, 2007-2009, 2014  Internet Systems Consortium, Inc. ("ISC")
6 - Copyright (C) 2000-2002  Internet Software Consortium.
7 -
8 - Permission to use, copy, modify, and/or distribute this software for any
9 - purpose with or without fee is hereby granted, provided that the above
10 - copyright notice and this permission notice appear in all copies.
11 -
12 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
13 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14 - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18 - PERFORMANCE OF THIS SOFTWARE.
19-->
20
21<refentry id="man.host">
22
23  <refentryinfo>
24    <date>January 20, 2009</date>
25  </refentryinfo>
26
27  <refmeta>
28    <refentrytitle>host</refentrytitle>
29    <manvolnum>1</manvolnum>
30    <refmiscinfo>BIND9</refmiscinfo>
31  </refmeta>
32
33  <refnamediv>
34    <refname>host</refname>
35    <refpurpose>DNS lookup utility</refpurpose>
36  </refnamediv>
37
38  <docinfo>
39    <copyright>
40      <year>2004</year>
41      <year>2005</year>
42      <year>2007</year>
43      <year>2008</year>
44      <year>2009</year>
45      <year>2014</year>
46      <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
47    </copyright>
48    <copyright>
49      <year>2000</year>
50      <year>2001</year>
51      <year>2002</year>
52      <holder>Internet Software Consortium.</holder>
53    </copyright>
54  </docinfo>
55
56  <refsynopsisdiv>
57    <cmdsynopsis>
58      <command>host</command>
59      <arg><option>-aCdlnrsTwv</option></arg>
60      <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
61      <arg><option>-N <replaceable class="parameter">ndots</replaceable></option></arg>
62      <arg><option>-R <replaceable class="parameter">number</replaceable></option></arg>
63      <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
64      <arg><option>-W <replaceable class="parameter">wait</replaceable></option></arg>
65      <arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
66      <arg><option>-4</option></arg>
67      <arg><option>-6</option></arg>
68      <arg><option>-v</option></arg>
69      <arg><option>-V</option></arg>
70      <arg choice="req">name</arg>
71      <arg choice="opt">server</arg>
72    </cmdsynopsis>
73  </refsynopsisdiv>
74
75  <refsect1>
76    <title>DESCRIPTION</title>
77
78    <para><command>host</command>
79      is a simple utility for performing DNS lookups.
80      It is normally used to convert names to IP addresses and vice versa.
81      When no arguments or options are given,
82      <command>host</command>
83      prints a short summary of its command line arguments and options.
84    </para>
85
86    <para><parameter>name</parameter> is the domain name that is to be
87      looked
88      up.  It can also be a dotted-decimal IPv4 address or a colon-delimited
89      IPv6 address, in which case <command>host</command> will by
90      default
91      perform a reverse lookup for that address.
92      <parameter>server</parameter> is an optional argument which
93      is either
94      the name or IP address of the name server that <command>host</command>
95      should query instead of the server or servers listed in
96      <filename>/etc/resolv.conf</filename>.
97    </para>
98
99    <para>
100      The <option>-a</option> (all) option is equivalent to setting the
101      <option>-v</option> option and asking <command>host</command> to make
102      a query of type ANY.
103    </para>
104
105    <para>
106      When the <option>-C</option> option is used, <command>host</command>
107      will attempt to display the SOA records for zone
108      <parameter>name</parameter> from all the listed
109      authoritative name
110      servers for that zone.  The list of name servers is defined by the NS
111      records that are found for the zone.
112    </para>
113
114    <para>
115      The <option>-c</option> option instructs to make a DNS query of class
116      <parameter>class</parameter>.  This can be used to lookup
117      Hesiod or
118      Chaosnet class resource records.  The default class is IN (Internet).
119    </para>
120
121    <para>
122      Verbose output is generated by <command>host</command> when
123      the
124      <option>-d</option> or <option>-v</option> option is used.  The two
125      options are equivalent.  They have been provided for backwards
126      compatibility.  In previous versions, the <option>-d</option> option
127      switched on debugging traces and <option>-v</option> enabled verbose
128      output.
129    </para>
130
131    <para>
132      List mode is selected by the <option>-l</option> option.  This makes
133      <command>host</command> perform a zone transfer for zone
134      <parameter>name</parameter>.  Transfer the zone printing out
135      the NS, PTR
136      and address records (A/AAAA).  If combined with <option>-a</option>
137      all records will be printed.
138    </para>
139
140    <para>
141      The <option>-i</option>
142      option specifies that reverse lookups of IPv6 addresses should
143      use the IP6.INT domain as defined in RFC1886.
144      The default is to use IP6.ARPA.
145    </para>
146
147    <para>
148      The <option>-N</option> option sets the number of dots that have to be
149      in <parameter>name</parameter> for it to be considered
150      absolute.  The
151      default value is that defined using the ndots statement in
152      <filename>/etc/resolv.conf</filename>, or 1 if no ndots
153      statement is
154      present.  Names with fewer dots are interpreted as relative names and
155      will be searched for in the domains listed in the <type>search</type>
156      or <type>domain</type> directive in
157      <filename>/etc/resolv.conf</filename>.
158    </para>
159
160    <para>
161      The number of UDP retries for a lookup can be changed with the
162      <option>-R</option> option.  <parameter>number</parameter>
163      indicates
164      how many times <command>host</command> will repeat a query
165      that does
166      not get answered.  The default number of retries is 1.  If
167      <parameter>number</parameter> is negative or zero, the
168      number of
169      retries will default to 1.
170    </para>
171
172    <para>
173      Non-recursive queries can be made via the <option>-r</option> option.
174      Setting this option clears the <type>RD</type> &mdash; recursion
175      desired &mdash; bit in the query which <command>host</command> makes.
176      This should mean that the name server receiving the query will not
177      attempt to resolve <parameter>name</parameter>.  The
178      <option>-r</option> option enables <command>host</command>
179      to mimic
180      the behavior of a name server by making non-recursive queries and
181      expecting to receive answers to those queries that are usually
182      referrals to other name servers.
183    </para>
184
185    <para>
186      By default, <command>host</command> uses UDP when making
187      queries.  The
188      <option>-T</option> option makes it use a TCP connection when querying
189      the name server.  TCP will be automatically selected for queries that
190      require it, such as zone transfer (AXFR) requests.
191    </para>
192
193    <para>
194      The <option>-4</option> option forces <command>host</command> to only
195      use IPv4 query transport.  The <option>-6</option> option forces
196      <command>host</command> to only use IPv6 query transport.
197    </para>
198
199    <para>
200      The <option>-t</option> option is used to select the query type.
201      <parameter>type</parameter> can be any recognized query
202      type: CNAME,
203      NS, SOA, SIG, KEY, AXFR, etc.  When no query type is specified,
204      <command>host</command> automatically selects an appropriate
205      query
206      type.  By default, it looks for A, AAAA, and MX records, but if the
207      <option>-C</option> option was given, queries will be made for SOA
208      records, and if <parameter>name</parameter> is a
209      dotted-decimal IPv4
210      address or colon-delimited IPv6 address, <command>host</command> will
211      query for PTR records.  If a query type of IXFR is chosen the starting
212      serial number can be specified by appending an equal followed by the
213      starting serial number (e.g. -t IXFR=12345678).
214    </para>
215
216    <para>
217      The time to wait for a reply can be controlled through the
218      <option>-W</option> and <option>-w</option> options.  The
219      <option>-W</option> option makes <command>host</command>
220      wait for
221      <parameter>wait</parameter> seconds.  If <parameter>wait</parameter>
222      is less than one, the wait interval is set to one second.  When the
223      <option>-w</option> option is used, <command>host</command>
224      will
225      effectively wait forever for a reply.  The time to wait for a response
226      will be set to the number of seconds given by the hardware's maximum
227      value for an integer quantity.
228    </para>
229
230    <para>
231      The <option>-s</option> option tells <command>host</command>
232      <emphasis>not</emphasis> to send the query to the next nameserver
233      if any server responds with a SERVFAIL response, which is the
234      reverse of normal stub resolver behavior.
235    </para>
236
237    <para>
238      The <option>-m</option> can be used to set the memory usage debugging
239      flags
240      <parameter>record</parameter>, <parameter>usage</parameter> and
241      <parameter>trace</parameter>.
242    </para>
243
244    <para>
245      The <option>-V</option> option causes <command>host</command>
246      to print the version number and exit.
247    </para>
248  </refsect1>
249
250  <refsect1>
251    <title>IDN SUPPORT</title>
252    <para>
253      If <command>host</command> has been built with IDN (internationalized
254      domain name) support, it can accept and display non-ASCII domain names.
255      <command>host</command> appropriately converts character encoding of
256      domain name before sending a request to DNS server or displaying a
257      reply from the server.
258      If you'd like to turn off the IDN support for some reason, defines
259      the <envar>IDN_DISABLE</envar> environment variable.
260      The IDN support is disabled if the variable is set when
261      <command>host</command> runs.
262    </para>
263  </refsect1>
264
265  <refsect1>
266    <title>FILES</title>
267    <para><filename>/etc/resolv.conf</filename>
268    </para>
269  </refsect1>
270
271  <refsect1>
272    <title>SEE ALSO</title>
273    <para><citerefentry>
274        <refentrytitle>dig</refentrytitle><manvolnum>1</manvolnum>
275      </citerefentry>,
276      <citerefentry>
277        <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
278      </citerefentry>.
279    </para>
280
281  </refsect1>
282</refentry><!--
283 - Local variables:
284 - mode: sgml
285 - End:
286-->
287