The simplest method to extract the DNS information from the Bind-DLZ database is to use an AXFR query for each "zone" in the database.
First, determine the zones stored in your database by connecting to it with whichever client is appropriate for your database type (e.g. mysql
) and issuing the statement:
SELECT DISTINCT zone FROM dns_records;
Where the dns_records
table is the table that houses your DNS information.
Second, make sure the Bind server allows transfer requests from the host where you will be performing the extract. Edit your named.conf
and adjust your options block accordingly (then restart Bind):
options {
# Allow host 192.168.1.5 to issue AXFR queries to this server
allow-transfer { 192.168.1.5; };
};
Third, for each zone in the list retrieved from your DLZ database, issue the following command:
$ dig AXFR @your-dns-server.example.com a.zone.com > a.zone.com.zonefile
Where "a.zone.com" is a zone from the list (e.g. "example.com"), and "a.zone.com.zonefile" is a file that will be created with the zone's entries.
Finally, use the zone2sql tool to convert each of your zone files for the PowerDNS database.