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