How to Install Power DNS
How to Install Power DNS

Step-by-Step Guide: How to Install PowerDNS on Red Hat – Quick & Easy

Learn how to install PowerDNS on Red Hat with our comprehensive step-by-step guide. Boost your DNS management skills and set up PowerDNS effortlessly on your Red Hat system.

Choose your preferred backend, configure DNS settings, and get started in no time. Master the installation process for PowerDNS on Red Hat now!

There are two Power DNS Red Hat nameserver products: the Authoritative Server and the Recursor. While most other nameservers fully combine these functions, Power DNS offers them separately but can mix both authoritative and recursive usage seamlessly.

How to Install PowerDNS as Authoritative

The Authoritative Server will answer questions about domains it knows about, but will not go out on the net to resolve queries about other domains.

When the Authoritative Server answers a question, it comes out of the database and can be trusted as being authoritative. There is no way to pollute the cache or confuse the daemon.

PowerDNS Red Hat Recursor

The Recursor, conversely, by default has no knowledge of the domains itself, but will always consult other authoritative servers to answer questions given to it.

Power DNS has been designed to serve both the needs of small installations by being easy to set up, as well as for serving very large query volumes on large numbers of domains.

Additionally, through the use of clever programming techniques, PowerDNS server offers very high domain resolution performance.

Another prime goal is security. By the use of language features, the PowerDNS source code is reasonably small which makes auditing easy. In the same way, library features have been used to mitigate the risks of buffer overflows.

Finally, the PowerDNS server is able to give a lot of statistics on its operation which is both helpful in determining the scalability of an installation as well as for spotting problems.

Update Red Hat 7 System

First, let’s update the system.

yum update

Add EPEL Repo to Red Hat 7

Now let’s add the EPEL Repo into RedHat Yum Repos and update again.

yum install

Install PowerDNS from EPEL repository

After adding the EPEL repo we have access to Power DNS packages and install them with yum.

yum -y install pdns pdns-backend-mysql

Change Red Hat 7 Machine Hostname

hostnamectl set-hostname powerdns.local

Add PowerDNS Repository

yum install epel-release yum-plugin-priorities
curl -o /etc/yum.repos.d/powerdns-rec-master.repo
yum install pdns-recursor

Install MariaDB with Power DNS on Red Hat

yum -y install mariadb-server mariadb

Manage MariaDB service on Red Hat

Enable MariaDB service on boot:

systemctl enable mariadb.service

Start MariaDB service with SystemD:

systemctl start mariadb.service

Secure MySQL installation using mysql script, delete all unnecessary data, anonymous access, and setup a password for root.


Login into MySQL with the root user and password defined in the previous step.

mysql -u root -p

If you choose to use a database backend like MySQL, you need to create a database and user for PowerDNS. This step might differ depending on the database you choose.

For MySQL, you can do something like this:

MariaDB [(none)]> CREATE DATABASE powerdns;

Define permissions on MySQL user ‘poplab’ to the database ‘powerdns

MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY 'poplab';
MariaDB [(none)]> USE powerdns;

Create a table to store the DNS domains:

MariaDB [(none)]> CREATE TABLE domains (id INT auto_increment,name VARCHAR(255) NOT NULL,master VARCHAR(128) DEFAULT NULL,last_check INT DEFAULT NULL,type VARCHAR(6) NOT NULL,notified_serial INT DEFAULT NULL,account VARCHAR(40) DEFAULT NULL,primary key (id) );

Create a table to store the DNS records:

MariaDB [(none)]> CREATE TABLE records (id INT auto_increment,domain_id INT DEFAULT NULL,name VARCHAR(255) DEFAULT NULL,type VARCHAR(6) DEFAULT NULL,content VARCHAR(255) DEFAULT NULL,ttl INT DEFAULT NULL,prio INT DEFAULT NULL,change_date INT DEFAULT NULL,primary key(id) );

Create database indexes needed:

MariaDB [(none)]> CREATE INDEX rec_name_index ON records(name);
MariaDB [(none)]> CREATE INDEX nametype_index ON records(name,type);
MariaDB [(none)]> CREATE INDEX domain_id ON records(domain_id);

Powerdns web interface

Download an Installation Script

Download Virtual Machine

Understanding Chroot Jails