[Pdns-users] Altering the SQL query for gmysql backend

Steven Looman steven at krx.nl
Thu Oct 7 16:39:59 UTC 2004


I'm trying out PowerDNS for a project I'm working on, but am having some troubles.

What I want to do is split the records table to two seperate tables, one for the records we (manually) add, one for the records we get from the domains we are a slave for.

To let PowerDNS get _all_ the needed records from a single query something like this would be needed, an example for basic-query:
	select content, ttl, prio, type, domain_id, name
	from records
	where type='%s' and name='%s'
	select content, ttl, prio, type, domain_id, name
	from slave_records
	where type='%s' and name='%s'

However, it does seem that powerdns cannot handle more than two (in this case) %s values, it crashes (signal 11).

If I do something like this (just to try things, of course added \'s to the end of each (but the last) line):
        select content, ttl, prio, type, domain_id, name
        from records
        where type='%s' and name='%s' and type='%s' and name='%s'
it also crashes (signal 11).

I'm using FreeBSD 5.1-RELEASE, PowerDNS 2.9.16 from the FreeBSD ports, PostgreSQL 7.4.5, also from the FreeBSD ports.

Why I want to do something like this? Here's why:

I'm building an all-in-one administration tool (written in PHP) to adminster useraccounts, mailboxes, domains, .... Putting things directly in a database seems to be the easiest and also doesn't require any reloading whatsoever, like bind.

The systems need to be able to run stand-alone to prevent failing of all the servers when for example the database server fails, so I came up with this idea:
on the front-end (administration tool) or a database server we run MySQL where data is manipulated by hand
on the back-end (running powerdns) we also run MySQL, which replicates certain (read-only for this side) tables from the front-end database

The back-end database wants to write certain things to it's database (for example slave records), but since some tables are read-only it needs a seperate table to store the other data.

Another option would be to have two MySQL masters, keeping eachother in sync. The front-end can add records and the back-end can also add (slave) records. All records are synchronized between the two servers. But I don't like this idea, it seems a bit fragile.

Hope I provided enough information, any ideas?

Steven Looman

More information about the Pdns-users mailing list