======PowerDNS on CentOS 7======
=====Prerequisites======
* Download latest poweradmin [[https://sourceforge.net/projects/poweradmin/files/latest/download?source=directory]]
=====Installation=====
yum install pdns-backend-mysql pdns-recursor mariadb-server httpd php mod_ssl php-mcrypt php-pdo php-mysql
systemctl enable mariadb
systemctl start mariadb
mysql_secure_installation
mysql -u root -p
create database powerdns;
GRANT ALL PRIVILEGES ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY 'powerdnsPassword';
flush privileges;
mysql -u powerdns -p powerdns < /usr/share/doc/pdns-backend-mysql-3.4.4/schema.mysql.sql
=====Configuration=====
setuid=pdns
setgid=pdns
local-address=172.16.2.16
local-ipv6=2a02:22a0:bbb7:402::16
local-port=53
launch=gmysql
gmysql-host=localhost
gmysql-user=powerdns
gmysql-password=
gmysql-dbname=powerdns
allow-recursion=172.16.0.0/8,46.44.183.176/28,5.200.9.240/28,94.142.242.32/28,2a02:22a0:bbb7:400::/56,2a00:1630:59::/48,2a02:898:126::/48
config-dir=/etc/pdns
daemon=yes
disable-axfr=no
allow-axfr-ips=46.44.183.178,5.200.9.242,2a00:1630:59::242,2a02:22a0:bbb7:400::178,2a02:22a0:bbb7:403::37,172.16.3.37
disable-tcp=no
guardian=yes
recursor=127.0.0.1
master=yes
slave=no
slave-cycle-interval=60
socket-dir=/var/run
version-string=powerdns
setuid=pdns-recursor
setgid=pdns-recursor
local-address=127.0.0.1
local-port=53
allow-from=127.0.0.0/8, ::1/128, fe80::/10, 2a02:22a0:bbb7:400::/56
dont-query=
quiet=yes
systemctl start pdns
systemctl start pdns-recursor
systemctl enable pdns
systemctl enable pdns-recursor
firewall-cmd --permanent --zone=management --add-service=dns
firewall-cmd --permanent --zone=local --add-service=dns
=====PowerAdmin=====
cd /usr/share
tar -xzf /root/poweradmin-2.1.7.tgz
ln -s poweradmin-2.1.7 poweradmin
ServerAdmin webmaster@dns.mngt.bh.helux.nl
ServerName dns.mngt.bh.helux.nl
RewriteEngine on
RewriteRule ^/(.*)$ https://dns.mngt.bh.helux.nl/$1 [R,L]
ErrorLog /var/log/httpd/dns-error.log
CustomLog /var/log/httpd/dns-access.log common
ServerAdmin webmaster@dns.mngt.bh.helux.nl
ServerName dns.mngt.bh.helux.nl
DocumentRoot /usr/share/poweradmin/
Require all granted
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
ErrorLog /var/log/httpd/dns-error.log
CustomLog /var/log/httpd/dns-access.log common
setsebool -P httpd_can_network_connect 1
systemctl restart httpd
Go to your URL: [[http://dns.mngt.bh.helux.nl/install]] and follow the instructions.
=====Backup and restore=====
On the old server with older PowerDNS database:
mysqldump -u powerdns -p powerdns > /var/tmp/backup_tables.sql
On the new server:
mysql -u powerdns -p powerdns < /var/tmp/backup_tables.sql
Upgrade to new schema:
mysql -u powerdns -p powerdns < /usr/share/doc/pdns-backend-mysql-3.4.4/nodnssec-3.x_to_3.4.0_schema.mysql.sql
{{tag>centos}}