host Command
Beginner Networking man(1)DNS lookup utility (simple)
👁 8 views
📅 Updated: Mar 15, 2026
SYNTAX
host [OPTION]... NAME [SERVER]
What Does host Do?
host is a simple DNS lookup utility that converts domain names to IP addresses and vice versa. It is simpler and more concise than dig or nslookup for basic DNS queries.
host supports all standard DNS record types and can query specific name servers. Its output is clean and human-readable, making it ideal for quick checks and scripts.
host is part of the BIND utilities package and is available on most Linux distributions.
host supports all standard DNS record types and can query specific name servers. Its output is clean and human-readable, making it ideal for quick checks and scripts.
host is part of the BIND utilities package and is available on most Linux distributions.
Options & Flags
| Option | Description | Example |
|---|---|---|
| domain | Look up A record | host example.com |
| -t | Specify record type | host -t MX example.com |
| -a | Show all DNS records | host -a example.com |
| -v | Verbose output | host -v example.com |
| server | Use specific DNS server | host example.com 8.8.8.8 |
Practical Examples
#1 Basic lookup
Shows IP addresses for the domain.
$ host example.com
Output:
example.com has address 93.184.216.34\nexample.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946
#2 MX records
Shows mail server records.
$ host -t MX example.com
Output:
example.com mail is handled by 10 mail.example.com
#3 Reverse lookup
Finds domain name for an IP.
$ host 8.8.8.8
Output:
8.8.8.8.in-addr.arpa domain name pointer dns.google
#4 All records
Shows all DNS record types for the domain.
$ host -a example.com#5 TXT records
Shows TXT records (SPF, verification, etc.).
$ host -t TXT example.com#6 Use specific server
Queries Cloudflare DNS.
$ host example.com 1.1.1.1Tips & Best Practices
Simplest DNS tool: host gives the cleanest output for quick DNS checks. Use dig for detailed debugging, host for quick answers.
Check DNS propagation: Query multiple DNS servers to check propagation: host domain 8.8.8.8, host domain 1.1.1.1.
May not be installed: host is part of bind-utils/dnsutils package. Install with: apt install dnsutils or yum install bind-utils.
Frequently Asked Questions
How do I check DNS records?
host domain.com shows A/AAAA records. host -t MX domain.com for mail. host -a domain.com for all records.
How do I do a reverse DNS lookup?
host IP_ADDRESS returns the domain name associated with the IP.
What is the difference between host and dig?
host gives concise output for quick checks. dig gives detailed output with TTLs, flags, and authority info.
Related Commands
More Networking Commands
Master Linux with Professional eBooks
Curated IT eBooks covering Linux, DevOps, Cloud, and more
Browse Books →