[Pdns-users] Checking constraints on MySQL records and auto-rectify

Jan-Piet Mens jpmens.dns at gmail.com
Wed Jan 30 06:47:17 UTC 2013

On long, solitary drives I get crazy ideas, and at a beastly hour this
morning, it happened again:

It ought to be possible (famous last words) to create a set of MySQL
triggers and a couple of User Defined Functions (UDF) which ensure that
data entered into PowerDNS' MysQL database tables (in particular,
`domains' and `records') follow a set of defined constraints. These
would be caught irrespective of which front-end is used for
INSERTs/UPDATEs. I'm thinking of things like

* domain names must not be fully qualified
* names must not contain white space
* A records must contain an IPv4, AAAA records an IPv6 address
* NS records must not contain an address
* No CNAME and other data [1]
* etc.

Additionally, we could maybe implement automatic rectification of
records for the DNSSEC schema, setting `auth', 'order', etc. columns

Has anybody done this already?

I'm thinking along the lines of a UDF which employs regexes for ensuring
most rules (except A, AAAA: there I'd use inet_pton(3)).

Is it worth an attempt, or people consider this useless? 

I'd be prepared to show a bit of love for PowerDNS and toy a bit further
with the idea. Thoughts?



[1] I've already demonstrated a trigger which forbids this

More information about the Pdns-users mailing list