Connecting to Cloudflare CDN and DNS settings

I have 3 questions about connecting to Cloudflare CDN.

  1. Before connecting to Cloudflare, the DNS settings of my domain is pointed to my Cloudfways’ Server IP. When I connect to Cloudflare’s CDN, they ask me to go to my registrar (namecheap) to remove the existing DNS (dns1.registrar-servers.com, dns2.registrar-servers.com) and point to Cloudflare’s DNS. But, my namecheap’s existing DNS setting is namecheap’s default DNS, instead of the two suggested. Should I still change it to Custom / Cloudflare’s DNS?

  2. If I change the DNS settings to Custom / Cloudflare, it will no longer point to my Cloudway’s server IP… would my site still be using Cloudway’s hosting?

  3. And will connecting to Cloudflare CDN slow down my site’s loading speed because the traffic has to go through cloudflare first?

  1. Before connecting to Cloudflare, the DNS settings of my domain is pointed to my Cloudfways’ Server IP. When I connect to Cloudflare’s CDN, they ask me to go to my registrar (namecheap) to remove the existing DNS (dns1.registrar-servers.com, dns2.registrar-servers.com) and point to Cloudflare’s DNS. But, my namecheap’s existing DNS setting is namecheap’s default DNS, instead of the two suggested. Should I still change it to Custom / Cloudflare’s DNS?

Namecheap is currently acting as your domain registrar and they are handling your nameservers. By changing the nameservers you move the responsibility of handling the nameservers to CloudFlare, but you will still pay for your domain registration through NameCheap. All DNS changes will then be made through your CloudFlare account. This is the way CloudFlare works, and there is nothing wrong with delegating the nameservers out to CloudFlare this way.

  1. If I change the DNS settings to Custom / Cloudflare, it will no longer point to my Cloudway’s server IP… would my site still be using Cloudway’s hosting?

You’re not changing the IP address to point to CloudFlare, you’re only changing the nameservers. In CloudFlare you will still be able to choose where the IP address is pointed, and you’ll want to make sure that it still pointed at Cloudways. This is something that should happen by default as CloudFlare copies over all of your DNS settings when you set it up.

  1. And will connecting to Cloudflare CDN slow down my site’s loading speed because the traffic has to go through CloudFlare first?

Yes. Because all traffic has to go through CloudFlare first it does theoretically slow things down. The advantage that CloudFlare’s approach of proxying everything through them brings is that they can perform security and performance optimizations as the request passes through them. However, if you’re just using CloudFlare’s free plan there isn’t anything they offer that you couldn’t do with WordPress plugins such as Breeze. For this reason I don’t use CloudFlare as a CDN, and will instead use the one provided by Cloudways which is run by StackPath who is one of the biggest CDNs out there. However, in performance tests that I’ve run, the difference between CloudFlare and Cloudway’s CDN has never been big enough for me to accurately measure, so it’s more of a theoretical difference that doesn’t really matter that much.

1 Like

Another wonderfully informative reply, Russell! Thank you! I got better support from you than cloudways’ :smile:

By the way, I would like to try your suggestion of using StackPath CDN instead of the free Cloudflare CDN. But, I enabled Edge Certificates and HSTS under SSL/TLS settings at Cloudflare. I did that because a test at webpagetest . org said my site has a “high severity issue” regarding “strict transport policy”:

“a HSTS Policy informing the HTTP client how long to cache the HTTPS only poliy and whether this aplies to subdomains”

Anyway,

  1. after enabling this, my security score went from “F” to “D”. Do you think what I did was good to my site?

  2. Also, how can I do the same thing if I leave Cloudflare and use StackPath CDN?