From ArchWiki

PowerDNS is a DNS server, written in C++ and licensed under the GPL. PowerDNS features a large number of different backends ranging from simple BIND style zonefiles to relational databases and load balancing/failover algorithms.


Install the powerdns package.

Next you can review the configuration file located at /etc/powerdns/pdns.conf.


To configure PowerDNS to use specific backend you will need to set the launch option in configuration file. Also depending on particular backend you use, you will have to configure it.

For PostgreSQL, MySQL and SQLite you can find database table creation SQL files located at /usr/share/doc/powerdns.

PostgreSQL backend

Firstly you will need to create a user and database where PowerDNS can store data.

Then execute "schema.pgsql.sql" file to create tables.

psql -U <user> -d <database name> -a -f /usr/share/doc/powerdns/schema.pgsql.sql

And finally update configuration file

gpgsql-host=/run/postgresql # if PostgreSQL is listening to unix socket
# gpgsql-host=
# gpgsql-port=5432
gpgsql-dbname=<database name>
gpgsql-user=<user to use>

MySQL backend

Install and run a MySQL server. Create a new user, and a new database and import the schema into the db:

mysql -u root -p pdns < /usr/share/doc/powerdns/schema.mysql.sql

Then, configure Powerdns to use MySQL:

# Add this for dnssec support
# gmysql-dnssec=yes

You could also use localhost instead of, but this causes PowerDNS to use the socket file. As PowerDNS runs in a chroot by default, the socket file is not available.

SQLite backend

Configure Powerdns to use sqlite:


Create the database:

# mkdir /var/lib/powerdns
# sqlite3 /var/lib/powerdns/pdns.sqlite3 < /usr/share/doc/powerdns/schema.sqlite3.sql
# chown -R powerdns:powerdns /var/lib/powerdns


Start/enable pdns.service.

Tips and Tricks

Bind address and/or port

The default /etc/powerdns/pdns.conf binds to (all IP addresses). This will conflict with any other process bound to port 53, for example systemd-resolved uses This will result in an error:

Unable to bind UDP socket to '': Address already in use

This can be resolved in a number of ways, for example changing either/both local-address or local-port options:


See also