- 架設 Power DNS 的 Master & Slave Server 備援機制!
- 事先準備事項:
- Power DNS 服務設定,請參考這一篇的設定!
- 參考事先準備事項,完成 Power DNS Server 的架設!
-
修改設定檔內容:
#cp /etc/pdns/pdns.conf /etc/pdns/pdns.conf.orig #vim /etc/pdns/pdns.conf allow-recursion=192.168.5.0/0 allow-axfr-ips=192.168.5.11/32 config-dir=/etc/pdns daemon=yes disable-axfr=no guardian=yes local-address=0.0.0.0 local-port=53 log-dns-details=on log-failed-updates=on loglevel=4 master=yes slave=no setgid=pdns setuid=pdns socket-dir=/var/run version-string=powerdns include-dir=/etc/pdns/pdns.d
-
重新啟動 Power DNS Server:
#systemctl restart pdns
Slave 快速設定流程:
- 參考事先準備事項,完成 Power DNS Server 的架設!(不用安裝 phpPowerAdmin)
-
修改設定檔內容:
#cp /etc/pdns/pdns.conf /etc/pdns/pdns.conf.orig #vim /etc/pdns/pdns.conf allow-recursion=0.0.0.0/0 config-dir=/etc/pdns daemon=yes disable-axfr=yes guardian=yes local-address=0.0.0.0 local-port=53 log-dns-details=on log-failed-updates=on loglevel=4 master=no slave=yes slave-cycle-interval=60 setgid=pdns setuid=pdns socket-dir=/var/run version-string=powerdns include-dir=/etc/pdns/pdns.d
-
在 MySQL 內,增加下列表格:(有發現錯誤時才做!)
#mysql -u powerdns -p MariaDB [(none)]> use powerdns; MariaDB [powerdns]>CREATE TABLE `domainmetadata` ( `id` int(11) NOT NULL AUTO_INCREMENT, `domain_id` int(11) NOT NULL, `kind` varchar(16) DEFAULT NULL, `content` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
登入 MySQL ,增加 supermaster 設定值:
#mysql -u powerdns -p MariaDB [(none)]> use powerdns; MariaDB [powerdns]> insert into supermasters values('192.168.5.1','dns1.example.tw','admin'); MariaDB [powerdns]> exit;
-
重新啟動 Power DNS Server:
#systemctl restart pdns
參考文獻:
- https://www.digitalocean.com/community/tutorials/how-to-configure-dns-replication-on-a-slave-powerdns-server-on-ubuntu-14-04
- https://www.benjaminfleckenstein.name/en/powerdns-master-slave-howto.html
- http://www.debiantutorials.com/installing-powerdns-as-supermaster-with-slaves/
- http://jpmens.net/2013/02/13/automatic-provisioning-of-slave-dns-servers/
- https://doc.powerdns.com/md/authoritative/modes-of-operation/