Skip to main content
PowerDNS Authoritative Server is a versatile, open-source nameserver with multiple storage backends and an HTTP API. Stackryze uses PowerDNS to power ns1.stackryze.com and ns2.stackryze.com, which serve all Stackryze Domain subdomains under indevs.in, sryze.cc, ryzedns.org, and nx.kg.
The walkthrough below uses yourname.indevs.in as a working example. If you registered under one of the other namespaces (sryze.cc, ryzedns.org, nx.kg), substitute the namespace everywhere you see indevs.in.
Advanced setup — not recommended for beginners. PowerDNS requires comfort with Linux, DNS internals, Docker, and database administration. If that’s not you, start with Cloudflare instead.

Why PowerDNS?

  • Complete control — own your DNS infrastructure.
  • Multiple backends — PostgreSQL, SQLite, BIND zone files, and more.
  • RESTful HTTP API — programmatic DNS management.
  • High performance — built for millions of queries.
  • DNSSEC support — built in.
  • Active development — regular updates and security patches.

Prerequisites

Before you begin, confirm you have:
  • ✅ Linux server(s) with root access (minimum two for redundancy).
  • ✅ Docker and Docker Compose (20.10.0+ recommended).
  • ✅ A Stackryze Domain registered at domain.stackryze.com.
  • ✅ At least one public static IP.
  • ✅ Working knowledge of DNS zones and nameserver delegation.
  • ✅ Familiarity with PostgreSQL (if using the database backend).
For production, you need at least two nameservers for redundancy. This guide starts with a single-server setup for learning, then covers replication.

Docker images

PowerDNS publishes official images at hub.docker.com/u/powerdns:
This guide uses powerdns/pdns-auth-49 — the latest stable authoritative server.

Architecture overview

Install with Docker and PostgreSQL

PostgreSQL is a solid production backend for PowerDNS — robust, standards-compliant, and feature-rich.

Step 1 — Create docker-compose.yml

Step 2 — Create the PostgreSQL schema

Create schema-postgres.sql with the official PowerDNS 4.7+ schema:

Step 3 — Create the PowerDNS config

Create pdns-postgres.conf:

Step 4 — Start the services

Step 5 — Verify the connection

Step 6 — Allow DNS traffic

Never expose port 8081 (API) to the public internet without authentication and IP restrictions. Use a VPN, SSH tunnel, or firewall rules.

Manage zones via the API

PowerDNS exposes a RESTful HTTP API for zone and record management.

Create a zone

Zone names must end with a dot — for example yourname.indevs.in..

Add an A record

Add a CNAME record

List all zones

View zone details

Delete a record

Register with Stackryze Domains

Once your PowerDNS server is running:
  1. Open domain.stackryze.com.
  2. Go to My Domains.
  3. Click your domain.
  4. In DNS Configuration, click Edit.
  5. Enter your PowerDNS nameserver hostnames:
    • Primary: n1.yourdomain.com (must have an A record pointing to your server IP).
    • Secondary: n2.yourdomain.com (for redundancy, pointing to the secondary server).
  6. Click Save.
Your nameserver hostnames (n1.yourdomain.com) must have A records in their parent zone pointing to your PowerDNS server IPs. Set up glue records with your registrar if needed.

Test DNS resolution

Test against your server directly

Test through public DNS

Online tools

High availability with master-slave replication

For production DNS, run at least two nameservers for redundancy. PowerDNS supports master-slave replication using AXFR (Authoritative Zone Transfer).

How AXFR works

  1. The master (n1) holds the authoritative data.
  2. The slave (n2) periodically pulls zone updates from the master.
  3. Zone data is transferred via AXFR over TCP port 53.
  4. The slave stays in sync automatically.
Benefits:
  • Redundancy if the master fails.
  • Load distribution across both servers.
  • Geographic distribution for performance.
  • Automatic synchronization.
Stackryze infrastructure:
  • ns1.stackryze.commaster (primary).
  • ns2.stackryze.comslave (secondary).
When a user updates their nameservers through the Stackryze platform, the API updates n1; n2 receives changes via AXFR.

Master configuration (n1.yourdomain.com)

Create pdns-master.conf:
Replace SLAVE_SERVER_IP with your secondary server’s IP (for example 203.0.113.2).

Slave configuration (n2.yourdomain.com)

Create pdns-slave.conf:

Set up replication

Step 1 — Add the master as a supermaster on the slave:
Replace MASTER_SERVER_IP with the master’s IP. Step 2 — Create the zone on the master as Master:
Step 3 — Verify replication:

How updates propagate

  1. Admin makes a change on the master (n1) via API.
  2. Master increments the zone’s SOA serial.
  3. Master sends NOTIFY to the slave (n2).
  4. Slave requests AXFR from the master.
  5. Master transfers the full zone.
  6. Slave updates its local database.
  7. Both servers serve identical DNS data.

Firewall for AXFR

On the master:
On the slave:

Troubleshooting replication

Slave not receiving zones:
AXFR denied:
  • Confirm allow-axfr-ips on the master includes the slave IP.
  • Confirm the firewall allows TCP 53 from slave to master.
  • Confirm the slave IP is correct in the master config.

Security best practices

Restrict API access

Use strong API keys

Enable DNSSEC (optional)

Keep software updated

Monitor logs

Disable query logging in production

Query logging can hurt performance and fill disk.

Common issues

Port 53 already in use

Another service (often systemd-resolved) is using port 53.

Database connection failed

  • Verify the database container is running: docker-compose ps.
  • Confirm credentials match in docker-compose.yml and pdns.conf.
  • Wait 30–60 seconds after starting the database before starting PowerDNS.
  • Check database logs: docker-compose logs postgres.

DNS queries not responding

API returns 401 Unauthorized

  • Confirm the X-API-Key header matches the key in pdns.conf.
  • Confirm api=yes is set.
  • Restart PowerDNS after config changes: docker-compose restart powerdns.
  • Test the API directly: curl http://localhost:8081/api.

Zone not found

Confirm the zone name ends with a dot (yourname.indevs.in.).

Monitoring and maintenance

Server statistics

Backup

SQLite:
PostgreSQL:

Restore

SQLite:
PostgreSQL:

Performance tuning

Resources

Simpler alternatives

If PowerDNS feels heavy, try one of these instead:

How Stackryze uses PowerDNS

Stackryze runs PowerDNS to power our authoritative nameservers:
  • ns1.stackryze.com (primary) — PostgreSQL backend, receives updates from the API.
  • ns2.stackryze.com (secondary) — PostgreSQL replication from n1.
These servers manage DNS delegation for every indevs.in subdomain through the PowerDNS HTTP API — zone creation and record management are fully automated when users register domains.
Beginners should start with Cloudflare. Self-hosting DNS requires significant expertise in system administration, security, and DNS protocols.

Need help?