Fixing the "A DNS entry for the domain already exists" Error When Adding an Addon Domain in cPanel Print

  • 0

When adding an addon domain in cPanel, you may sometimes encounter this error:

(XID xxxxx) A DNS entry for the domain “exampleaddon.com” already exists.

This message indicates that cPanel has detected a conflicting DNS record for the domain you're trying to add — even if it no longer appears in your account.


🔍 Why This Happens

This error usually appears due to:

  • An addon or parked domain that was previously created and not fully removed

  • A leftover DNS zone file in /var/named/

  • A stale reference in /etc/userdomains, /var/cpanel/userdata/, or named.conf

  • A partial DNS record from a previous account or subdomain


✅ Step-by-Step Fix Guide

1️⃣ Search for Existing DNS References

Use the following commands:

grep -Ri "exampleaddon.com" /var/named/
grep -Ri "exampleaddon.com" /etc/named.conf
grep -Ri "exampleaddon.com" /var/cpanel/userdata/
grep -Ri "exampleaddon.com" /etc/userdomains

If any results are found, proceed to remove them manually (with caution).


2️⃣ Remove the Zone File (If It Exists)

rm -f /var/named/exampleaddon.com.db

And remove any references in the BIND configuration:

sed -i '/exampleaddon.com/d' /etc/named.conf

3️⃣ Clean Up cPanel Internal References

Open the relevant cPanel user file:

nano /var/cpanel/users/exampleuser

Remove any line like:

XDNS1=exampleaddon.com

Then update user data cache:

rm -f /var/cpanel/users.cache/exampleuser
/scripts/updateuserdatacache
/scripts/rebuilddnsconfig
/scripts/rebuildhttpdconf

4️⃣ Restart DNS Services

For PowerDNS:

systemctl restart pdns

For BIND:

rndc reload

5️⃣ Try Adding the Domain Again in cPanel

  • Navigate to cPanel > Domains > Create a New Domain

  • Enter exampleaddon.com

  • Set a unique document root

  • Proceed with creation


💡 Pro Tips

  • Always remove addon domains via cPanel, not by manually deleting folders.

  • Before reusing a domain name, check for DNS leftovers.

  • Avoid using the same domain as a subdomain or parked domain elsewhere on the server.


🛡️ Summary Checklist

Step Action
1 Search for DNS conflicts using grep
2 Delete old zone file and config entries
3 Clear cPanel user mappings and caches
4 Restart PowerDNS/BIND and Apache
5 Re-attempt addon domain creation via cPanel

This process ensures a clean environment for re-adding a previously removed or conflicting domain.


Was this answer helpful?

« Back