The host command is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options are given, host command displays a short summary of its command line arguments and options.
[callisto] (~) >>> host example.com
example.com has address 93.184.216.119
example.com has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7
To look up a specific record type you use the -t flag
host -t TYPE example.com
Here we will use it to find the nameservers for a domain:
host -t ns example.com
Now we will look for txt records:
host -t txt example.com
The host command can also be used to find the PTR or reverse DNS entry (rDNS) for a specific IP address. This is handy when troubleshooting mail issues:
[callisto] (~) >>> host 74.125.227.101 101.227.125.74.in-addr.arpa domain name pointer dfw06s16-in-f5.1e100.net.
Specify the nameserver or resolver to query
<pre><code>[callisto] (~) >>> host example.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:
example.com has address 93.184.216.119
example.com has IPv6 address 2606:2800:220:6d:26bf:1447:1097:aa7
Pull the zone file using axfr option (if the zone allows transfers)
host -t axfr example.com ns1.authnameserver.com