host [-aCdilrTvVw] [-c class] [-N ndots] [-t type] [-W time] [-R number] [-m flag] hostname [server]
-a is equivalent to -v -t ANY -c specifies query class for non-IN data -C compares SOA records on authoritative nameservers -d is equivalent to -v -i IP6.INT reverse lookups -l lists all hosts in a domain, using AXFR -m set memory debugging flag (trace|record|usage) -N changes the number of dots allowed before root lookup is done -r disables recursive processing -R specifies number of retries for UDP packets -s a SERVFAIL response should stop query -t specifies the query type -T enables TCP/IP mode -U enables UDP mode -v enables verbose output -V print version number and exit -w specifies to wait forever for a reply -W specifies how long to wait for a reply -4 use IPv4 query transport only -6 use IPv6 query transport only
$ host example.com example.com has address 22.214.171.124 example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946 example.com mail is handled by 0 .
$ host -t ns example.com example.com name server b.iana-servers.net. example.com name server a.iana-servers.net.
$ host -t txt example.com example.com descriptive text "v=spf1 -all"
$ host 126.96.36.199 188.8.131.52.in-addr.arpa domain name pointer mail.offsec.nl.
A zone transfer is basically a database replication between related DNS servers in which the zone file is copied from a primary DNS server to a secondary server. The zone file contains a list of all the DNS names configured for that zone. Zone transfers should only be allowed to authorized secondary DNS servers but many administrators misconfigure their DNS servers, and in these cases, anyone asking for a copy of the DNS server zone will usually receive one.
$ host -l megacorpone.com ns2.megacorpone.com Using domain server: Name: ns2.megacorpone.com Address: 184.108.40.206#53 Aliases: megacorpone.com name server ns1.megacorpone.com. megacorpone.com name server ns2.megacorpone.com. megacorpone.com name server ns3.megacorpone.com. admin.megacorpone.com has address 220.127.116.11 beta.megacorpone.com has address 18.104.22.168 [...]
To automate this process a script is made available below.
./dns-axfr.sh megacorpone.com admin.megacorpone.com has address 22.214.171.124 beta.megacorpone.com has address 126.96.36.199 fs1.megacorpone.com has address 188.8.131.52 intranet.megacorpone.com has address 184.108.40.206 [...]