man_khost.rst 1.94 KB
Newer Older
1 2
.. highlight:: console

3 4
khost – Simple DNS lookup utility
=================================
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

Synopsis
--------

:program:`khost` [*options*] *name* [*server*]

Description
-----------

This utility sends a DNS query for the *name* to the *server* and prints a reply
in more user-readable form. For more advanced DNS queries use :program:`kdig`
instead.

Parameters
..........

*name*
  Is a domain name that is to be looked up. If the *name* is IPv4 or IPv6
  address the PTR query type is used.

*server*
  Is a name or an address of the nameserver to send a query to.  The address
27
  can be specified using [address]:port notation. If no server is specified,
28 29
  the servers from :file:`/etc/resolv.conf` are used.

30
If no arguments are provided, :program:`khost` prints a short help.
31 32 33 34 35

Options
.......

**-4**
36
  Use the IPv4 protocol only.
37 38

**-6**
39
  Use the IPv6 protocol only.
40 41 42 43 44 45 46 47

**-a**
  Send ANY query with verbose mode.

**-d**
  Enable debug messages.

**-h**, **--help**
48
  Print the program help.
49 50 51 52 53

**-r**
  Disable recursion.

**-T**
54
  Use the TCP protocol.
55 56 57 58 59

**-v**
  Enable verbose output.

**-V**, **--version**
60
  Print the program version.
61 62 63 64 65

**-w**
  Wait forever for the reply.

**-c** *class*
66
  Set the query class (e.g. CH, CLASS4). The default class is IN.
67 68

**-t** *type*
69
  Set the query type (e.g. NS, IXFR=12345, TYPE65535). The default is to send 3
70 71 72 73 74 75 76 77 78 79 80 81
  queries (A, AAAA and MX).

**-R** *retries*
  The number (>=0) of UDP retries to query a nameserver. The default is 1.

**-W** *wait*
  The time to wait for a reply in seconds. This timeout applies to each query
  try. The default is 2 seconds.

Examples
--------

82
1. Get the A, AAAA and MX records for example.com::
83 84 85

     $ khost example.com

86
2. Get the reverse record for address 192.0.2.1::
87 88 89

     $ khost 192.0.2.1

90
3. Perform a verbose zone transfer for zone example.com::
91 92 93 94 95 96 97 98 99 100 101 102

     $ khost -t AXFR -v example.com

Files
-----

:file:`/etc/resolv.conf`

See Also
--------

:manpage:`kdig(1)`, :manpage:`knsupdate(1)`.