Quick DNS lookups with the host command
Use the often-forgotten host utility — the terse sibling of dig — to resolve names and fetch MX, TXT, or CNAME records.
01Command
$ host -t A example.com02What it does
Most people reach for dig and then squint at the answer section; `host` prints just the records, one per line, which is ideal in scripts. With no `-t` flag it guesses the sensible type: names resolve to A/AAAA, while service names return MX or SOA automatically. Add a server argument (`host example.com 1.1.1.1`) to query a specific resolver.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- host(1) — DNS lookup utilityEvidence: Documents host as a simple DNS lookup utility and the -t option for selecting the query type (A, MX, TXT, CNAME).
Last verified: 2026-09-17 · Category: Network
06Related solutions
On systemd-based Linux (Ubuntu, Fedora, Debian 12+), the local DNS stub cache is managed by systemd-resolved — and the command to clear it is easy to forget because it changed from systemd-resolve.
Query any DNS record type for a domain, with a compact answer or the full response including headers and TTLs.