Symptoms
When adding a domain in your cPanel, you get the following error:
There was an error when the system attempted to create the alias. (XID haj58w) A DNS entry for “exampledomain.com” already exists. You must remove this DNS entry from this server or all servers in the DNS cluster to proceed.
You may also encounter this error when adding an addon domain and the chosen subdomain already exists. The error you may see is the following:
There is already a DNS entry for the domain “exampledomain.cptest.com”. at /usr/local/cpanel/Cpanel/Admin/Modules/Cpanel/subdomain.pm line 176.
Description
This error happens when your server already has a DNS zone for the domain or the record was added previously to the DNS zone file. You will want to ensure that the DNS zone file is removed, or the specific DNS zone record is modified so that you can add the domain or record.
Workaround
To remove the zone entirely you can do this under:
"WHM » Home » DNS Functions » Delete a DNS Zone"
To modify the zone, you can do this under:
"WHM » Home » DNS Functions » Edit DNS Zone"