How to deploy powerdns cluster on ubuntu vps serversThis article provides a detailed guide for how to deploy PowerDNS cluster on Ubuntu VPS servers.

What is PowerDNS?

PowerDNS is an open-source DNS (Domain Name System) server software that provides both authoritative and recursive DNS services. It’s widely used by ISPs, hosting providers, and enterprises due to its performance, scalability, and flexibility.

Key Features of PowerDNS:

  1. Authoritative Server:
    • Serves DNS records for domains.
    • Supports a wide range of backends: MySQL, PostgreSQL, SQLite, LDAP, and more.
    • Ideal for dynamic DNS environments and large-scale deployments.
  2. Recursor (Recursive DNS Server):
    • Handles DNS lookups for client systems.
    • Focused on speed and security.
    • Can be used standalone or alongside the authoritative server.
  3. High Performance:
    • Known for its efficient query handling.
    • Suitable for handling millions of queries per second.
  4. Extensible:
    • Built-in Lua scripting support for custom behavior.
    • APIs for automation and integration.
  5. DNSSEC Support:
    • Provides tools for signing zones and validating queries.
  6. Web-based and API Management:
    • Integration with tools like PowerDNS-Admin for user-friendly DNS management.

Common Use Cases:

  • Hosting companies managing customer DNS zones.
  • Enterprises with complex internal DNS setups.
  • Service providers needing a scalable DNS solution.

Launch 100% ssd ubuntu vps from $2. 49/mo!

How to Deploy PowerDNS Cluster on Ubuntu VPS Servers

This setup will use:

  • PowerDNS Authoritative Server with a MySQL backend
  • Multiple VPS nodes: one primary (master), one or more secondaries (slaves)
  • Optional: Web-based interface like Poweradmin for easier DNS management

✅ Prerequisites

Before starting, make sure:

  • You’re using Ubuntu 22.04 or newer
  • You have at least 2 VPS servers (more if you want a larger cluster)
  • You have root or sudo access on all servers
  • You’ve set up static IPs and hostnames
  • You have MySQL (or MariaDB) installed
  • Ports 53 (UDP/TCP) and 3306 (TCP) are open between nodes

⚙️ Overview of Architecture

  • Primary DNS Server (Master): Handles zone creation and updates
  • Secondary DNS Servers (Slaves): Pull zone data from master using AXFR
  • MySQL Database: Central backend for zone records (can be replicated if needed)

🛠 Step-by-Step Deployment

To deploy PowerDNS cluster on Ubuntu VPS servers, follow the steps provided below:

  1. Install PowerDNS and MySQL on the Master

    sudo apt update sudo apt install pdns-server pdns-backend-mysql mariadb-server -y
  2. Secure MySQL and Create PowerDNS Database

    sudo mysql_secure_installation

    Then log into MySQL:

    sudo mysql -u root -p

    Run these SQL commands:

    CREATE DATABASE powerdns; GRANT ALL ON powerdns.* TO 'pdns'@'localhost' IDENTIFIED BY 'StrongPasswordHere'; FLUSH PRIVILEGES; EXIT;
  3. Import PowerDNS Schema

    Download schema:

    wget https://raw.githubusercontent.com/PowerDNS/pdns/master/modules/gmysqlbackend/schema/schema.mysql.sql

    Import it:

    mysql -u pdns -p powerdns < schema.mysql.sql
  4. Configure PowerDNS to Use MySQL

    Edit PowerDNS config:

    sudo nano /etc/powerdns/pdns.conf

    Add/modify:

    launch=gmysql gmysql-host=127.0.0.1 gmysql-user=pdns gmysql-password=StrongPasswordHere gmysql-dbname=powerdns

    Restart PowerDNS:

    sudo systemctl restart pdns
  5. Add Zones and Records (Master)

    You can insert zones manually into the database or use Poweradmin (optional, covered later).

    Example to add a zone:

    INSERT INTO domains (name, type) VALUES ('example.com', 'MASTER');
  6. Set Up Secondary DNS Server (Slave)

    1. Install PowerDNS
      sudo apt update sudo apt install pdns-server pdns-backend-bind -y
    2. Configure PowerDNS as a Slave

      Edit /etc/powerdns/pdns.conf:

      launch=bind bind-config=/etc/powerdns/named.conf

      Create /etc/powerdns/named.conf:

      sudo nano /etc/powerdns/named.conf

      Example slave zone:

      zone "example.com" { type slave; masters { MASTER_IP; }; file "example.com.zone"; };

      Restart PowerDNS:

      sudo systemctl restart pdns
  7. Allow Zone Transfers on Master

    In your MySQL database, set also_notify and allow_notify_from_master if needed.

    Or manually allow AXFR in pdns.conf:

    allow-axfr-ips=SLAVE_IP also-notify=SLAVE_IP

    Restart the master PowerDNS:

    sudo systemctl restart pdns
  8. Install Poweradmin on Master

    1. Install Apache and PHP
      sudo apt install apache2 php php-mysql libapache2-mod-php unzip -y
    2. Download Poweradmin
      wget https://github.com/poweradmin/poweradmin/archive/master.zip unzip master.zip sudo mv poweradmin-master /var/www/html/poweradmin
    3. Setup and configure in browser

      Visit: http://YOUR_MASTER_IP/poweradmin/install

      Follow the steps and provide DB info. When done, delete the install directory.

🔍 Validation & Testing

  • Use dig @MASTER_IP example.com ANY to query records
  • Use dig @SLAVE_IP example.com AXFR to test zone transfers
  • Check logs: /var/log/syslog or journalctl -u pdns

🔐 Hardening Tips

  • Enable UFW and limit to specific IPs
  • Change default MySQL port if exposed
  • Use secure passwords and disable remote root MySQL login
  • Use DNSSEC (PowerDNS supports it)

✅ Summary

Component Role
Master VPS Authoritative DNS, MySQL backend
Slave VPS Secondary, pulls zones via AXFR
MySQL Stores DNS records
Poweradmin Web UI for DNS mgmt

Launch 100% ssd ubuntu vps from $2. 49/mo!

Conclusion

You now know how to deploy PowerDNS cluster on Ubuntu VPS servers.

Share this:
Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.
lg