Updating PowerDNS superserver MySQL slave replication

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 🙂

Stop PowerDNS
service pdns stop
First create a backup of your MySQL PowerDNS database
mysqldump -u root -pPASSWORD powerdns >/backuplocation/powerdns_backup.sql
Login to your PowerDNS database
mysql -u root -pPASSWORD powerdns
Select PowerDNS database
use powerdns;
Show PowerDNS tables
show tables;
Show your DNS domains Master IP and type
select * from domains;
Change / update records to reflect your new MASTER server
UPDATE records SET content=’IP_OF_NEW_MASTER’ WHERE content = ‘IP_OF_OLD_MASTER’;
Verify that you changed everything correctly
select * from domains WHERE master=”IP_OF_NEW_MASTER”;
Restart PowerDNS
service pdns restart

Leave a Reply

Your email address will not be published.

sixteen − 4 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.