Symptoms
Attempting to add an Addon Domains or an Alias fails with the following massage:
Sorry, An error occurred while adding dns zone: Could not store zonedata for domain.tld on username
or
There was an error when the system attempted to create the alias. Sorry, An error occurred while adding dns zone: Could not store zonedata for domain.tld on username
Description
This error occurs on systems using PowerDNS when /usr/bin/pdns_control is missing. The following entries can be seen in /usr/local/cpanel/logs/error_log.
[2021-07-06 13:49:30 +0000] info [dnsadmin] Error encountered by “/usr/bin/pdns_control” when running command: “bind-add-zone -- domain.tld /var/named/domain.tld.db”
[2021-07-06 13:49:30 +0000] info [dnsadmin] The “/usr/bin/pdns_control bind-add-zone -- domain.tld /var/named/domain.tld.db” command (process 12058) reported error number 2 when it ended.: exec(/usr/bin/pdns_control) failed:
[2021-07-06 13:49:30 +0000] info [dnsadmin] Error encountered by “/usr/bin/pdns_control” when running command: “bind-remove-zone -- domain.tld”
[2021-07-06 13:49:30 +0000] info [dnsadmin] The “/usr/bin/pdns_control bind-remove-zone -- domain.tld” command (process 12059) reported error number 2 when it ended.: exec(/usr/bin/pdns_control) failed:
[2021-07-06 13:49:30 +0000] info [dnsadmin] Error encountered by “/usr/bin/pdns_control” when running command: “bind-add-zone -- domain.tld /var/named/domain.tld.db”
Workaround
To correct this, the zone file for the domain that failed to be added must be deleted, and PowerDNS must be reinstalled.
To delete the zone file, use the rm command.
# rm /var/named/domain.tld.db
rm: remove regular file ‘/var/named/domain.tld.db’? y
#
To reinstall PowerDNS from WHM:
- Go to Home >> Service Configuration >> Nameserver Selection.
- Select BIND.
- In the Warning box, put a check next to 'I understand and want to continue.'
- Click the Save button.
- Once the BIND installation completes, go back to Home >> Service Configuration >> Nameserver Selection.
- Select PowerDNS.
- Click the Save button.
To reinstall PowerDNS from the command line, run the following commands.
# /scripts/setupnameserver bind
# /scripts/setupnameserver powerdns
Comments
0 comments
Article is closed for comments.