DNS Dump

alessandro123

Verified User
Joined
Sep 11, 2008
Messages
46
I think that should be usefull to add an API to dump all dns records.
For example:

CMD_API_DNS_DUMP

www.mydomain.com A 1.2.3.4
mail.mydomain.com A 1.2.3.5
mydomain.com MX 10 1.2.3.6

www.mydomain2.com A 1.2.3.4
mail.mydomain2.com A 1.2.3.5
mydomain2.com MX 10 1.2.3.6



and so on, with that, is possibile to create an external script to dump all dns and populate external dns server.
 
The AXFR protocol already covers a single zone export, and since the Bind config can be quite complex (with different views and also hint, localhost, 127.in-addr.arpa and other "special" zones that differ between distributions...) there is no clean way to extract a correct list of domains from there.

I'd suggest creating an API to export the list of domains from DA's conf instead of Bind (and I guess there alredy is one), then use AXFR to retrieve the zone for each domain.
 
The easy way to populate an external server is to use Master2Slave DNS Replicator for DirectAdmin, which has been discussed on these forums.

Or, if the external server is running DirectAdmin, the built-in Multi-Server Setup option.

That said, while I'm not volunteering to do any of this, I believe it's certainly doable.

I disagree (respectifully :)) with tillo; zone configuration is fairly standard; it must be, or else BIND would have trouble parsing it. If you want the code (C++?) it's already in BIND. But more importantly, as tillo ponts out, you can get a very standard zone file using AXFR and can easily develop a script to parse it if you're looking for all records. If you're simply looking for a list of domains, the code for that is already in the Master2Slave DNS Replicator as well. In addition to our standard download (link above) we have code available that works with multi-line zone entries (in named.conf) as well.

Tillo, the only list of zonefiles in DirectAdmin is the named.conf file. But parsing it is actually trivial. In fact our Master2Slave DNS Replicator pretty much does that; on the master server it extracts the information from the named.conf file on the master server, puts it where the slave server can get it, and then the code on the slave server builds a new named.conf file for slaved zones, and allows BIND on the slave server to do the AXFR to get the zonefile.

While I oversimplify a bit above discussing both master and slave servers, I realize there's actually no such thing, that any BIND configuration can host both master and slave zones. Master2Slave DNS Replicator doesn't yet manage that well, but can easily be made to do so.

Jeff
 
Back
Top