Symptoms
When attempting to remove the subdomain of an addon domain, you see a message similar to the following.
The system created the “addonsub.addon.tld” subdomain when it created the “addon.tld” domain. To delete this subdomain, you must first delete the following domain:
Manage the “addon.tld” domain.
Attempting to delete the addon domain gives an error similar to the following.
Error: Before the system can remove the “addon.tld parked domain, you must remove the “addonsub.addon.tld” subdomain.
Description
When an addon domain is created with a custom subdomain (i.e., addonsub.primarydomain.tld) and a subdomain of the addon domain is created for the same host portion of the custom subdomain (i.e., addonsub.addon.tld), cPanel thinks that the addon domain is parked on the subdomain of the addon domain. This prevents the subdomain from being removed in cPanel. This issue doesn't prevent the subdomain from being deleted with the API.
We've opened an internal case for our development team to investigate this further. For reference, the case number is CPANEL-43310. Follow this article to receive an email notification when a solution is published in the product.
Workaround
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Run the following command to remove the addon domain.
whmapi1 delete_domain domain='subdomain.addondomain.tld'
Please note that "subdomain.addondomain.tld" must be replaced with the subdomain to be removed.
It is recommended that the addon domain be removed, and then added back as an addon domain without setting a custom subdomain.