Network
host
Perform simple DNS lookups.
dnslookupdomainipnetwork
Additional Notes
host is a simple DNS lookup tool. It resolves names to addresses, addresses to names, and can query specific DNS record types.
It is easier to read than dig for quick checks, while dig is better for detailed DNS troubleshooting.
Syntax
host [options] name [server]
Parameters
options: Flags that change howhostbehaves.name: Domain name or IP address to look up.
Common Options
-t TYPE: Query record type such asA,AAAA,MX,TXT, orNS.-a: Show all available information.-v: Verbose output.-W SECONDS: Set wait timeout.
Examples
host example.com
Resolve a domain.
host 8.8.8.8
Reverse lookup an IP address.
host -t MX example.com
Query mail records.
host -t TXT example.com
Query TXT records.
host example.com 1.1.1.1
Ask a specific DNS server.
Practical Notes
- Use
dig +shortfor script-friendly output. - DNS results may differ by resolver and cache.
- If
ping 8.8.8.8works buthost example.comfails, suspect DNS.