4

Is there a tool that will take the information from a DNS lookup like dig google.com and turn it into a bind configuration file? (In this case google.com is an example, i would be using a domain that I own, but i don't have access to the bind config file.)

Rook
  • 2,615
  • 5
  • 26
  • 34

1 Answers1

6

Normally you'd want to have the domain's owner allow you to perform an AXFR to fetch the whole zone. However, you can get a start to a functioning zone:

dig +multiline google.com any > google.com.zone

The above will load but probably not be of much use. Anyway, point is the output of dig is conveniently formatted for BIND.

If you can get whomever is operating your DNS to allow transfers (the allow-transfer statement for BIND) you can do.

dig +multiline google.com axfr > google.com.zone

This will be a complete copy of the zone file. If you want to go a step further, you can ask them to send you notifies whenever the serial number of the zone is incremented. Then you can set up your own slave nameserver:

zone "google.com" {
    type slave;
    file "google.com.zone";
    masters {
        11.22.33.44;
    }
};

That'll get a copy of the zone file whenever it is updated on the master.

Cakemox
  • 24,141
  • 6
  • 41
  • 67