docs / agent

PowerDNS with the BIND backend (named.conf zones)

PowerDNS can serve your zones straight from BIND’s named.conf and its zone files. You don’t need to import them into a database. This is the bind backend, and it’s how cPanel runs PowerDNS: the zones stay in BIND format, and PowerDNS answers for them.

For ZoneCloud that’s the easy case. The agent reads the zone list from PowerDNS, the Nodes transfer the zones as usual, and nothing about your zone files has to change.

Tell PowerDNS to use your BIND zones

Edit pdns.conf (/etc/pdns/pdns.conf or /etc/powerdns/pdns.conf, depending on the distribution) and set:

launch=bind
bind-config=/etc/named.conf
bind-check-interval=300
  • launch=bind loads the bind backend.
  • bind-config points at the named.conf that lists your zones and where their files live.
  • bind-check-interval=300 makes PowerDNS check the zone files for changes every 300 seconds. When you edit a zone you don’t restart PowerDNS: the change is picked up on the next check.

Restart PowerDNS once after changing these settings:

systemctl restart pdns

Check that PowerDNS sees your zones

pdnsutil list-all-zones

This should print every zone from named.conf. The ZoneCloud agent uses the same command to discover zones, so if a zone is missing here, it won’t reach your Nodes either.

When you don’t want to wait for bind-check-interval:

pdns_control bind-reload-now example.com    # re-read one zone file now
pdns_control rediscover                     # pick up zones newly added to named.conf

What the ZoneCloud agent does on a PowerDNS server

The agent recognises PowerDNS by its running pdns_server process. You can also set it explicitly in /etc/zcloudagent.conf:

DNS_SERVER_TYPE=PDNS
# optional, the agent also looks in the usual places (/usr/bin, /usr/sbin, …)
PDNSUTIL_BINARY_PATH=/usr/bin/pdnsutil

On every update the agent asks the Controller for your Nodes’ IPs. It then keeps a block of settings in pdns.conf up to date, so your Nodes are allowed to transfer zones and are notified when a zone changes:

# --- zcloud managed begin ---
primary=yes
disable-axfr=no
allow-axfr-ips=127.0.0.0/8, 1.1.1.1, 2.2.2.2
allow-notify-from=0.0.0.0/0, ::/0, 1.1.1.1, 2.2.2.2
also-notify=1.1.1.1, 2.2.2.2
forward-notify=1.1.1.1, 2.2.2.2
allow-unsigned-notify=yes
# --- zcloud managed end ---

1.1.1.1 and 2.2.2.2 stand for your Nodes. A few details:

  • It merges, it doesn’t overwrite. Addresses already in those settings are kept and the Nodes are added, without duplicates.
  • It backs up first. Each change to pdns.conf leaves a timestamped copy beside it (pdns.conf.<date>-<time>.bak), and the last five are kept. PowerDNS is restarted only when something actually changed.
  • It never empties the lists by mistake. If the Controller can’t be reached, the agent skips this step for that round instead of treating “no answer” as “no Nodes”.
  • primary is the PowerDNS 4.5+ name. Releases before 4.5 call the same setting master.

These are the same settings as in Agent on cPanel PowerDNS. There you’ll also find what the Nodes log when a transfer is refused (NOTAUTH) and how to fix it by hand.

Further reading