docs / agent

Agent on cPanel PowerDNS

Agent on cPanel with PowerDNS

Comparing ways to give cPanel servers secondary nameservers? Start with Secondary DNS for cPanel with PowerDNS. This page is the agent setup.

Adding the repository

yum install https://repo.nixpal.com/el/nixpal.rpm

Installing zcloudagent

yum clean all
yum install zcloudagent

Configuring and starting zonecloud – /etc/zcloudagent.conf

Add the

  • SERVER_HOSTNAME: your controller’s hostname
  • LICENSE: Obtained from us
  • TOKEN: Obtained from the controller
  • DNS_SERVER_TYPE=PDNS
  • PDNSUTIL_BINARY_PATH=/usr/bin/pdnsutil

fields in /etc/zcloudagent.conf.

ZONES_FILE=/etc/named.conf
TOKEN=Token_From_zCloud_Server
SERVER_HOSTNAME=controller.yourdomain.com
UPDATE_INTERVAL=60
LOG_LEVEL=1
LICENSE=ZCAgent-xxxxxxxxxxx
//If your server uses PowerDNS uncomment the following 2 lines
DNS_SERVER_TYPE=PDNS
PDNSUTIL_BINARY_PATH=/usr/bin/pdnsutil

Enabling and Staring agent:

systemctl enable zcloudagent --now

Check service if started  with “status”

systemctl status zcloudagent

Also, check Controller web interface if the agent is sending zone information.

Configuring pdns.conf

Current agents write these settings into pdns.conf themselves, in a managed block that follows your Nodes’ IPs from the Controller. See PowerDNS with the BIND backend. The manual steps below show what that block contains, and help if you need to set it up by hand.

  • There is now automated way to copy/paste/configure named.conf and pdns.conf from inside the Controller.

And just copy/paste the appropriate configuration

Let’s assume our nodes DNS Servers IP’s are: 1.1.1.1 , 2.2.2.2, 3.3.3.3 and 4.4.4.4 for this example.

Note** Depending on your version you might need to change primary yes to master yes:
https://doc.powerdns.com/authoritative/settings.html#setting-primary
Changed in version 4.5.0: This was called master before 4.5.0.

pdns.conf :

primary = yes
disable-axfr=no
allow-axfr-ips=127.0.0.0/8, 1.1.1.1, 2.2.2.2, 3.3.3.3, 4.4.4.4
allow-notify-from=0.0.0.0/0,::/0, 1.1.1.1, 2.2.2.2, 3.3.3.3, 4.4.4.4
also-notify=1.1.1.1, 2.2.2.2, 3.3.3.3, 4.4.4.4
allow-unsigned-notify=yes
forward-notify=1.1.1.1, 2.2.2.2, 3.3.3.3, 4.4.4.4

Restart pdns and check Nodes.

Troubleshooting: transfers fail with NOTAUTH

cPanel installs PowerDNS by default, and PowerDNS refuses zone transfers until it is told who may ask. Until pdns.conf is set up as above, the BIND logs on your Nodes look like this:

node1 named: transfer of 'example.com/IN' from 203.0.113.10#53: connected using 203.0.113.20#40271
node1 named: transfer of 'example.com/IN' from 203.0.113.10#53: failed while receiving responses: NOTAUTH
node1 named: transfer of 'example.com/IN' from 203.0.113.10#53: Transfer status: NOTAUTH
node1 named: transfer of 'example.com/IN' from 203.0.113.10#53: Transfer completed: 0 messages, 0 records, 0 bytes, 0.003 secs (0 bytes/sec)

NOTAUTH here is the cPanel server saying “you may not transfer this zone”. The fix is the four settings in the pdns.conf above:

  • disable-axfr=no, so transfers are allowed at all;
  • every Node’s IP in allow-axfr-ips, so each Node may transfer;
  • every Node’s IP in allow-notify-from and also-notify, so changes are announced to the Nodes.

Restart PowerDNS, and the next attempt on the Node reads:

node1 named: transfer of 'example.com/IN' from 203.0.113.10#53: Transfer status: success
node1 named: transfer of 'example.com/IN' from 203.0.113.10#53: Transfer completed: 3 messages, 12 records, 936 bytes, 0.013 secs (72000 bytes/sec)

You don’t need to switch the cPanel server back to BIND: PowerDNS works as the source.

For the full diagnosis (a one-command test, BIND primaries, zone-level overrides, serials), see Zone transfers fail with NOTAUTH or REFUSED.

A change takes a while to reach the Nodes

The Nodes pick up a change on the next NOTIFY, or when the zone’s refresh timer runs out. To fetch one zone straight away, run this on a Node:

rndc reload example.com