Updating PowerDNS superserver MySQL slave replication
Well I ran into a problem when running a large PowerDNS installation with over 1000 domains and was planning a IP migration of the primary DNS server running at my company.
Now, In this setup I’m using PowerDNS as a supermaster to auto-create all DNS records on this machine.
The problem, by updating the primary DNS servers IP, the IP address isn’t auto updated in the PowerDNS database, even after adding the new IP address as a supermaster.
This is what I did to make everything work again 🙂
service pdns stop
mysqldump -u root -pPASSWORD powerdns >/backuplocation/powerdns_backup.sql
mysql -u root -pPASSWORD powerdns
select * from domains;
UPDATE records SET content=’IP_OF_NEW_MASTER’ WHERE content = ‘IP_OF_OLD_MASTER’;
select * from domains WHERE master=”IP_OF_NEW_MASTER”;
service pdns restart