Table of Contents
What is Cloudflare?
Cloudflare is a Content Delivery Network (CDN) that acts as a safety net between the server and a user. When you add CloudFlare to a website, it will act as a proxy, and other users can not directly see or reach your server and it’s IP address. With that, it protects your server from DDoS attacks and some other types of attacks on a server.
How can I add Cloudflare to my Website?
To add Cloudflare to your website,
1. First, you will need to create a free account with them.
2. After you create an account, log in and click on the “Add Site” button and add the site URL.
3.On the next page, you have to add your type your website URL. Type your domain name.
4. You will get the option to select your package. If you want to use their free package, then click on it and “Continue”.
5. A new popup window will appear confirming your selected package. On the next page, you will see the detected DNS records for your website. Most of the time, all your existing DNS records at your hosting will show here and nothing needs to be done. But sometimes the records don’t show up here and you will need to set the necessary records manually in their respective fields. Then click on the Continue button from the bottom of the page.
6. On the next step, you will see the new nameservers provided for your domain by Cloudflare. Set these nameservers to your domain and then click on the “Done and check nameservers” button on Cloudflare.
On the next page, you will get more configuration options. Click the Get started button to configure. If you want to configure it later click the Finish later button.
That’s it! Now with the DNS propagation time of 24 hours, your website will be connected to Cloudflare.
Add Cloudflare directly from cPanel:
As we have CloudFlare service integrated with our cPanel account, you can set up Cloudflare easily for your website directly from cPanel.
- To do that, log in to your cPanel account and click on the Cloudflare icon from the software section.
- Here you can either create a new Cloudflare account or log in to your existing account.
- Once you are logged in, you will see your domain listed on the page. Then click on either the “Provision Domain with CNAME Setup” or “Provision Domain with Full Zone Setup” option and your service will be automatically connected with Cloudflare.
- If you have selected the option “Provision Domain with CNAME Setup” then you will not need to do anything else. But if you have selected the option “Provision Domain with Full Zone Setup” then Cloudflare will provide you with 2 nameservers and you need to set those to the nameserver for your domain.
So, if for some reason, you do not want to set up automatically with CNAME Setup, then you can go for the Full Zone Setup option.
Those are the two ways you can add Cloudflare to your hosting service.
How to add a new DNS record for my domain on Cloudflare?
You can add any type of DNS records on the Cloudflare website, here, we will demonstrate how to add an “A” record that points to an IP address.
- Log in to your Cloudflare account.
- Click on the domain name that you want to work with.
- Click on the “DNS” option from the top section
- Click on the “Add Record” button
- For this example, let us assume you want to add “mydomain.example.com” to a specific IP address. So, the settings will be as follows:
- Type: A
- Name: mydomain
- IPv4 Address: The IP address where you want to point this record
- TTL: How much time you want the DNS record to be kept on the cache. Leave it as it is (Default)
- Click on the Save button and that’s it!
After you add the DNS record and it is propagated, your domain will be pointed to the specified IP.
How to modify or delete DNS records in Cloudflare?
Cloudflare’s DNS Record or IP may need to be modified or deleted due to a change in your hosting provider or any other reason. Please follow these steps to modify or delete DNS records in your Cloudflare:
- First login to your Cloudflare Dashboard.
- Select that domain which records you want to Modify or Delete. You may also get your domain by searching in the search option there.
- Now click on the DNS Icon from the icons shown above.
- Identify the record you want to modify and click the “Edit” button next to it.
- Here, add the value you want to modify and click the “Save” button or click on the “Delete” button to delete records. A confirmation dialog box will appear, click on the “Delete” button again to confirm the deletion.
To follow the above steps you can easily modify or delete DNS records from Cloudflare.