In this guide, we'll break down the causes of this error and provide step-by-step instructions on how to resolve it.
Why Does This Error Occur?
There are two main reasons you might encounter this error:
Reason 1: The domain is already in use.
- The domain could be assigned as a primary, addon, or parked domain on another cPanel account.
- It might be lingering in the server's configuration even after being removed from an account.
Reason 2: Technical Glitches
- The removal process for the domain might not have been completed correctly, leaving remnants in the system.
Troubleshooting and Resolution
1. Check if the Domain is Actively Used
If the error is due to the domain already being associated with another account:
- Remove the domain: Log into the cPanel account that's using the domain and remove it as an addon, parked, or primary domain.
If you encounter the error "Error from park wrapper: Sorry, you do not control the domain" while trying to remove it, proceed to the next step.
2. Identify the Domain Owner and Remove Entries
Find the Owner: Use the following commands in the server's command line (SSH) to determine which account the domain is associated with:
/scripts/whoowns example.com
If this doesn't yield results, try:
grep example.com /var/cpanel/users/*
(Replace "example.com" with the actual domain name.)
Remove Domain Entries: Once you know the owner account, remove any references to the domain from the following files:
/var/named/example.com.db
/etc/httpd/conf/httpd.conf
(remove the virtual host entry)/var/cpanel/users/username
(remove entries related to the domain)/etc/userdomains
/etc/localdomains
/etc/named.conf
(remove entries related to the domain)- Remove DNS entry in WHM: Go to the DNS Zone Manager in WHM and remove the DNS zone for the domain.
Update User Domains: Finally, run the following command as root:
/scripts/updateuserdomains
Important Considerations:
- Backups: Before making any changes to configuration files, it's crucial to have a backup of your server in case of unintended consequences.
- Technical Expertise: If you're not comfortable with editing configuration files, consider seeking help from your hosting provider or a qualified system administrator.
By following these steps, you should be able to resolve the "Sorry, that domain is already set up" error and successfully add the domain to the desired cPanel account.