Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · names

host

DNS answers in plain words

host is the shortest way to do a DNS lookup. It prints each record as a sentence — "has address", "mail is handled by" — which makes it easy to read and easy to use in scripts.

dig for the full picture; host for a one-line answer.

Forward
host NAME
addresses and mail servers
Reverse
host ADDRESS
the name for an IP
Record type
-t TYPE
NS, MX, TXT, AAAA
Another server
host NAME SERVER
as a second argument

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

user@netflow — bashbind9-host
$ host example.com
1example.com has address 192.0.2.80
example.com has IPv6 address 2001:db8::80
2example.com mail is handled by 10 mail.example.com.
3$ host 192.0.2.80
80.2.0.192.in-addr.arpa domain name pointer www.example.com.
4$ host nosuchname.example
Host nosuchname.example not found: 3(NXDOMAIN)
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
A and AAAA records

The IPv4 and IPv6 addresses. host asks for several record types at once.

2
The MX record

Mail for the domain goes to mail.example.com. The 10 is the priority; lower numbers are tried first.

3
A reverse lookup

The address is reversed and looked up under in-addr.arpa. The PTR record gives the name.

4
NXDOMAIN

The DNS says this name does not exist — different from a timeout, which would mean no server answered.

Switches

A switch changes how the command behaves. These are the ones used day to day; man host lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.

-t TYPE
Ask for a record type.
-a
Ask for all records and print the full response.
-4
Use IPv4 for the query. -6 uses IPv6.
-W SECS
Wait this long for a reply.
-v
Verbose output.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

host -t NS example.com

Lists the domain’s name servers.

host -t TXT example.com

Shows its TXT records.

host example.com 192.0.2.53

Asks a particular DNS server.

host -a example.com

Asks for every record type and prints the full response.

In cybersecurity

Forward and reverse lookups that disagree are a useful warning.

Reverse DNS as a check

Mail servers compare a sender’s address with its PTR record. A mismatch is one of the signals used to reject spam.

Names in logs can be chosen

Whoever controls an address block controls its PTR records, so a reverse name in a log is a claim, not a fact. Log the address too.

NXDOMAIN and timeout differ

"Not found" is an answer; no reply at all means DNS is being blocked or is down. They call for different fixes.

Protocols it shows

DNSUDP

Read alongside