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.

LinuxlookupbindDNSLow risk
Run `host -t A example.com` to get its A records, or swap the type for `-t MX`, `-t TXT`, or `-t CNAME`.

01Command

Command
$ host -t A example.com

02What 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

RiskLow risk
Requirementsbind9-host or bind9-dnsutils

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • host(1) — DNS lookup utility
    Ubuntu manpages · technical · 2026-09-17
    Evidence: 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