[Pdns-users] Supermasters And Database

AJ McKee aj.mckee at druid-dns.com
Mon Aug 23 09:57:36 UTC 2004


Hi All,

Welll I am writing a php app to manage domains served by powerdns (still:).
Not disimilar to poweradmin. However I have hit a wee snag with
supermasters.

The problem I see it as is as follwos;

1. User adds a slave domain which is added to the Supermasters table;
2. PDNS goes off and adds in the information for the domain and all its
records into the domains and records table
3. My domainid sequence is now out of sequence because the slave domain and
more importantly the recordid are different than what I am handeling.

Now that's not a problem at all when you think about it, until you go to
build a management app. I am using MySQL 4 at the moment with my management
app using transactiions etc. I am also using the default tables suggested by
the Powerdns docs. At the moment when a user adds a master domain we go
through a wee process one of them is a domainID process. Basically we
generate a domainid and hold that in a domainid_sequence table. So when I
add a new domain the app looks up the domain_sequence and adds 1 to it, hey
presto, the new domainid. This is also more or less the same for the records
table. So my issue is my records_seq table is gonna be out of sync with the
records table, I go and add a new domain or a record on a master record, it
will more than likley overwrite a record that is from the slave zone.
Bummer, dns messed up.

So my question is, does anyone have any suggestions on how I could overcome
this little obstacle. Its not a problem with powerdns btw its probally more
to the way I want the setup to work. I was thinking I could edit the src and
find where the supermaster adds a record and tell it to get the id from the
records_seq table... But I don't know...

Also I have been thinking a lot about how to collect stats on say the amount
of times a record or a domain is looked up. The only idea I can come up with
is if a counter is kept in the packetcache?? And this is incremented. Then
you could have a perl script dump the counter out to a database every few
min. Then its up to you to write a pho or similar scrip tto graph it. Reason
I suggest this.. Ultradns.com you can get stats on how many times a record
or doamin was requested. How to implement this... Well that's another story.
Its probally all teriblly wrong so I apoligise in advance for the rant.

Any ideas/feedback welcomed & thanks in advance.

AJ






More information about the Pdns-users mailing list