User Tools

Site Tools


powerdns_centos7

PowerDNS on CentOS 7

Prerequisites

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

/etc/pdns/pdns.conf
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=<SECRET>
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
/etc/pdns-recursor/recursor.conf
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
/etc/httpd/conf.d/dns.mngt.bh.helux.nl.conf
<VirtualHost dns.mngt.bh.helux.nl:80>
    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
</VirtualHost>

<VirtualHost dns.mngt.bh.helux.nl:443>
    ServerAdmin webmaster@dns.mngt.bh.helux.nl
    ServerName dns.mngt.bh.helux.nl

    DocumentRoot /usr/share/poweradmin/
    <Directory /usr/share/poweradmin>
      Require all granted
    </Directory>

    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
</VirtualHost>
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
powerdns_centos7.txt · Last modified: by herwarth