Hostomy Blog

How to Install PowerDNS on Ubuntu 24.04: A Step-by-Step Guide

Aug 20, 2025

By Rahul Mukati

Rahul Mukati
How to Install PowerDNS on Ubuntu 24.04: A Step-by-Step Guide

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.


Prerequisites

  • Ubuntu 24.04 server with sudo/root access
  • Basic command-line skills

Step 1: Update Your System

First, make sure your system is up-to-date:

sudo apt update
sudo apt upgrade -y

Step 2: Install PowerDNS and SQLite3 Backend

Install PowerDNS server and the SQLite3 backend package:

sudo apt install pdns-server pdns-backend-sqlite3 sqlite3 -y

Step 3: Create the SQLite3 Database

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.


Step 4: Configure PowerDNS to Use SQLite3

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).


Step 5: Start and Enable PowerDNS

Start and enable the PowerDNS service:

sudo systemctl start pdns
sudo systemctl enable pdns

Check the status:

sudo systemctl status pdns

Step 6: Open Firewall Ports (Optional)

Make sure DNS ports are allowed (if you use a firewall):

sudo ufw allow 53/tcp
sudo ufw allow 53/udp
sudo ufw reload

Step 7: Add Your First DNS Zone

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

Step 8: Test Your DNS Server

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.


Final Thoughts

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.