PowerDNS Authoritative
Overview
This guide shows you how to deploy and configure PowerDNS Authoritative Server on AWS using SecureAnyCloud AWS Marketplace images. PowerDNS Authoritative Server is a high-performance open-source authoritative DNS server developed by PowerDNS.COM BV.
It hosts the DNS zones for your own domains and answers queries for them. It stores its zones and records in a relational database, so you can manage DNS with SQL, the pdnsutil command-line tool, or a full REST API.
The image installs PowerDNS Authoritative Server 5.1 from the official PowerDNS packages (the repo.powerdns.com auth 51 stable branch), pinned above the distribution package. It runs against a MariaDB database backend on the same instance.
Authoritative, not recursive. This server is authoritative for the zones you host and publishes your DNS records to the internet. It is not a recursive resolver, so a query for a name it is not authoritative for is answered without recursion. This is the correct, safe role for a public-facing name server, and it avoids the open resolver DNS amplification risk entirely.
Security by design, no default credentials. The REST API key is the equivalent of an administrator password for the DNS server, so this image never ships a fixed key. On the very first boot of every instance, a fresh per-instance REST API key and a fresh database password are generated and the demonstration zone is provisioned. The details are written to /root/powerdns-credentials.txt (mode 0600, root only).
The REST API and status webserver are bound to 127.0.0.1 only. The management surface is never exposed to the network, while DNS itself answers on port 53.
What you get:
- PowerDNS Authoritative Server 5.1 from the official PowerDNS packages, run under systemd as the unprivileged
pdnsuser (pdns.service) - A MariaDB database backend (
gmysql) holding your zones and records, so you manage DNS with SQL,pdnsutil, or the REST API - The REST API enabled and bound to loopback (
127.0.0.1:8081), authenticated with a per-instanceX-API-Key, plus the status webserver - One demonstration zone (
example.com), sodig @<server> www.example.comresolves out of the box, ready for you to replace with your own domain - A per-instance REST API key and database password generated on first boot and documented in
/root/powerdns-credentials.txt(0600) - Built-in DNSSEC signing available through
pdnsutil, and the systemd-resolved stub listener disabled so PowerDNS owns port 53 cleanly
Connecting to your instance
Connect over SSH on port 22 as the default login user for the AMI variant you launched. The per-instance REST API key and database password are generated on first boot and written to a root-only file.
- OS variant: Ubuntu 24.04 LTS
- SSH login user: ubuntu
- Notes: pdns.service and mariadb.service; config at /etc/powerdns/pdns.d/sac-pdns.conf
ssh -i /path/to/key.pem ubuntu@<public-ip>Prerequisites
- An active AWS account and an EC2 key pair in the target Region
- A subscription to the PowerDNS Authoritative Server listing on AWS Marketplace
- A security group that allows TCP 22 (admin) and both UDP and TCP 53 (DNS) from the clients that will query the server
Recommended instance type: m5.large (2 vCPU, 8 GB RAM) for a small to medium authoritative server. Servers that answer heavy query volumes should use a larger instance type.
Deploy from the AWS Console
In the AWS Marketplace console, search for PowerDNS Authoritative Server and select the SecureAnyCloud listing. Choose Continue to Subscribe, then Continue to Launch.
Choose the m5.large instance type and your key pair. Choose a security group that allows UDP 53 and TCP 53 (DNS) from your client networks and TCP 22 for administration.
DNS uses UDP 53 for most queries and falls back to TCP 53 for large responses and zone transfers, so open both. The REST API stays on loopback and is never exposed.
Deploy from the AWS CLI
aws ec2 run-instances \
--image-id ami-<powerdns-authoritative-ami-id> \
--instance-type m5.large \
--key-name <your-key-pair> \
--security-group-ids <security-group-id> \
--subnet-id <subnet-id> \
--associate-public-ip-address \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=ns1}]'The security group in this command must open TCP 22 and both UDP and TCP 53.
First boot
On first boot, the image generates a fresh per-instance REST API key and database password and provisions the demonstration example.com zone. It then starts pdns, verifies that the API key round-trips and the zone resolves, and writes /root/powerdns-credentials.txt.
This completes within a minute. SSH in as ubuntu and read the details:
sudo cat /root/powerdns-credentials.txtConfirm the services are running
pdns.service (the PowerDNS daemon) and mariadb.service (the database backend) are both active. ss confirms DNS is listening on :53 (UDP and TCP, all interfaces) while the REST API is bound to 127.0.0.1:8081 only. Run:
systemctl is-active pdns.service mariadb.service pdns_server --version ss -tlnup | grep -E ':53 |:8081 'Query the demonstration zone
The image ships one demonstration zone, example.com, so a DNS round trip works immediately. Query it against the loopback address, or against the instance public IP from a client.
The aa flag in the header confirms an authoritative answer. The demonstration records use the 203.0.113.10 documentation address, which you replace with your own.
dig @127.0.0.1 www.example.com dig @127.0.0.1 example.com SOA +short dig @127.0.0.1 example.com NS +shortUse the REST API
The REST API is the same interface used by web control panels and automation tools. Read your per-instance API key from the credentials file into a shell variable. Then call the server info endpoint. It is bound to loopback, so run these commands on the instance or tunnel port 8081 over SSH.
API_KEY=$(sudo grep '^powerdns.api.key=' /root/powerdns-credentials.txt | cut -d= -f2-)
curl -s -H "X-API-Key: $API_KEY" http://127.0.0.1:8081/api/v1/servers/localhost | jq . pdnsutil list-all-zonesA request without the key is rejected with HTTP 401, and a request with the key returns HTTP 200:
API_KEY=$(sudo grep '^powerdns.api.key=' /root/powerdns-credentials.txt | cut -d= -f2-)
echo -n 'with key : HTTP '; curl -s -o /dev/null -w '%{http_code}\n' -H "X-API-Key: $API_KEY" http://127.0.0.1:8081/api/v1/servers/localhost
echo -n 'without key : HTTP '; curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8081/api/v1/servers/localhostReview the secure-by-default configuration
No default or shared credentials ship in the image. The credentials file is 0600 root:root and the secrets drop-in is 0640 root:pdns. The API key and database password are unique to this instance, the backend is MariaDB (gmysql), and the REST API is bound to loopback only.
Verify it:
sudo stat -c '%n %a %U:%G' /root/powerdns-credentials.txt grep -E 'launch|gmysql-dbname|webserver-address|api=' /etc/powerdns/pdns.d/sac-pdns.confAdd your own authoritative zone
Replace the demonstration zone with your own domain. Create the zone and add records with pdnsutil. The zone list cache is disabled on this appliance, so new zones and records are served immediately with no reload.
pdnsutil zone create <your-domain> pdnsutil rrset add <your-domain> <your-domain> NS 3600 "ns1.<your-domain>." pdnsutil rrset add <your-domain> www A 3600 "203.0.113.20" pdnsutil rrset add <your-domain> @ A 3600 "203.0.113.20" pdnsutil zone list <your-domain> dig @127.0.0.1 www.<your-domain>
# once your own <your-domain> zone resolves, remove the demonstration zone: pdnsutil zone delete example.comManage records with the REST API
You can also create zones and records through the REST API, which is how automation and control panels drive PowerDNS. This example creates a zone with a single POST:
API_KEY=$(sudo grep '^powerdns.api.key=' /root/powerdns-credentials.txt | cut -d= -f2-)
curl -s -H "X-API-Key: $API_KEY" -H 'Content-Type: application/json' \
-X POST http://127.0.0.1:8081/api/v1/servers/localhost/zones \
-d '{"name":"<your-domain>.","kind":"Native","nameservers":["ns1.<your-domain>."]}'Enable DNSSEC signing
PowerDNS signs zones with a single command. Secure your zone. Then publish the DS record that it prints at your registrar, so resolvers can validate your answers.
pdnsutil secure-zone <your-domain> pdnsutil show-zone <your-domain> pdnsutil export-zone-ds <your-domain>Delegate your domain
Point your domain registrar's name server (NS) records at this instance's public IP, so that the internet queries this server for your zone. Confirm from an external client:
dig @<public-ip> www.<your-domain>For resilience, run a second PowerDNS instance as a secondary. Scope zone transfers (AXFR) to its address with the allow-axfr-ips setting or with per-zone ALLOW-AXFR-FROM metadata.
Security recommendations
- Restrict the security group. Allow UDP and TCP 53 only from the client networks that need to query the server, and TCP 22 for administration only. The REST API stays on loopback. Tunnel port 8081 over SSH if you need it remotely.
- Keep the REST API on loopback. The image binds the API and status webserver to
127.0.0.1and setswebserver-allow-fromto loopback. Do not expose it directly. If you need remote API access, front it with a reverse proxy and TLS. - Enable DNSSEC for production zones (Step 10), so resolvers can validate your answers.
- Add secondary servers and scope
AXFRzone transfers to their addresses rather than leaving them open. - Keep the OS and PowerDNS patched, including the official PowerDNS repository for the auth 51 branch.
- Back up the database. Your zones and records live in the MariaDB
powerdnsdatabase. Take regularmysqldumpbackups.
Support and Licensing
PowerDNS Authoritative Server is developed by PowerDNS.COM BV and distributed under the GNU General Public License version 2 (GPL-2.0) with an OpenSSL linking exception (see the upstream NOTICE file). This SecureAnyCloud image bundles the unmodified official PowerDNS packages. SecureAnyCloud provides the packaging, the MariaDB backend integration, the per-instance credential automation, the demonstration zone and 24/7 support.
SecureAnyCloud is not affiliated with or endorsed by PowerDNS.COM BV. PowerDNS is a mark of its respective owner and is used here only to identify the software.
Deploy on AWS
Find PowerDNS Authoritative Server on the AWS Marketplace, published by SecureAnyCloud. Deploy from the Console or the AWS CLI as shown above.
Need Help?
Email sales@secureanycloud.com for deployment help, configuration questions or licensing inquiries.
Deploy on AWS
Launch PowerDNS Authoritative Server with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com