Disable select service subdomains

cPanel & WHM Version
WHM v90.0.5

LotusBlossom

Registered
Dec 20, 2019
3
0
1
California
cPanel Access Level
Root Administrator
I have been researching all over these forums and I have read the Service Subdomains Explanation documentation but I still cannot figure out how to disable select service subdomains from being auto created every time I create a new subdomain. I am trying to disable the creation of whm, webdisk, cpcontacts, and cpcalendars from being auto created. I have followed the instructions to Edit Zone Templates but my simple, standard, and standardvirtualftp templates do not mention any of the service subdomains I am trying to disable, they only seem to contain the setup for mail, www, and ftp.

Secondly is there an easy way to remove the mentioned subdomains in one action across all domains within my WHM? I have tried running the safe removal script mentioned by cPanelMichael in this thread What are cpcalendars, cpcontacts, and webdisk, but that only seems to allow removal from one domain at a time and is very slow to do so.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
Hello,


You can disable service subdomains on existing domains by running the following via SSH:
Code:
/scripts/servicedomains remove
To keep them from being created on new accounts you can go to WHM>>Server Configuration>>Tweak Settings and select "Off" for Service subdomains.
 

LotusBlossom

Registered
Dec 20, 2019
3
0
1
California
cPanel Access Level
Root Administrator
Thank you for the help Lauren. I am trying to turn off only the automatic creation of dns records for whm, webdisk, cpcontacts, and cpcalendars from being created. I don't want to disable the setting for "Service subdomains" as that completely disables the use of cpanel.example.com and webmail.example.com which my clients use regularly.

Also, I want to disable the automatic creation of "Service subdomains" DNS records for newly made subdomains, I have no need for them. But I need to retain the service subdomains of cpanel and webmail for the main domains. Is that possible?
 
Last edited:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
So turning service subdomains off will keep them from being autocreated and also remove them from existing domains. The fix for that being, you can run the /scripts/servicedomains script from the command line to add servicedomains to accounts you would like them on individually with the service domains setting off.
 

Whitebeard

Registered
Nov 22, 2020
1
0
1
NL
cPanel Access Level
Root Administrator
When you create a subdomain this way, it will be populated to the internal DNS server, but it won't show up under AutoSSL.
The option Service Subdomains under Tweak Settings create all the service subdomains, even the ones I don't want to be created. CPanel and webmail are highly appreciated though. Of course I can create subdomains under domain settings (domainfqdn/cpanel or domainfqdn/webmail) but they will register as a seperate domain for AutoSSL and thus won't be covered by the domain certificate.