Setting a CNAME for subdomain that has its own Zone file

wrigs1

Registered
Jul 3, 2013
2
0
1
cPanel Access Level
Website Owner
Hi

"My" server hosts say "example.com" and sub-domain "blog.example.com". These were originally created (using WHM) as separate accounts so each has its OWN Zone file on the name server.
Under WHM->List Accounts the "IP Addresses" for these show as "12.34.56.78/~example" and "12.34.56.78/~blogexam".

I want to use Incapsula CDN to "serve" blog.example.com, but NOT example.com itself.
To direct requests to Incapsula I have to set a CNAME of "abc.xyz.incapdns.net" for blog.example.com.


I have no knowledge of DNS and zone files - how can I set a cname for the sub-domain without messing everthing up?


The zone file for the SUBdomain blog.example.com includes the following A record: "blog.example.com. 11111 IN A 12.34.56.78". Can I just change A record to a CNAME: "blog.example.com. 11111 IN CNAME abc.xyz.incapdns.net" ?


If so, what would the impact be on other zone records for the sub-domain? e.g.
cpanel, whm, ftp etc (zone file currently has A records pointing to IPs); mail (CNAME blog.example.com.)
and MX record (0 blog.example.com.)​

Are their other alternatives? e.g is it possible to merge the sub & domain zone files and would the same problems apply to the other subdomain services such as cpanel, whm and ftp.


Any advice appreciated

Wrigs
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Hello :)

You can terminate the secondary account for the subdomain, and then add the custom subdomain entry as a CNAME in the DNS Zone for the primary domain name. Remember to use a trailing period (.) at the end of the CNAME entry.

Thank you.
 

wrigs1

Registered
Jul 3, 2013
2
0
1
cPanel Access Level
Website Owner
Hi Michael, thanks for the response suggesting Terminating Account and adding CNAME to the primary domain DNS zone.

Doesn't that mean all my subdomains files will be deleted from the server, and I will just end up with a CNAME pointing to a non-existent blog?

The subdomain and files still has to be locatable on my server for Incapsula Content Delivery Network to retrieve as required, and to enable me to create new posts, do changes and edits.

This is my simplistic (and possibly wrong) undertstanding of set up with Incapsula:

  1. notify Incapsula of (sub)domain. (Done)
  2. Incapsula interogates DNS data for (sub)domain and updates its record (abc.xyz.incapdns.net) so it can directly locate it on my server. (DONE)
  3. Incapsula informs me: "blog.example.com Currently: 12.34.56.78 Change to CNAME: abc.xyz.incapdns.net" (Done)
  4. I create the CNAME record and everything works. (hence my question here; so I don't end up destroying blog or losing subdomain in no man's land)


WHM documentation states "Terminating an account cannot be undone! When you terminate the account, its data is permanently deleted from the server." . I took this to mean all my files will be deleted; and I will end up with nothing???

If I have missunderstood:
then after I have terminated subdomain and added a CNAME for it to the primary domain zone file then how do a get access to the various "services" for the subdomain mentioned in the first post e.g. FTP, Cpanel, Mail etc? The subdomains filestore , MYSQL etc are not visible using CPANEL for the primary domain.

As I said, my knowledge is miniscule so hopefully my concerns about the suggestion incorrect and down to a lack of knowledge.

wrigs
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Yes, you should not terminate the account if you need it's content and still plan to use it to serve/access data. The issue with keeping the subdomain as it's own account is that creating a CNAME record for the name of the DNS Zone is not supported. One alternative would be to update the "CNAME" record for "www" and redirect all "non-www" requests to the "www" prefix.

Thank you.
 

wrigs1

Registered
Jul 3, 2013
2
0
1
cPanel Access Level
Website Owner
Yes, as I originally said I want to use a CDN, not move to a new host/server. Unfortunately sub-subdomaining with "www" wont be practicable.

So it looks like there are no short cuts; and if I want to cname the subdomain, I will have to copy all files DB data etc, delete the subdomain account using WHM, "re-add"" the subdomain using cpanel for the domain, and re-up everything.

HoHum. Thanks for the info anyway