khost (1) - Linux Manuals

khost: Simple DNS lookup utility (libknot equivalent of ISC host)


- Simple DNS lookup utility (libknot equivalent of ISC host)


khost [options] name [server]


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 kdig instead.
Is a domain name that is to be looked up. If the name is IPv4 or IPv6 address the PTR query type is used.
Is a name or an address of the nameserver to send a query to. The address can be specified using [address]:port notation. If no server is specified the servers from /etc/resolv.conf are used.
If no arguments are provided, khost prints short help.


Use IPv4 protocol only.
Use IPv6 protocol only.
Send ANY query with verbose mode.
Enable debug messages if any.
Print help.
Disable recursion.
Stop querying next nameserver if SERVFAIL response is received.
Use TCP protocol.
Enable verbose output.
Print program version.
Wait forever for the reply.
-c class
Set query class (e.g. CH, CLASS4). The default class is IN.
-t type
Set query type (e.g. NS, IXFR=12345, TYPE65535). The default is to send 3 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.


Missing features with regard to ISC host

Options -C, -i, -l, -m, -N.

Differences with regard to ISC host

Option -d is not equivalent to -v, but enables debug messages.
The number of retries can be set to zero.
Verbose mode has slightly different format (same as kdig).


Example 1. Get A, AAAA and MX records for
# khost
Example 2. Get reverse record for address
# khost
Example 3. Perform verbose zone transfer for zone
# khost -t AXFR -v




Daniel Salzman (
Please send any bug reports or comments to knot-dns [at]


kdig(1), knsupdate(1).