How To Easily Setup Cloudflare CDN For Your Website?

set up cloudflare cdn for your website

If you have stumbled upon this article then I am pretty much sure that like everybody else you are also having a slow website that is simply killing your site’s reputation and looking for various opportunities to improve the performance of your website.

You might have read several techniques for improving your website speed and have implemented them as well. But when it comes to Cloudflare you were skeptical to take a lead as it involves changing your site’s DNS, and there are a lot of other settings that need to be taken care of.

You want to give it a try but want to have an expert opinion or guidance to perform that step. Everybody wants to play safe especially when it is related to the website. Nobody wants their site to break or become unavailable due to the recent changes that were being done.

Well, coming to set up Cloudflare cdn for your website, does require some technical know-how. But before actually speeding up things and trying to improve the performance of the website, it is highly recommended to understand what is CDN and why your website needs a cdn.

Before any further ado, let’s get started.

What is a CDN?

CDN stands for Content Delivery Network and in the layman language, it is a group of computers or servers that are distributed geographically and work together to provide fast delivery of web content to their users.

CDN utilizes what is known as caching; a process that stores copies of website contents in a cache or a temporary location so that they can be served quickly to its users.

Let’s understand this in a different way, so every time you hit a URL in your favorite browser, it downloads a ton of data in the background so that it can be displayed properly to you on a screen. You might have noticed that if you open the same website a second time it opens up immediately but initially, it took a little bit of time to open it up.

Ever wondered why? It is because the moment you have opened the website, the browser has stored all the downloaded content in a cache and that is why when you hit up that URL again it opens up pretty fast.

CDN basically does the same. It caches your website contents like images, videos, webpages in proxy servers, and because these severs are spread geographically a user who is making a request is served content more quickly.

In an earlier post, I have talked about CDN more briefly, you might want to give it a read.

Why Your Website Needs a CDN?

If you have just started with your blog, you won’t feel a need for a CDN as your site won’t have any content or other files. But as you continue writing articles and start storing more and more files, your site tends to get heavy and slow. And this is exactly the situation why your website needs a CDN.

CDN improves the website speed and overall performance of your website. It reduces latency to a great extent and because of that, your viewers will be able to view your content quickly. CDNs take away a great amount of load from your server as the contents are being served from proxy servers.

With all that being said let’s have a look at one of the CDNs available in the market: Cloudflare and how we can leverage the free version of Cloudflare to improve our website performance.

How to set up Cloudflare CDN?

In order to set up Cloudflare CDN for your website, it requires a couple of steps that need to be performed. Let’s have a look at those.

1. Register for a free Cloudflare account

Navigate to Cloudflare and sign up.

Next, enter the domain name of the website you want to use Cloudflare with. And click on Add site.

setup Cloudflare cdn

On the screen, you will be prompted to choose the plan. For now, you can use the Free plan as this will be enough, to begin with. Once done click on the Continue button.

Free Cloudflare CDN
Free Cloudflare CDN Plan

2. Review your DNS records

Once everything is done, Cloudflare will scan DNS records for your site.

By default, Cloudflare should have scanned each DNS record on the initial scan, But if you think some records are missing then you can add them here. But, if you’re not sure how to add them, don’t worry we can add them later as well. Make sure the orange cloud is visible next to your domain name. That means Cloudflare is enabled for your site.

Setup Cloudflare DNS

Finally, click the Continue button.

3. Replace Cloudflare nameservers with existing ones

Now on the next screen, Cloudflare provides you with a new set of nameservers that need to be replaced with your existing ones. We’ll see next how to do that.

set up Cloudflare cdn for your website

Now if you’re confused with what nameservers are? It is basically a server that translates a domain name to IP address. Nameservers are an integral part of the Domain name System (DNS) or you can rather call it a “phone book” of the Internet. When you hit a URL in your browser, it automatically looks up the IP address associated with the server and connects to the URL.

After connecting your website to Cloudflare, it will be able to direct filtered traffic to your website. Filtered traffic in a sense that:

  • Malicious threat actors constantly try to hack into networks by exploiting vulnerabilities or sending out malicious traffic. Cloudflare protects from such cyber threats and keeps your website secure by filtering out malicious traffic from the regular one.
  • Cloudflare also provides DDoS protection and Firewall-as-a-service that identifies malicious traffic patterns, vulnerability exploits and keeps your web-facing applications safe from attack.

Now in order to change your nameserver, you have to know where you purchased your domain from. As changing of the nameservers varies from different hosting providers, you have to be sure where your domain name is registered.

In our case, it was registered in NameCheap. So, let’s see how we can go ahead and change the nameservers in our domain registrar.

Navigate to Namecheap and login

Click on Manage next to your domain

Select Custom DNS under Nameservers

Replace existing nameservers with the ones provided by Cloudflare.

Finally, click on the right tick mark and you’re done.

NameCheap DNS

Once you have replaced them with Cloudflare nameservers, it will take around 12-24 hours for propagation. Alternatively, you can check whether the DNS have been propagated or not to Cloudflare.


That’s it. If the DNS checker shows the Cloudflare nameservers, then that means it has been successfully propagated.


Setting up a Cloudflare CDN for your website isn’t difficult as it seems. It just needs nameservers to be replaced with your existing ones. The whole completion of the process will take around 12-24 hours.

Hope you like our guide and if you have any issues in setting up Cloudflare CDN for your website then do let us know in the comment down below.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top