host
Networking
Usage
host [-t <type>] <name> [server]Answers a name lookup in two or three short lines of addresses and mail servers; it is the handiest for a quick check, but for the full record view you need dig.
Common flags
| Flag | Meaning |
|---|---|
| -t MX | Restrict to one record type. |
| -a | Everything, equivalent to -t ANY -v. |
| -v | Verbose output closer to what dig prints. |
| -C | Fetch the SOA from every authoritative server, to spot one that is out of sync. |
| <ip> | Give it an address and it does the reverse lookup by itself. |
Examples
host example.comAddresses and mail servers in three short lines.
host -t TXT example.comRead the SPF or verification records.
host 8.8.8.8Reverse lookup without needing -x.
When a connection fails, these narrow down how far it got — name not resolving, no route, or a blocked port.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does host do?
Answers a name lookup in two or three short lines of addresses and mail servers; it is the handiest for a quick check, but for the full record view you need dig.
Q. How do I type it?
host [-t <type>] <name> [server] — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
5 are listed here; the full set is in man host. This command sits under Networking.
Related commands
man page: man host