Host - Simple DNS Lookup Tool¶
``
``
✅ All commands copied to clipboard!
Overview¶
host is a simple DNS lookup utility that provides clean, easy-to-read output for DNS queries. It's designed to be more user-friendly than dig and more straightforward than nslookup, making it ideal for quick DNS lookups and basic troubleshooting tasks.
Basic Syntax¶
Essential Commands¶
Basic DNS Lookups¶
``
``
``
``
Record Type Queries¶
``
``
``
``
``
``
``
``
``
Advanced Options¶
Verbose and Debug Output¶
``
``
``
Timeout and Connection Options¶
``
``
``
``
Query Behavior Options¶
``
``
``
``
Popular DNS Servers¶
Using Different DNS Providers¶
``
``
``
``
Common Use Cases¶
Email Server Troubleshooting¶
``
``
``
Domain Verification¶
``
``
``
Network Diagnostics¶
``
``
``
``
Reverse DNS Lookups¶
``
``
``
Troubleshooting Commands¶
Debug and Verbose Queries¶
``
``
``
``
Command Options Reference¶
Option | Description |
---|---|
-a |
Equivalent to -v and -t ANY |
-C |
Show SOA records from all authoritative servers |
-c class |
Specify query class (default: IN) |
-d |
Enable debug output |
-l |
List mode (zone transfer) |
-n |
Use IP6.INT domain for IPv6 reverse lookups |
-N ndots |
Set number of dots for absolute names |
-r |
Make non-recursive queries |
-R retries |
Set number of UDP retries |
-t type |
Specify query type (A, AAAA, MX, NS, etc.) |
-T |
Use TCP connection |
-v |
Verbose output |
-W seconds |
Set timeout in seconds |
-w |
Wait indefinitely for reply |
Record Types¶
Type | Description | Example |
---|---|---|
A | IPv4 address | host -t A google.com |
AAAA | IPv6 address | host -t AAAA google.com |
CNAME | Canonical name | host -t CNAME www.google.com |
MX | Mail exchange | host -t MX google.com |
NS | Name server | host -t NS google.com |
PTR | Pointer (reverse) | host -t PTR 8.8.8.8 |
SOA | Start of authority | host -t SOA google.com |
SRV | Service record | host -t SRV _sip._tcp.example.com |
TXT | Text record | host -t TXT google.com |
ANY | All records | host -a google.com |
Installation¶
Linux (Ubuntu/Debian)¶
Linux (CentOS/RHEL/Fedora)¶
macOS¶
host comes pre-installed with macOS.
Windows¶
Use Windows Subsystem for Linux (WSL) or install via package managers like Chocolatey.
Tips and Best Practices¶
- Clean output: host provides cleaner, more readable output than dig
- Quick lookups: Ideal for simple DNS queries and basic troubleshooting
- Multiple queries: Can query multiple domains in a single command
- Reverse lookups: Automatically detects IP addresses and performs reverse lookups
- Timeout settings: Use
-W
option for slow or unreliable networks - TCP queries: Use
-T
for large responses or when UDP is blocked - Combine with other tools: Use alongside dig and nslookup for comprehensive analysis
Common Error Messages¶
Error | Meaning |
---|---|
Host not found |
Domain doesn't exist (NXDOMAIN) |
No address associated with hostname |
No A/AAAA records found |
Connection timed out |
DNS server unreachable |
Server failure |
DNS server error (SERVFAIL) |
Query refused |
DNS server refused the query |
Related Commands¶
dig
- More detailed DNS lookup tool with extensive optionsnslookup
- Interactive DNS lookup utilityping
- Test network connectivity and resolve hostnamestraceroute
- Trace network path to destinationwhois
- Domain registration and ownership information