Solution found, in the depths of the PowerDNS launchpad ! There is a way to read DNS-data files before using the MySQL backend, and that is... using two backends ! Quoting :
As described in http://doc.powerdns.com/modules.html - just not with so many words ;) - PowerDNS can launch any number of different or oven the same backends via the launch statement. Usually one would just do that in the configuration file pdns.conf instead of the command line. Those backends will be exhausted for answers to your DNS query in the order in which they are given in the launch statement. This does mean that if your first backend in line can answer the question, it will and if only the fourth in line can answer the question you will have the delay of the looping through the first three backends until PowerDNS will send out the answer. It is therefore imperative that you make sure that your backends do answer fast enough where fast enough would be receiving and answer in <1s should be enough to be compatible with most recursive nameservers, however faster is better of course.
For my problem, I chose to use :
- A Bind backend, which serves as the prioritary file-based backend.
- The MySQL backend, which comes second.
Basically, all it takes is a little configuration change in pdns.local
:
launch=bind,gmysql
I've heard you could be even more specific with (assigns names to backends) :
launch=bind:first,gmysql:second
Then, just add parameters for both backends :
# Bind backend configuration
bind-config=/path/to/your/zones/file
# MySQL configuration
gmysql-host=localhost
gmysql-port=
gmysql-dbname=db
gmysql-user=user
gmysql-password=passwd
gmysql-dnssec=no
All you have to do is create a Bind zone file (zone{}
blocks) referring to domain-specific files (containing SOA, A, MX, NS, ... records).
Restart !