Name

host

Synopsis

host [options] host [server]

host [options] zone [server]

Description

System administration command. Print information about specified hosts or zones in DNS. Hosts may be IP addresses or hostnames; host converts IP addresses to hostnames by default and appends the local domain to hosts without a trailing dot. Default servers are determined in /etc/resolv.conf. For more information about hosts and zones, try Chapters 1 and 2 of DNS and BIND by Paul Albitz and Cricket Liu, published by O’Reilly & Associates.

Options

-a

Same as -t ANY.

-c class

Search for specified resource record class (IN, INTERNET, CS, CSNET, CH, CHAOS, HS, HESIOD, ANY, or *). Default is IN.

-d

Debugging mode. -dd is a more verbose version.

-e

Do not print information about domains outside of specified zone. For hostname queries, do not print “additional information” or “authoritative nameserver.”

-f file

Output to file as well as standard out.

-i

Given an IP address, return the corresponding in-addr.arpa address, class (always PTR), and hostname.

-l zone

List all machines in zone.

-m

Print only MR, MG, and MB records; recursively expand MR (renamed mail box) and MG (mail group) records to MB (mail box) records.

-o

Do not print output to standard out.

-p [server]

For use with -l. Query only the zone’s primary nameserver (or server) for zone transfers, instead of those authoritative servers that respond. Useful for testing unregistered zones.

-q

Quiet. Suppress warning, but not error, messages.

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.