Install PowerDNS Cluster Part 1

Today we are going to install our first node of a PowerDNS cluster. This node is going to be the Master, this means this server will host the MySQL/MariaDB master and this server will do the DNSSEC signing.

Disclaimer: This tutorial comes with ABSOLUTELY NO WARRANTY.

Installation Guide for PowerDNS Authoritative 4.0


  • Virtual Machine 1GB memory, 40GB disk, 1 ipv4  and 1 ipv6 address
  • Linux Centos 7 minimal ISO
  • Hostname for the server

1. Build the server

Build your virtual machine with the ingredients above, I assume you know how to do this.

Check your IP settings

# nmtui
# systemctl restart network

Did you set the correct hostname during installation?

# hostnamectl
# hostnamectl set-hostname

Install a few software packages we are going to use

# yum update
# yum install epel-release
# yum install bind-utils vim

2. Install MySQL/MariaDB

Now we are going to install the MariaDB database server:

# yum install mariadb-server mariadb
# systemctl enable mariadb
# systemctl start mariadb
# mysql_secure_installation

Default the “binlog_format” is set to ‘STATEMENT’, change this to ‘ROW’:

# vim /etc/my.cnf
Insert line under [mysqld]
# systemctl restart mariadb

And create a database for PowerDNS:

# mysql -uroot -p
MariaDB [(none)]> show variables like ‘binlog_format’;
MariaDB [(none)]> create database powerdns;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON powerdns.* TO ‘powerdns’@’localhost’ IDENTIFIED BY ‘yourdatabasepassword’;

Now create all the PowerDNS tables and indexes as described on this page in the PowerDNS docs

MariaDB [(none)]> use powerdns;
MariaDB [powerdns]> CREATE TABLE domains ( … etc

3. Install PowerDNS

Now we are ready to install PowerDNS, yeah! We are going to install PowerDNS from here

# yum install epel-release yum-plugin-priorities &&
# curl -o /etc/yum.repos.d/powerdns-auth-40.repo &&
# yum install pdns pdns-backend-mysql

4. Configure PowerDNS

Now we are going to configure PowerDNS

# vim /etc/pdns/pdns.conf

Enable and start the powerdns service:

systemctl enable pdns
systemctl start pdns

Check your logs if everything is allright:

# tail /var/log/messages

Open up the firewall ports for DNS operation:

firewall-cmd –add-port=53/tcp –permanent –zone=public
firewall-cmd –add-port=53/udp –permanent –zone=public
firewall-cmd –reload

5. Create DNS records for the server

To be able to use your new server as a DNS server you need to add the DNS records for the server hostname.

Create the DNS records for your hostname

  • A -> ipv4
  • AAAA -> ipv6 1:2:3::4

Create the reverse DNS records for your ip’s

  • ipv4 PTR -> hostname
  • ipv6 PTR -> hostname

6. Test your DNS server

This sample query sent to the server should now return quickly without data:

dig +short @

7. Time Synchronisation

To make sure your server always has the right date and time, install NTP:

yum install ntp
systemctl enable ntpd
systemctl start ntpd
systemctl status ntpd

That’s it for now!