DNS settings: several redundant CNAME entries?

kazimir82

Member
Apr 15, 2011
14
0
51
In the DNS settings of a domain, I noticed by default these DNS records are being created:

Code:
example.com       A      1.2.3.4
mail.example.com  CNAME  example.com
www.example.com   CNAME  example.com
ftp.example.com   CNAME  example.com
*.example.com     A      1.2.3.4
Just out of curiosity, is there any advantage to this, instead of just:
Code:
example.com    A      1.2.3.4
*.example.com  CNAME  example.com
I guess it doesn't matter, but I just want to make sure I understand 100% what's going on.

It seems to me the first is more redundant (more work involved if your IP ever changes, for example) but they effectively work the same, is that correct?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
mail.example.com shouldn't actually use a CNAME according to the RFC, so I'd change that to an IP and keep it separate. You can read the following about how CNAME records should not be used for mail.example.com entries at Chapter 8 - CNAME Record location:

While use of CNAME RRs with NS and MX records is widely implemented and generates a working configuration it is theoretically not permitted (RFC 1034 section 3.6.2) since it can result in lost names. The fragment below illustrates a widely used but technically invalid configuration.
I wouldn't personally want to wildcard all subdomains to a set entry, but you are correct that it should be possible to do it the way you are noting for the other subdomains.