Symptoms
When creating a subdomain with a country-code second-level domain through the cPanel Domains interface, you receive an error like this:
There was a problem creating the sub-domain:
(XID ce27y2) Died at /usr/local/cpanel/Cpanel/Admin/Modules/Cpanel/subdomain.pm line 176.
Description
After looking into user reports, we have found that domains matching our service subdomain names with a country-code second-level domain are not being handled correctly during creation on existing accounts. The backend task is treating the second-level domain as the primary domain and incorrectly generating or updating the DNS zones as a result. When adding the subdomain or an addon domain(as this also creates a subdomain), the creation task will attempt to add a zone file for the country-code second-level domain (ie, /var/named/mail.co.uk.db
vs /var/named/co.uk.db
).
This can be confirmed by checking the cPanel error logs at /usr/local/cpanel/logs/error_log
for output like the following when receiving the error mentioned above. The co.uk is provided as an example, but would match the country-code second-level domain used:
The zone for the root domain co.uk is missing, or could not be read. The IP address will be read from the webserver configuration and a new zone will be created for this subdomain.
(XID sxpw5u) The system cannot create the domain “co.uk” because it is a top-level domain or other public suffix. You must use a different domain name.
Unable to add record for co.uk
Use of uninitialized value $result in die at /usr/local/cpanel/Cpanel/Admin/Modules/Cpanel/subdomain.pm line 176.
We've opened an internal case for our development team to investigate this further; for reference, the case number is CPANEL-36427. Follow this article to receive an email notification when a solution is published in the product.
Workaround
This behavior only occurs if using a domain that matches one of the service subdomains (ie, mail, webmail, cpanel, whm, or webdisk). Until a resolution is posted we advise using a different domain name if possible.
If this is not an available option, you can create a new cPanel account to host the subdomain instead. This conflict only occurs when adding a subdomain to an existing account. When creating a new account with the same subdomain, this will be created normally.
While it may be possible to create the subdomain with the invalid second-level domain zone present on the system, it has been found that this will encounter different errors during further domain management. This can be used as a temporary workaround, but please be aware of this conflict and that no resolution is available yet for the continued errors.
Comments
1 comment
Update: We would like to thank you for your interest in this article/case and encourage your submissions as they are valuable to the ever-expanding development of cPanel & WHM. At this time, this particular issue has not been selected for action from our Development Team, as it may require more development resources than we can allot, or alters the direction cPanel envisions for the product. Submissions persist in our Issue Tracking System in the event the impact of the related issue grows or product direction changes. If you feel that this defect requires direct action, we strongly encourage you to submit a Feature Request to allow the cPanel Community to vote and support your cause.
Thank you again for helping us make cPanel & WHM the hosting platform of choice.
Article is closed for comments.