Aug 20, 2025
•
By Rahul Mukati
PowerDNS is a powerful, open-source DNS server with robust features and high performance, making it a popular choice for web hosts, ISPs, and anyone needing a reliable DNS solution. In this guide, we'll walk you through installing PowerDNS with a MySQL backend on Ubuntu 24.04, including initial setup, database creation, and basic configuration.
First, make sure your system is up-to-date:
sudo apt update sudo apt upgrade -y
Install PowerDNS server and the SQLite3 backend package:
sudo apt install pdns-server pdns-backend-sqlite3 sqlite3 -y
Create a directory to store your PowerDNS SQLite database:
sudo mkdir -p /var/lib/powerdns sudo chown pdns:pdns /var/lib/powerdns
Now, initialize the SQLite3 database using the schema provided by PowerDNS:
sudo -u pdns sqlite3 /var/lib/powerdns/pdns.sqlite3 < /usr/share/pdns-backend-sqlite3/schema/schema.sqlite3.sql
Note: Adjust the file path if the schema is stored in a different location—use dpkg -L pdns-backend-sqlite3
to find it if needed.
Open the PowerDNS configuration file:
sudo nano /etc/powerdns/pdns.conf
Add or modify these lines:
launch=sqlite3 sqlite3-database=/var/lib/powerdns/pdns.sqlite3
Save and exit (Ctrl+O
, then Ctrl+X
).
Start and enable the PowerDNS service:
sudo systemctl start pdns sudo systemctl enable pdns
Check the status:
sudo systemctl status pdns
Make sure DNS ports are allowed (if you use a firewall):
sudo ufw allow 53/tcp sudo ufw allow 53/udp sudo ufw reload
Insert your first DNS zone and record using the sqlite3
command-line tool:
pdnsutil create-zone example.com pdnsutil add-record example.com www A 127.0.0.1
Use dig
to test your new DNS server:
dig @localhost www.example.com
You should receive a response containing the A record you just set.
PowerDNS with the SQLite3 backend is perfect for compact, easy-to-maintain DNS setups. It’s quick to deploy and works well for local development, small organizations, or light production workloads. For larger or more dynamic environments, consider upgrading to a full database backend such as MySQL or PostgreSQL.