host - query nameserver about domain names and zones


host [__-v__? [__-a__? [__-t__ ''querytype''? [''options''? name [''server''? host [__-v__? [__-a__? [__-t__ ''querytype''? [''options''? -l zone [''server''? host [__-v__? [''options''? -H [__-D__? [__-E__? [__-G__? zone host [__-v__? [''options''? -C zone host [__-v__? [''options''? -A host host [''options''? -x [''name'' ...? host [''options''? -X server [''name'' ...?


Besides the traditional short options (one letter with single dash, and an optional value as separate argument), there are now also long options in the format --keyword[=''value''?. Many (but not all) short options have a long equivalent. There are several long options without a short equivalent. The long options are not yet documented in this manual page, but a summary of the existing long options, and the mapping to their short alternative, is available via the command host --help.


host looks for information about Internet hosts and domain names. It gets this information from a set of interconnected servers that are spread across the world. The information is stored in the form of ''

By default, the program simply converts between host names and Internet addresses. However, with the -t, -a and -v options, it can be used to find all of the information about domain names that is maintained by the domain nameserver system. The information printed consists of various fields of the associated resource records that were retrieved.

The arguments can be either host names (domain names) or numeric Internet addresses.

A numeric Internet address consists of four decimal numbers separated by dots, e.g., representing the four bytes of the 32-bit address. The default action is to look up the associated host name.

A host name or domain name consists of component names (labels) separated by dots, e.g. The default action is to look up all of its Internet addresses.

For single names without a trailing dot, the local domain is automatically tacked on the end. Thus a user in domain

Note that the usual lookup convention for any name that does not end with a trailing dot is to try first with the local domain appended, and possibly other search domains. (As of BIND 4.9, names that have embedded dots but no trailing dot are first tried ``as is'' before appending search domains) This convention is not used by this program.

The actual suffix to tack on the end is usually the local domain as specified in the /etc/resolv.conf file, but this can be overridden. See below for a description of how to customize the host name lookup.


The first argument is normally the host name (domain name) for which you want to look up the requested information. If the first argument is an Internet address, a query is done on the special

If the -l option is given, the first argument is a domain zone name for which a complete listing is given. The program enters a special zone listing mode which has several variants (see below).

The second argument is optional. It allows you to specify a particular server to query. If you don't specify this argument, default servers are used, as defined by the /etc/resolv.conf file.


If the -x option is given, it extends the syntax in the sense that multiple arguments are allowed on the command line. An optional explicit server must now be specified using the -X option as it cannot be given as an ordinary argument any more. The -X option implies -x.

The extended syntax allows no arguments at all, in which case the arguments will be read from standard input. This can be a pipe, redirection from a file, or an interactive terminal. Note that these arguments are the names to be queried, and not command options. Everything that appears after a '#' or ';' on an input line will be skipped. Multiple arguments per line are allowed.


There are a number of options that can be used before the specified arguments. Some of these options are meaningful only to the people who maintain the domain database zones. The first options are the regularly used ones.


causes printout to be in a

  • vv__ is


-t querytype

allows you to specify a particular type of resource record information to be looked up. Supported types are listed below. The wildcard may be written as either ANY or *. Types may be given in upper or lower case. The default is type A for regular lookups, and A, NS, and PTR for zone listings.


is equivalent to -t ANY. Note that this gives you __


The following options put the program in a special mode.

-l zone

generates the listing of an entire zone.

E.g. the command host -l will give a listing of all hosts in the

  • t__ option is used to

filter what information is extracted, as you would expect. The default is address information from A records, supplemented with data from PTR and NS records.

The command host -Z -a -l will give a complete download of the zone data for


can be specified instead of the -l option. It will print the count of the unique hostnames (names with an A record) encountered within the zone. It will not count pseudo names like __

By default, this option will not print any resource records.

Combined with the -S option, it will give a complete statistics survey of the zone.

The host count may be affected by duplicate hosts (see below). To compute the most realistic value, subtract the duplicate host count from the total host count.


implies -H, but lists the names of gateway hosts. These are the hosts that have more than one address. Gateway hosts are not checked for duplicate addresses.


implies -H, but lists the names of extrazone hosts. An extrazone host in zone __


implies -H, but lists the names of duplicate hosts. These are hosts with only one address, which is known to have been defined also for another host with a different name, possibly even in a different zone. This may be intentional, but also may be an error.


can be specified instead of the -l option. It causes the SOA records for the specified zone to be compared as found at each of the authoritative nameservers for the zone (as listed in the NS records). Nameserver recursion is turned off, and it will be checked whether the answers are really authoritative. If a server cannot provide an authoritative SOA record, a lame delegation of the zone to that server is reported. Discrepancies between the records are reported. Various sanity checks are performed.


enters a special address check mode.

If the first argument is a host name, its addresses will be retrieved, and for each of the addresses it will be checked whether they map back to the given host.

If the first argument is a dotted quad Internet address, its name will be retrieved, and it will be checked whether the given address is listed among the known addresses belonging to that host.

If the -A flag is specified along with any zone listing option, a reverse lookup of the address in each encountered A record is performed, and it is checked whether it is registered and maps back to the name of the A record. This applies to forward zones. For reverse zones, it is checked whether the target in PTR records maps to a canonical host name.


The following options apply only to the special zone listing modes.

-L level

Recursively generate zone listings up to this level deep. Level 1 traverses the parent zone and all of its delegated zones. Each additional level descends into another layer of delegated zones.


prints statistics about the various types of resource records found during zone listings, the number of various host classifications, the number of delegated zones, and some total statistics after recursive listings.


causes only the primary nameserver of a zone to be contacted for zone transfers during zone listings. Normally, zone transfers are obtained from any one of the authoritative servers that responds. The primary nameserver is obtained from the SOA record of the zone. If a specific server is given on the command line, this option will query that server for the desired nameservers of the zone. This can be used for testing purposes in case the zone has not been registered yet.

-P prefserver

gives priority for zone transfers to preferred servers residing in domains given by the comma-separated list prefserver. The more domain component labels match, the higher the priority. If this option is not present, priority is given to servers within your own domain or parent domains. The order in which NS records are issued may be unfavorable if they are subject to BIND 4.9 round-robin reshuffling.

-N skipzone

prohibits zone transfers for the zones given by the comma-separated list skipzone. This may be used during recursive zone listings when certain zones are known to contain bogus information which should be excluded from further processing.


The following options can be used in both normal mode and domain listing mode.


turns on debugging. Nameserver transactions are shown in detail. Note that -dd prints even more debugging output.

-f filename

writes the resource record output to the given logfile as well as to standard output.

-F filename

same as -f, but exchange the role of stdout and logfile. All stdout output (including verbose and debug printout) goes to the logfile, and stdout gets only the extra resource record output (so that it can be used in pipes).

-I chars

suppresses warning messages about illegal domain names containing invalid characters, by specifying such characters in the string chars. The underscore is a good candidate.


constructs a query for the in-addr.arpa__ domain in case a numeric (dotted quad) address was specified. Useful primarily for zone listing mode, since for numeric regular lookups such query is done anyway (but with -i you see the actual PTR resource record outcome).


constructs a query for the domain in case an nsap address was specified. This can be used to look up the names associated with nsap addresses, or to list reverse nsap zones. An nsap address consists of an even number of hexadecimal digits, with a maximum of 40, optionally separated by interspersed dots. An optional prefix -Z__ option forces the output to be in the official zone file format.


be quiet and suppress various warning messages (the ones preceded by


selects quick mode, in which several potentially time consuming special checks are not carried out, and statistics gathering is skipped if not explicitly selected.


prints the time-to-live values during non-verbose output. By default the ttl is shown only in verbose mode.


prints the selected resource record output in full zone file format, including trailing dot in domain names, plus ttl value and class name.


The following options are used only in special circumstances.

-c class

allows you to specify a particular resource record class. Supported are IN, INTERNET, CS, CSNET, CH, CHAOS, HS, HESIOD, and the wildcard ANY or *. The default class is IN.


excludes information about names that are not residing within the given zone during zone listings, such as some glue records. For regular queries, it suppresses the printing of the


is equivalent to -t MAILB, which filters any of types MB, MR, MG, or MINFO. In addition, MR and MG records will be recursively expanded into MB records.


suppresses the resource record output to stdout. Can be used in combination with the -f option to separate the resource record output from verbose and debug comments and error messages.


causes nameserver recursion to be turned off in the request. This means that the contacted nameserver will return only data it has currently cached in its own database. It will not ask other servers to retrieve the information. Note that nameserver recursion is always turned off when checking SOA records using the -C option. Authoritative servers should have all relevant information available.


Normally querynames are assumed to be fully qualified and are tried as such, unless it is a single name, which is always tried (and only once) in the default domain. This option simulates the default BIND behavior by qualifying any specified name by repeatedly adding search domains, with the exception that the search terminates immediately if the name exists but does not have the desired querytype. The default search domains are constructed from the default domain by repeatedly peeling off the first component, until a final domain with only one dot remains.

-s seconds

specifies a new nameserver timeout value. The program will wait for a nameserver reply in two attempts of this number of seconds. Normally it does 2 attempts of 5 seconds per nameserver address tried. The actual timeout algorithm is slightly more complicated, extending the timeout value dynamically depending on the number of tries and the number of nameserver addresses.


forces the use of virtual circuits (TCP) instead of datagrams (UDP) when issuing nameserver queries. This is slower, but potentially more reliable. Note that a virtual circuit is automatically chosen in case a query exceeds the maximum datagram packet size. Also if a datagram answer turns out to be truncated, the query is retried using virtual circuit. A zone transfer is always done via a virtual circuit.


causes the program to retry forever if the response to a regular query times out. Normally it will time out after some 10 seconds per nameserver address tried.


prints just the version number of the host program, and exits.


The following options are used only in special circumstances.

-O srcaddr

Define an explicit source IP address for sending nameserver queries. This may be necessary for multi-homed hosts with asymmetric routing policy.

-j minport -J maxport

Define a range of explicit port numbers to be assigned to the source IP address of the client socket for sending the nameserver queries and receiving the replies. Normally the kernel chooses a random free port number. This may be an inappropriate number if you are behind a firewall that filters random port numbers on incoming traffic. If only one of -j or -J is given, a single explicit port number is defined. This is ok for UDP queries, but may not be sufficient for TCP queries.


Default options and parameters can be preset in an environment variable HOST_DEFAULTS using the same syntax as on the command line. They will be evaluated before the command line arguments.


The following querytypes (resource record types) are supported. Indicated within parentheses are the various kinds of data fields.

A Host address (dotted quad)

NS Authoritative nameserver (domain name)

MD Mail destination (domain name)

MF Mail forwarder (domain name)


Canonical name for an alias (domain name)


Marks the start of a zone of authority (domain name of primary, domain name of hostmaster, serial, refresh, retry, expiration, default ttl)

MB Mailbox domain name (domain name)

MG Mail group member (domain name)

MR Mail rename domain name (domain name)


Null resource record (no format or data)


Well-known service description (dotted quad, protocol name, list of services)


Domain name pointer (domain name)


Host information (CPU type string, OS type string)


Mailbox or mail list information (request domain name, error domain name)

MX Mail exchanger (preference value, domain name)


Descriptive text (one or more strings)


User information (string)


User identification (number)


Group identification (number)


Unspecified binary data (data)


Matches information of any type available.


Matches any of types MB, MR, MG, or MINFO.


Matches any of types MD, or MF.

The following types have been defined in RFC 1183, but are not yet in general use. They are recognized by this program.

RP Responsible person (domain name for MB, domain name for TXT)


AFS database location (type, domain name)


X25 address (address string)


ISDN address (address string, optional subaddress string)

RT Route through host (preference value, domain name)

The following types have been defined in RFC 1348, but are not yet in general use. They are recognized by this program. RFC 1348 has already been obsoleted by RFC 1637 and RFC 1706, which defines a new experimental usage of NSAP records. This program has now hooks to manipulate them.


NSAP address (encoded address)


NSAP pointer (domain name)

The following are new types as per RFC 1664 and RFC 1712. Note that the GPOS type has been withdrawn already, and has been superseded by the LOC type.

PX X400 to RFC822 mapping (preference value, rfc822 domain, x400 domain)


Geographical position (longitude string, latitude string, altitude string)

The following types have been reserved in RFC 1700, and are defined in RFC 2065 and revised per RFC 2035.


Security signature


Security key


Next valid record

The IP v6 address architecture and DNS extensions are defined in RFC 1884 and RFC 1886.


IP v6 address (address spec with colons)

The following type is documented in RFC 1876.


Geographical location (latitude, longitude, altitude, precision)

The following types have been proposed, but are still in draft.


Endpoint identifier


Nimrod locator


ATM address

The following type is defined per RFC 2168.


Naming authority URN

The following type is proposed in RFC 2052, updated by RFC 2782.


Internet service information

The following type is proposed in RFC 2230.

KX Key exchanger (preference value, domain name)

The following type is defined in RFC 2538.


The following types have been proposed, but are still in draft.




The following type is defined in RFC 2671.



A very good summary and validation of an entire zone can be obtained with the following command:

host -G -S -C -A -L 1 zone



The following messages are printed to show the reason of failure for a particular query. The name of an explicit server, if specified, may be included. If a special class was requested, it is also shown.

Nameserver [''server''? not running

The contacted server host does not have a nameserver running.

Nameserver [''server''? not responding

The nameserver at the contacted server host did not give a reply within the specified time frame.

Nameserver [''server''? not reachable

The network route to the intended server host is blocked.

name does not exist [at ''server''? (Authoritative answer)

The queryname does definitely not exist at all.

name does not exist [at ''server''?, try again

The queryname does not exist, but the answer was not authoritative, so it is still undecided.

name has no type record [at ''server''? (Authoritative answer)

The queryname is valid, but the specified type does not exist. This status is here returned only in case authoritative.

name type record currently not present

Fatal Error:

lib/CachedMarkup.php (In template 'browse' < 'body' < 'html'):257: Error: Pure virtual

Fatal PhpWiki Error

lib/CachedMarkup.php (In template 'browse' < 'body' < 'html'):257: Error: Pure virtual