host.docbook 12.2 KB
Newer Older
Evan Hunt's avatar
Evan Hunt committed
1 2
<!DOCTYPE book [
<!ENTITY mdash "&#8212;">]>
3
<!--
4
 - Copyright (C) 2000-2002, 2004, 2005, 2007-2009, 2014-2017  Internet Systems Consortium, Inc. ("ISC")
5
 -
6 7 8
 - This Source Code Form is subject to the terms of the Mozilla Public
 - License, v. 2.0. If a copy of the MPL was not distributed with this
 - file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
-->
10

Evan Hunt's avatar
Evan Hunt committed
11
<!-- Converted by db4-upgrade version 1.0 -->
12
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.host">
Evan Hunt's avatar
Evan Hunt committed
13 14 15
  <info>
    <date>2009-01-20</date>
  </info>
16
  <refentryinfo>
Evan Hunt's avatar
Evan Hunt committed
17 18
    <corpname>ISC</corpname>
    <corpauthor>Internet Systems Consortium, Inc.</corpauthor>
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
  </refentryinfo>

  <refmeta>
    <refentrytitle>host</refentrytitle>
    <manvolnum>1</manvolnum>
    <refmiscinfo>BIND9</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>host</refname>
    <refpurpose>DNS lookup utility</refpurpose>
  </refnamediv>

  <docinfo>
    <copyright>
Mark Andrews's avatar
Mark Andrews committed
34 35 36
      <year>2000</year>
      <year>2001</year>
      <year>2002</year>
37
      <year>2004</year>
Mark Andrews's avatar
Mark Andrews committed
38
      <year>2005</year>
Mark Andrews's avatar
Mark Andrews committed
39
      <year>2007</year>
Automatic Updater's avatar
Automatic Updater committed
40
      <year>2008</year>
Automatic Updater's avatar
Automatic Updater committed
41
      <year>2009</year>
Tinderbox User's avatar
Tinderbox User committed
42
      <year>2014</year>
43
      <year>2015</year>
44
      <year>2016</year>
45
      <year>2017</year>
46 47 48 49 50
      <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
    </copyright>
  </docinfo>

  <refsynopsisdiv>
Evan Hunt's avatar
Evan Hunt committed
51
    <cmdsynopsis sepchar=" ">
52
      <command>host</command>
Evan Hunt's avatar
Evan Hunt committed
53
      <arg choice="opt" rep="norepeat"><option>-aACdlnrsTwv</option></arg>
Evan Hunt's avatar
Evan Hunt committed
54 55 56 57 58 59 60 61 62 63 64 65
      <arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-N <replaceable class="parameter">ndots</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-R <replaceable class="parameter">number</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-t <replaceable class="parameter">type</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-W <replaceable class="parameter">wait</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
      <arg choice="opt" rep="norepeat"><option>-4</option></arg>
      <arg choice="opt" rep="norepeat"><option>-6</option></arg>
      <arg choice="opt" rep="norepeat"><option>-v</option></arg>
      <arg choice="opt" rep="norepeat"><option>-V</option></arg>
      <arg choice="req" rep="norepeat">name</arg>
      <arg choice="opt" rep="norepeat">server</arg>
66 67 68
    </cmdsynopsis>
  </refsynopsisdiv>

Evan Hunt's avatar
Evan Hunt committed
69
  <refsection><info><title>DESCRIPTION</title></info>
70

71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

    <para><command>host</command>
      is a simple utility for performing DNS lookups.
      It is normally used to convert names to IP addresses and vice versa.
      When no arguments or options are given,
      <command>host</command>
      prints a short summary of its command line arguments and options.
    </para>

    <para><parameter>name</parameter> is the domain name that is to be
      looked
      up.  It can also be a dotted-decimal IPv4 address or a colon-delimited
      IPv6 address, in which case <command>host</command> will by
      default
      perform a reverse lookup for that address.
      <parameter>server</parameter> is an optional argument which
      is either
      the name or IP address of the name server that <command>host</command>
      should query instead of the server or servers listed in
      <filename>/etc/resolv.conf</filename>.
    </para>

Mark Andrews's avatar
Mark Andrews committed
93
  </refsection>
94

Mark Andrews's avatar
Mark Andrews committed
95
  <refsection><info><title>OPTIONS</title></info>
96

Mark Andrews's avatar
Mark Andrews committed
97
    <variablelist>
98

Mark Andrews's avatar
Mark Andrews committed
99 100 101 102 103 104 105 106 107
      <varlistentry>
	<term>-4</term>
	<listitem>
	  <para>
	    Use IPv4 only for query transport.
	    See also the <option>-6</option> option.
	  </para>
	</listitem>
      </varlistentry>
108

Mark Andrews's avatar
Mark Andrews committed
109 110 111 112 113 114 115 116 117
      <varlistentry>
	<term>-6</term>
	<listitem>
	  <para>
	    Use IPv6 only for query transport.
	    See also the <option>-4</option> option.
	  </para>
	</listitem>
      </varlistentry>
118

Mark Andrews's avatar
Mark Andrews committed
119 120 121 122 123
      <varlistentry>
	<term>-a</term>
	<listitem>
	  <para>
	    "All". The <option>-a</option> option is normally equivalent
124
	    to <option>-v -t <literal>ANY</literal></option>.
Mark Andrews's avatar
Mark Andrews committed
125 126 127 128 129
	    It also affects the behaviour of the <option>-l</option>
	    list zone option.
	  </para>
	</listitem>
      </varlistentry>
130

Evan Hunt's avatar
Evan Hunt committed
131 132 133 134 135 136 137 138 139 140 141
      <varlistentry>
	<term>-A</term>
	<listitem>
	  <para>
	    "Almost all". The <option>-A</option> option is equivalent
	    to <option>-a</option> except RRSIG, NSEC, and NSEC3
	    records are omitted from the output.
	  </para>
	</listitem>
      </varlistentry>

Mark Andrews's avatar
Mark Andrews committed
142 143 144 145
      <varlistentry>
	<term>-c <replaceable class="parameter">class</replaceable></term>
	<listitem>
	  <para>
146 147
	    Query class: This can be used to lookup HS (Hesiod) or CH
	    (Chaosnet) class resource records. The default class is IN
Mark Andrews's avatar
Mark Andrews committed
148 149 150 151
	    (Internet).
	  </para>
	</listitem>
      </varlistentry>
152

Mark Andrews's avatar
Mark Andrews committed
153 154 155 156 157 158 159 160 161 162 163 164
      <varlistentry>
	<term>-C</term>
	<listitem>
	  <para>
	    Check consistency: <command>host</command> will query the
	    SOA records for zone <parameter>name</parameter> from all
	    the listed authoritative name servers for that zone. The
	    list of name servers is defined by the NS records that are
	    found for the zone.
	  </para>
	</listitem>
      </varlistentry>
165

Mark Andrews's avatar
Mark Andrews committed
166 167 168 169 170 171 172 173 174
      <varlistentry>
	<term>-d</term>
	<listitem>
	  <para>
	    Print debugging traces.
	    Equivalent to the <option>-v</option> verbose option.
	  </para>
	</listitem>
      </varlistentry>
175

Mark Andrews's avatar
Mark Andrews committed
176 177 178 179 180 181 182 183 184 185 186
      <varlistentry>
	<term>-i</term>
	<listitem>
	  <para>
	    Obsolete.
	    Use the IP6.INT domain for reverse lookups of IPv6
	    addresses as defined in RFC1886 and deprecated in RFC4159.
	    The default is to use IP6.ARPA as specified in RFC3596.
	  </para>
	</listitem>
      </varlistentry>
187

Mark Andrews's avatar
Mark Andrews committed
188 189 190 191 192
      <varlistentry>
	<term>-l</term>
	<listitem>
	  <para>
	    List zone:
193
	    The <command>host</command> command performs a zone transfer of
Mark Andrews's avatar
Mark Andrews committed
194 195 196 197
	    zone <parameter>name</parameter> and prints out the NS,
	    PTR and address records (A/AAAA).
	  </para>
	  <para>
198
	    Together, the <option>-l -a</option>
Mark Andrews's avatar
Mark Andrews committed
199 200 201 202
	    options print all records in the zone.
	  </para>
	</listitem>
      </varlistentry>
203

Mark Andrews's avatar
Mark Andrews committed
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
      <varlistentry>
	<term>-N <replaceable class="parameter">ndots</replaceable></term>
	<listitem>
	  <para>
	    The number of dots that have to be
	    in <parameter>name</parameter> for it to be considered
	    absolute. The default value is that defined using the
	    ndots statement in <filename>/etc/resolv.conf</filename>,
	    or 1 if no ndots statement is present. Names with fewer
	    dots are interpreted as relative names and will be
	    searched for in the domains listed in
	    the <type>search</type> or <type>domain</type> directive
	    in <filename>/etc/resolv.conf</filename>.
	  </para>
	</listitem>
      </varlistentry>
220

Mark Andrews's avatar
Mark Andrews committed
221 222 223 224 225
      <varlistentry>
	<term>-r</term>
	<listitem>
	  <para>
	    Non-recursive query:
226 227 228 229
	    Setting this option clears the RD (recursion desired) bit
	    in the query. This should mean that the name server
	    receiving the query will not attempt to
	    resolve <parameter>name</parameter>.
Mark Andrews's avatar
Mark Andrews committed
230 231 232 233 234 235 236 237
	    The <option>-r</option> option
	    enables <command>host</command> to mimic the behavior of a
	    name server by making non-recursive queries and expecting
	    to receive answers to those queries that can be
	    referrals to other name servers.
	  </para>
	</listitem>
      </varlistentry>
238

Mark Andrews's avatar
Mark Andrews committed
239 240 241 242 243 244 245 246 247 248 249 250
      <varlistentry>
	<term>-R <replaceable class="parameter">number</replaceable></term>
	<listitem>
	  <para>
	    Number of retries for UDP queries:
	    If <parameter>number</parameter> is negative or zero, the
	    number of retries will default to 1. The default value is
	    1, or the value of the <parameter>attempts</parameter>
	    option in <filename>/etc/resolv.conf</filename>, if set.
	  </para>
	</listitem>
      </varlistentry>
251

Mark Andrews's avatar
Mark Andrews committed
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
      <varlistentry>
	<term>-s</term>
	<listitem>
	  <para>
	    Do <emphasis>not</emphasis> send the query to the next
	    nameserver if any server responds with a SERVFAIL
	    response, which is the reverse of normal stub resolver
	    behavior.
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>-t <replaceable class="parameter">type</replaceable></term>
	<listitem>
	  <para>
	    Query type:
269
	    The <parameter>type</parameter> argument can be any
Mark Andrews's avatar
Mark Andrews committed
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
	    recognized query type: CNAME, NS, SOA, TXT, DNSKEY, AXFR, etc.
	  </para>
	  <para>
	    When no query type is specified, <command>host</command>
	    automatically selects an appropriate query type. By default, it
	    looks for A, AAAA, and MX records.
	    If the <option>-C</option> option is given, queries will
	    be made for SOA records.
	    If <parameter>name</parameter> is a dotted-decimal IPv4
	    address or colon-delimited IPv6
	    address, <command>host</command> will query for PTR
	    records.
	  </para>
	  <para>
	    If a query type of IXFR is chosen the starting serial
	    number can be specified by appending an equal followed by
	    the starting serial number
287
	    (like <option>-t <literal>IXFR=12345678</literal></option>).
Mark Andrews's avatar
Mark Andrews committed
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>-T</term>
	<listitem>
	  <para>
	    TCP:
	    By default, <command>host</command> uses UDP when making
	    queries. The <option>-T</option> option makes it use a TCP
	    connection when querying the name server. TCP will be
	    automatically selected for queries that require it, such
	    as zone transfer (AXFR) requests.
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>-m <replaceable class="parameter">flag</replaceable></term>
	<listitem>
	  <para>
	    Memory usage debugging: the flag can
	    be <parameter>record</parameter>, <parameter>usage</parameter>,
	    or <parameter>trace</parameter>. You can specify
	    the <option>-m</option> option more than once to set
	    multiple flags.
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>-v</term>
	<listitem>
	  <para>
	    Verbose output.
	    Equivalent to the <option>-d</option> debug option.
	    Verbose output can also be enabled by setting
	    the <parameter>debug</parameter> option
327
	    in <filename>/etc/resolv.conf</filename>.
Mark Andrews's avatar
Mark Andrews committed
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>-V</term>
	<listitem>
	  <para>
	    Print the version number and exit.
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>-w</term>
	<listitem>
	  <para>
345
	    Wait forever: The query timeout is set to the maximum possible.
Mark Andrews's avatar
Mark Andrews committed
346 347 348 349 350 351 352 353 354
	    See also the <option>-W</option> option.
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>-W <replaceable class="parameter">wait</replaceable></term>
	<listitem>
	  <para>
355
	    Timeout: Wait for up to <parameter>wait</parameter>
Mark Andrews's avatar
Mark Andrews committed
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
	    seconds for a reply. If <parameter>wait</parameter> is
	    less than one, the wait interval is set to one second.
	  </para>
	  <para>
	    By default, <command>host</command> will wait for 5
	    seconds for UDP responses and 10 seconds for TCP
	    connections. These defaults can be overridden by
	    the <parameter>timeout</parameter> option
	    in <filename>/etc/resolv.conf</filename>.
	  </para>
	  <para>
	    See also the <option>-w</option> option.
	  </para>
	</listitem>
      </varlistentry>

    </variablelist>
373

Evan Hunt's avatar
Evan Hunt committed
374
  </refsection>
375

Evan Hunt's avatar
Evan Hunt committed
376
  <refsection><info><title>IDN SUPPORT</title></info>
377

378 379
    <para>
      If <command>host</command> has been built with IDN (internationalized
380
      domain name) support, it can accept and display non-ASCII domain names.
381 382 383 384 385 386 387 388
      <command>host</command> appropriately converts character encoding of
      domain name before sending a request to DNS server or displaying a
      reply from the server.
      If you'd like to turn off the IDN support for some reason, defines
      the <envar>IDN_DISABLE</envar> environment variable.
      The IDN support is disabled if the variable is set when
      <command>host</command> runs.
    </para>
Evan Hunt's avatar
Evan Hunt committed
389 390 391
  </refsection>

  <refsection><info><title>FILES</title></info>
392

393 394
    <para><filename>/etc/resolv.conf</filename>
    </para>
Evan Hunt's avatar
Evan Hunt committed
395 396 397
  </refsection>

  <refsection><info><title>SEE ALSO</title></info>
398 399 400 401 402 403 404 405

    <para><citerefentry>
        <refentrytitle>dig</refentrytitle><manvolnum>1</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>.
    </para>
Evan Hunt's avatar
Evan Hunt committed
406
  </refsection>
407

Evan Hunt's avatar
Evan Hunt committed
408
</refentry>