Disable Autogenerate www and mail for subdomain

skyknight

Active Member
May 1, 2007
36
0
156
Hi,

I want to disable serveralias www and mail (autogenerate) for subdomain in file /var/cpanel/userdata/usercp/domain.tld

When i create Alias (park domain), system will automatically add www and mail to domain or subdomain that i add.

ex:

serveralias: mail.subdomain1.domain.tld www.subdomain1.domain.tld

How to remove or prevent www and mail autogenerate?

Thank You
 

cPanelLauren

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

You'd want to edit the DNS zone file templates for these. The standard template shows as follows:

Code:
; cPanel %cpversion%
; Zone file for %domain%
$TTL %ttl%
@      %nsttl%    IN      SOA     %nameserver%. %rpemail%. (
        %serial%    ; serial, todays date+todays
        3600        ; refresh, seconds
        1800        ; retry, seconds
        1209600        ; expire, seconds
        86400 )        ; minimum, seconds

%domain%. %nsttl% IN NS %nameserver%.
%domain%. %nsttl% IN NS %nameserver2%.
%domain%. %nsttl% IN NS %nameserver3%.
%domain%. %nsttl% IN NS %nameserver4%.

%nameserverentry%. IN A %nameservera%
%nameserverentry2%. IN A %nameservera2%
%nameserverentry3%. IN A %nameservera3%
%nameserverentry4%. IN A %nameservera4%

%domain%. IN A %ip%
%domain%. IN AAAA %ipv6%
ipv6 IN AAAA %ipv6%

%domain%. IN MX 0 %domain%.

mail IN CNAME %maildomain%.
www IN CNAME %domain%.
ftp IN CNAME %domain%.
Documentation on this can be found here: Edit Zone Templates | cPanel & WHM Documentation

Keep in mind though if you modify the standard template this will affect all domains.
 

tebokkel

Registered
Mar 31, 2014
2
0
51
cPanel Access Level
Root Administrator
Sorry to revive this old thread, but this is no solution. I've done this, but now get DCV and AutoSSL errors on the missing mail DNS entry. Grrrrr
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,316
683
313
cPanel Access Level
Root Administrator
AutoSSL will send notifications if the domain is present in Apache but doesn't exist in DNS. Normally this is a good thing as users would want to know there is a DNS issue, but you can just ignore those messages due to your custom configuration.

You could always disable this option in WHM >> Contact Manager:

"AutoSSL has renewed a certificate, but the new certificate lacks one or more of the website’s domains."

but then you run the risk of missing out on important notifications for other domains.