Updated 8 hours ago
The host command is opinionated. Where dig shows you everything and lets you decide what matters, host decides for you—and it's usually right.
Want to know where a domain points? Host gives you the IP address, the IPv6 address if one exists, and the mail server. Three lines. Done. No TTL values you didn't ask for, no authority sections, no additional records. Just answers.
The Basic Query
Output:
That's it. Host looked up multiple record types and presented them in plain English. No flags required.
Reverse Lookups Just Work
Give host an IP address, and it automatically performs a reverse lookup:
Output:
No -x flag. No special syntax. Host recognizes an IP when it sees one and does the right thing.
When You Want Specific Records
The -t flag lets you ask for exactly one record type:
Output:
The common record types:
Asking a Specific DNS Server
Put the server after the domain:
Output:
Host tells you which server answered. Useful when you're checking whether DNS changes have propagated to different resolvers.
When You Need More Detail
The -v flag switches host into verbose mode, revealing the full DNS protocol exchange:
Output:
Now you see TTL values, response timing, and the full query structure. When you need dig-level detail but prefer host's interface, -v delivers.
Reading the Output
Host's responses are sentences, not data dumps:
Success:
Multiple addresses (load balancing):
Alias chain:
Domain doesn't exist:
Server error:
Record type doesn't exist:
The error messages tell you exactly what happened. NXDOMAIN means the domain doesn't exist. SERVFAIL means the DNS server choked. "has no MX record" means the domain exists but doesn't accept email. Host respects your time even when things go wrong.
Scripting
Host's predictable output makes it excellent for scripts:
Extract an IP address:
Check if a domain exists:
Get mail servers:
Compare DNS servers:
Useful Options
What Host Won't Do
Host trades power for simplicity:
- No tracing: Can't follow the delegation path from root servers like
dig +trace - No DNSSEC validation: Limited support for checking signatures
- No interactive mode: One query per invocation
- No output formatting options: You get what you get
When you need these features, use dig. Host isn't trying to be dig. It's trying to be fast and right.
The Philosophy
Every tool makes tradeoffs. Dig chose completeness—show everything, let the user filter. Nslookup chose interactivity—let users explore DNS conversationally. Host chose opinion—show what matters most, in the clearest possible way.
For quick lookups, for scripts, for the ten times a day you just need to know where something points: host gets out of your way and gives you the answer.
Frequently Asked Questions About the host Command
Was this page helpful?