Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I get the BIND zone file output using the DIG command?

share|improve this question
3  
Black magic, mostly. –  MDMarra May 18 '11 at 14:38
    
possible duplicate of DNS Lookup to Bind config file. –  Shane Madden May 18 '11 at 14:45

3 Answers 3

up vote 7 down vote accepted

Zone transfer using dig:

dig @server domain axfr

Where server is the server to query, and domain is the domain name to request the zone for

This won't work unless you are authorized to perform a zone transfer, which is highly unlikely unless it is your name server.

share|improve this answer

If you are asking whether one can use dig to get a dump of all records in a zone file, then the answer is yes, but very tentatively.

The only way to make a BIND server dump all data in a zone is by using a zone transfer, this can be specified with the request type AXFR. However, since most BIND DNS servers will only transfer zones to explicitly specified hosts, you are very unlikely to find a public DNS server that will respond to this request.

share|improve this answer

You could try dig -tAXFR zone.tld where zone.tld is the name of the zone you want to see e.g.

dig -tAXFR lan 

dumps the .lan domain I have.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.