brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: dig AXFR copies a whole zone from a name server you run

Dig
~/tips/tip-dns-dig-axfr-own-zone

dig @192.168.1.2 example.com AXFR

Requests every record of a DNS zone from a server you run.

Checking a zone record by record gets tedious. If you run the name server yourself, one query can hand you the lot, so you can read it in one go or compare it with what you expect.

dig @192.168.1.2 example.com AXFR

The manual says a zone transfer is requested by giving the type AXFR, and that such queries always go over TCP. The server answers with every record in the zone, starting and ending with the SOA record. A secondary server uses the same mechanism to copy a zone from a primary.

Caveat: most servers refuse the request, and that is the right setting. Zone transfers are normally limited to the secondary servers that need them, because a full list of names shows an outsider what is on your network. If your own server refuses you, check its transfer settings instead of opening it wide.

Only run this against zones you are responsible for. Pulling the zone of someone else’s server is poor manners and may be against their rules. When you only need the answer for one name, dig +noall +answer is the lighter tool.

Further reading: dig manual (BIND 9)

Going deeper: Guide: dig for beginners, look up DNS records and read the answer

More Dig tips dig +noall +answer DS example.com dig nope.iana.org @9.9.9.9 | grep -E 'status|SOA' dig +search nas dig @8.8.8.8 www.google.com +subnet=203.0.113.0/24 dig +yaml example.com A All Dig tips (36) All topics

Link