This question already has an answer here:

I'm reading through this guide which is quite thorough and helpful, but I've come across one paragraph that's stumping me.

For your root domain, you'll change its A record to point to one of the CDN's IP ranges. For each subdomain, modify its CNAME record to point to a CDN-provided subdomain address (e.g., ns1.cdn.com). In both cases, this results in the DNS routing all visitors to your CDN instead of being directed to your original server. - See more at: https://www.incapsula.com/cdn-guide/what-is-cdn-how-it-works.html#sthash.f0v6pdOz.dpuf

  1. The fact that you handle subdomains differently from root domains seems strange to me. Why am I using CNAME for subdomains, and A for root domain?
  2. Why am I using A or CNAME records at all? Shouldn't I just be changing the nameservers in my domain control panel to those of the CDN?

marked as duplicate by Jenny D, Ward, mdpc, quadruplebucky, MadHatter Jun 14 '17 at 20:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • The CDN handles web traffic, not nameserver traffic. – Jenny D Jun 6 '17 at 15:03
  1. You could use A records for them all, but you should use CNAME only on subdomains. That's because when you have a CNAME record, you can't have ANY other type of records on the same hostname. The root of your domain usually needs to have MX and TXT records for mail, not to even mention the NS records for the name servers, etc. (See RFC 1912, 2.4.)

  2. You can't just point your NS to the CDN's name servers, because they don't have your domain configured there. In order to make this work they should have their name servers configured as authoritative name servers for your domain.

  • 2
    CloudFlare prefers that you point you DNS domain at them directly, which lets them do DNS tricks such as return a dynamic result for the apex-record. This gets around the inability to CNAME a apex. I'm surprised to see a CDN guide say to A-record the apex to a CDN IP; those IPs are often considered dynamic so a direct mapping like that is risky. – Jason Martin Jun 6 '17 at 14:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.