I'm looking to convert a Bind-DLZ based setup to a PowerDNS based setup. To do this, I would like to use the zone2sql tool that comes with PowerDNS. Sadly, this tool skips right over the DLZ defined zone in my named.conf
. I have been searching for a script that will dump the DLZ database into traditional DNS files and a named.conf
that references them, but have not had any luck.
Does such a tool exist? If so, would you be so kind as to link me to it?
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: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):Third, for each zone in the list retrieved from your DLZ database, issue the following command:
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.