[Pdns-users] Incrementing SOA serials?
Posner, Sebastian
s.posner at telekom.de
Tue Sep 11 13:15:08 UTC 2012
Jan-Piet Mens wrote:
> > Works perfectly, but what about updating the serial number for
> > the zone in the SOA record?
> > In an SQL master/slave setup I can't think of a reason
> > that it would matter. Any thoughts on that?
>
> I tend to agree that if you're using PowerDNS exclusively as mentioned,
> you won't need to bother with the SOA serial number. However: there may
> come the day when you'll want to be master for slave AXFRs, at which
> time it *does* become important. I'd implement SOA serial number
> updating now, before you forget ;-)
Updating Serial keeps debugging easier; when serial is set/updated
with each zone change, it's easier to check whether all servers
really got the last update.
Personally, I go with Serial=0 in SOA and let autoserial sort it out.
OK, some tweaks applied.
- Using gmysql-backend, I moved "records" to "records_backend";
changed type of "change_date" to "timestamp" with defaulting:
"change_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
- Furthermore, a trigger to completely ignore whatever is inserted
into change_date:
"CREATE TRIGGER records_backend_timestamp BEFORE INSERT ON records_backend FOR EACH ROW SET NEW.change_date = CURRENT_TIMESTAMP;"
- And to keep the backend working without modifying anything else,
something needs to look like "records" from original schema and
have INT as change_date:
"CREATE VIEW `records` AS select id, domain_id, name, type, content, ttl, prio, unix_timestamp(`records_backend`.`change_date`) AS change_date,ordername,auth from `records_backend`;"
As it is mysql and the view only uses one single table, it's even writeable (eg. for pdnssec rectify-zone).
Bam. Any thoughts on that? xD
Kind regards,
Sebastian
--
Sebastian Posner
Unix-Systemspezialist
Deutsche Telekom AG, Products & Innovation
"Es hat einmal einer gesagt, das geht nicht. Dann kam einer, der wusste das nicht und hat es einfach gemacht"
More information about the Pdns-users
mailing list