Dump A DNS Zone
Problem
You want to know what the current content of a DNS zone is.
Possible Solution
This will work if your DNS server is friendly:
$ dig -t AXFR @$SERVER $ZONE
A reader pointed out an error I made, and adds…
The @ is important because it tells dig which dns server to ask. If you don't put the @ sign, then dig does TWO lookups, using the dns server defined in /etc/resolv.conf for both. First it tries to lookup $SERVER, then it tries to lookup $ZONE.
(Thanks Todd.)