[Pdns-users] PowerDNS MySQL API in Perl by a PowerDNS user

James Cloos cloos at jhcloos.com
Thu Nov 29 21:28:17 UTC 2007

I've been thinking about this as well, but haven't gotten to a postable
solution yet.

Incidently, I use pgsql rather than mysql, and that probably affects my
design choices....)

My thought is that there should be a table for each major type of RR
(such as rr.a, rr.mx, rr.aaaa, etc) with rr-epcific schema, an rr.misc
table with a schema close to that of the current public.records table,
and an rr.secondary table which pdns can write to when using axfr

The SOA details would be in extra columns in the public.domains table.

Then, a public.records view would be created using a UNION query to
combine the details from each of the rr.* tables, plus append the SOA
details from the domains table into SOA rows in the view.

Each table in the rr. space will have a trigger to update the expire
column in the domains table when a row is inserted or updated.  The
rr.secondary table's trigger would update all of the SOA details in the
public.domains table on insert/update, to ensure everything is in sync
with the master.

I beleive all of this can be done as well in modern mysql, and know it
also can be done in sqlite, although I don't know whether they support
views; the queries may instead need to be stored in the pdns conf for
those backends, rather than using a view to duplicate the look-n-feel
that the default queries expect.

Either way, of course, the query used when storing a seconday will need
to be customised.

Overall this should improve reliability of the data store and improve
the UIs used for storing or manipulating the data.

James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

More information about the Pdns-users mailing list