PowerDNS Part 1 – Master Server Installation (Ubuntu)

In this post, I will cover the installation of PowerDNS Authoritative server (Part 1). The Master server (Part 1), Slave server (Part 2) and creating a zone (Part 3).

Part 2 Link: Available May 22 2022
https://www.tomvanbrienen.nl/powerdns-part-2-slave-server-installation-ubuntu/
Part 3 Link: Available May 29 2022
https://www.tomvanbrienen.nl/powerdns-part-3-create-zone-ubuntu/

Install Mariadb & start mysql_secure_installation.

sudo apt install mariadb-server
sudo mysql_secure_installation

Create the database & database user. Replace YourPassword with a strong password!

mysql -u root -p
CREATE DATABASE powerdns;
GRANT ALL ON powerdns.* TO 'powerdns_dbuser'@'localhost' IDENTIFIED BY 'YourPassword';
FLUSH PRIVILEGES;

Choose the version for your distro & follow the steps from PDNS to add the repo.
https://repo.powerdns.com/

Install pdns-server and pdns-backend-mysql.

apt install pdns-server pdns-backend-mysql

Download the correct schema for your PDNS version. (4.6 below, stable 08-05-2022)
https://github.com/PowerDNS/pdns/blob/rel/auth-4.6.x/modules/gmysqlbackend/schema.mysql.sql

Branches: rel/auth-4.*

PowerDNS Authoritative changelogs:
https://doc.powerdns.com/authoritative/changelog/

Download & import the schema.

mysql -u powerdns_dbuser -p powerdns < /usr/share/pdns-backend-mysql/schema/schema.mysql.sql

Create the MySQL config:

nano /etc/powerdns/pdns.d/pdns.local.gmysql.conf

Replace YourPassword & paste it in pdns.local.gmysql.conf.

launch=gmysql
gmysql-host=localhost
gmysql-dbname=powerdns
gmysql-user=powerdns_dbuser
gmysql-password=YourPassword
gmysql-dnssec=yes

Edit the PDNS configuration file.

nano /etc/powerdns/pdns.conf

Check & edit the following values.

default-soa-content
include-dir
local-address
query-local-address
server-id
master

Example:

include-dir=/etc/powerdns/pdns.d
local-address=1.2.3.4
query-local-address=1.2.3.4
server-id=ns1.yourdomain.com
master=yes
default-soa-content=ns1.yourdomain.com mail.domain.com 0 10800 3600 604800 3600

Restart powerdns.

systemctl restart pdns
systemctl enable pdns

Check the status.

systemctl status pdns

PowerDNS has been successfully installed and configured.

Leave a Reply

Your email address will not be published.