How to add Cloudflare to VPS/ Dedicated / Shared hosting servers?

- Advertisment -
- Advertisement -

The shared server hosting scenario is different than the VPS or dedicated server. It is because on the VPS you need to manage most of the things by your self, like setting up of server OS and Cpanel or web control panel to manage the hosting space and web services.

Assuming that you already have set up the server and web project on your VPS server and now to add an extra layer of security you want to route your traffic through the Cloudflare firewall to save your server from DDOS attacks.

Here is the tutorial to set up / enable Cloudflare for the VPS servers, although the steps are the same for Sharing hosting servers too. 

  1. First of go to and create an account. (note: If you already have added your website to Cloudflare the move to step )
  2. Click on Add site button.
  3. Type the website domain name you want to add to CloudFlare.Add your site
  4. Click on Add site button.
  5. Select the Free Plan. In case you want some better security feature you can opt for paid plans.
  6. Click on Next and Copy the Cloudflare name server and paste it on NotePad. Becuase we need to update our domain naming server with the Cloudflare’s.Change your nameserver
  7. For this either you can go for the next step to get an idea how to update naming servers or just click on “I need help changing my nameservers” given just below the Cloudflare Nameservers web page. A drop-down box will appear with different Domain registrars such as Godaddy, NameCheap, Enom, Network solutions and other. Select your registrar, if its name is not in the list then choose the Other. And you will get a tutorial on how to update nameserverscloudflare naming server add tutorials
  8. Here we will show how to update naming servers on Godaddy, the process is almost same for other Domain registrars too.
    • Step 1: Login to your GoDaddy dashboard and go to My Product Section where all your purchased product including domain and hosting servers will show.
    • Step 2: Go to the domain name you want to use with Cloudflare and just front of it click on the DNS option.Godaddy domain name servers update
    • Step 3: In “DNS Management”, scroll down to find the “Nameservers” card. Click “Change“.Nameservers
    • Step 4: Under “Choose your new nameserver type“, select the “Custom” option.update nameservers
    • Step 5: Enter your name servers into the “Nameserver” from fields and click on “Save” to confirm these settings.Finally added cloudflare namer servers to godaddy
  9. Once the naming server updated you can go back to the Cloudflare and click on Continue button or Recheck Nameserver. After the domain added to Cloudflare, you will see the ACTIVE status there.

How to add website domain record in Cloudflare DNS

If you already have an active website domain in Cloudflare and now incase are moving from shared hosting to VPS or dedicating hosting then you only need to replace the previous hosting IP address present in the CloudFlare records with your VPS server static IP address that’s it… However, if you are doing it from scratch then follow the below steps.

Note: If you are adding your domain first time then most of the time it automatically fetch them for you. If not then the steps are below to follow.

Step 1: Go to CloudFlare’s DNS option and click on it.

Cloudflare DNS

Step 2: Now set the ‘A‘ record. In the first box select the A, in the second enter your domain name (For example here we use the and after that enter the IP address of your hosting server. Leave the last one Automatic TTL as it is. And click on Add record.

Manage your Domain Name System (DNS) settings

Step 3: Now set the CNAME record.  In case you are not using the naked domain and want to use the ‘www‘ with it then this record needs to be set up. In the first box select the CNAME, in the second www and third will hold your domain name as shown in the screenshot. After that click on the Add Record.

If you want to add a subdomain to CloudFlare then again add the CNAME record but this time instead of using www add your subdomain name. For example, is a subdomain and I want to add it in Cloud flare then instead of using www, I will use the forum which is the first initial of this subdomain and rest of will be same as it is.

Cname acloudflare

That’s it, the Cloudflare has been set up successfully for your domain bound to your VPS/Dedicated/shared server. If you have any doubt, the comment box is all yours!!

You might also like to know about:


Rajkumar Maurya
Rajkumar Maurya is the H2S Media tech expert. He’s always been passionate about technology and has been writing on the subject since 2014. He has extensive knowledge of all kinds of technology, from consumer-tech to enterprise solutions. You can contact the author at--


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Posts

Future of the Gaming Industry in India 2020

With the population of 1.3billions, India automatically becomes the biggest market for any industry if even...

How to install IIS web server on Windows 10 Step by Step

IIS (internet information services manager) on Windows 10/7 Desktop or server is basically a flexible and secure Web server...

How to assign labels to emails on Google Mail or Gmail to organize emails

We get hundreds of emails every single day, and among all that we get, only a handful of them,...

Top 10 myths related to technology that you should stop believing

Today, when we talk about tech, the 90’s kids and the Millenials mostly refer to the latest smartphones, LED...
- Advertisement -

CloudWalker offers deep discounts on its 4K LED TV and BURST soundbar

Press release: The tech company CloudWalker creating digital products for smart entertainment on the big screen has announced a...

Kodak TV at Rs.4,999 only on Amazon Great Indian sale

Press release: Kodak HD LED TV has partnered with the e-commerce platform, Amazon, for ‘Great Indian Sale’ which begins on 19th January and...

- Advertisment -
- Advertisement -

You might also likeRELATED
Recommended to you