SOLVED Modifying / deleting auto created subdomains DNS records

krembo99

Active Member
May 30, 2013
34
2
8
cPanel Access Level
Root Administrator
I have a simple question.

when creating an add-on domain or domain, cpanel/whm will create some default subdomains DNS entries / Zone records like :
Code:
    www.addon.domain.tld
    whm.domain.tld
    cpanel.domain.tld
    ftp.domain.tld
and others like cpcalendars - webdisk - mail ...etc etc.

you get the point .. we all know them.

SO - Assuming I have a server with numerous (cir.50) domains but without any external clients - All are own domains ( only internal company colleagues as admins ):

1 - Is it safe to delete the above mentioned records ? will it create internal cpanel / whm issues ?

We anyhow access the whm through main domain ( host.domain.tld:2087 ) and we do not use ANY of these features. not even ftp ( just sFTP ).

( and of course I am not talking about deleting SPF/DCV/DKIM records )

2 - is there a way to stop whm/cpanel from creating them ? I have looked at the dns templates - But I do not think this is what I need ...

The reasons I want to do that are A: keep the server / hostfile tidy. and B: a (bit) security issue with bots/scripts scanning said subdomains / login attempts.

( and I have another small unrelated question - how to edit the title of a thread like this one in this forum after it was posted ? for example add "subdomains DNS records" :) )
 
Last edited by a moderator:

krembo99

Active Member
May 30, 2013
34
2
8
cPanel Access Level
Root Administrator
@Infopro - thanks for the rapid reply .

So basically in tweak-settings I can disable the DNS creation ( never paid attention to that option ) . Might be usefull to add an option to select which ones to enable by default and which ones to disable in the UI/UX

I can also safely assume it is ok to delete them AFTER creation, correct? and that there is no automatic deletion function / script available from UI and deletion must be made one by one on all domains ?
 
Last edited:
  • Like
Reactions: cPanelLauren

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
The documentation here may be useful as well:

Service Subdomains Explanation - cPanel Knowledge Base - cPanel Documentation
Service and Proxy Subdomains - cPanel Knowledge Base - cPanel Documentation
If you're not making use of them then yes it's fine to remove them. You can use the following to manage (including remove) the service subdomains:

Code:
[[email protected] ~]# /scripts/servicedomains --help
Usage:
    servicedomains [action] [options]

        Options:
          --help                          Brief help message
          --man                           Full help message
          --user=                         User to configure
          --domain=                       Domain to configure
          --subdomain=                    Service subdomain to manipulate
          --no_replace=0                  Enable replacment of existing records (currently
                                          only used for changing autodiscover hosts)
          --old_autodiscover_host=        The previously configured autodiscover host (used
                                          for matching old records and updating them to the
                                          new host)
          --force_autodiscover_support=1  Behave as if the autodiscover support has not been
                                          disabled even if it has. This is useful for
                                          removing the autodiscovery service subdomains after
                                          the support for them has been disabled.
          --ifenabled                     Only perform the operation if service subdomains
                                          are enabled.

        Actions:
          add          Create service subdomains
          remove       Remove service subdomains