[Pdns-users] Automatically delete zones that are deleted on Supermaster

Mark Scholten mark at streamservice.nl
Tue Oct 30 16:06:05 UTC 2012


> Sent: 30 October, 2012 1:13
> > Sent: Monday, October 29, 2012 3:17 PM Op 29-10-12 15:03, Peter van
> > Dijk schreef:
> > > Hello, On Oct 29, 2012, at 9:35 , Peter van Dijk wrote:
> > >> Depending on your needs, you could write a script to do the cleanup
> > >> yourself. The last_check column is a decent indicator of master
> > >> uptime, in the current implementation. Note that THIS MIGHT CHANGE.
> > > If someone happens to have, or intends to write, such a script, we
> > > would be happy to put it in our contrib/ dir and include something
> > > in the docs about it.
> > In 2010 Mark Scholten posted such a script on the list. It can be
> > found in the archives:
> > http://mailman.powerdns.com/pipermail/pdns-users/2010-
> July/006866.html
> >
> > I've used the script (in testmode first) and works for me as well.
>
> We use a slightly changed version in production at this moment. It now
also
> removes domain data in other (mainly DNSSEC related) tables. I will check
it
> tomorrow (combined with the extra information from Peter to what record
> also can be checked) and after that I will send a new version to the list.

This version assumes DNSSEC is used with PowerDNS (at least the tables
exists). If they don't exist this script will still work.  At the top you
can enter some configuration options. By default it only checks domains
where the last_check number is at least 1 day old and after 7 failed checks
it removes a domain from the database. At line 61 you can change the email
account and after that you can uncomment it to get a daily email with failed
domains so you check it before it is removed. I strongly suggest running
this script (or something similar) once a day so you clean up old domains
and with the warning you can check it before domains are removed (and with a
week you have some time to notify customers if needed).

There is a short copyright notice at the top, the short version: don't claim
you created it and feel free to do whatever you want with it.

Kind regards,

Mark Scholten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdns_clean.php
Type: application/octet-stream
Size: 3063 bytes
Desc: not available
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20121030/26b9f51b/attachment-0001.obj>


More information about the Pdns-users mailing list