On the modern web these days, I can say for sure that there is no free tool that is as useful or powerful as Cloudflare. It is truly the swiss army knife of the internet. Cloudflare is a service that can add many things to your site, including protecting it from Distributed Denial of Service (DDOS), in which thousands or perhaps millions of fake hits are directed at your site to exhaust its resources and made your website perform very slow or go down entirely.
But What is It?
Well, Cloudflare is many things. DDOS protection, as I’ve mentioned is one of the features that it offers, but there’s much more. As a DNS Provider, Cloudflare has been regarded as one of the fastest in the world, and through its many Point of Presence (POPs) around the world, it will accelerate your DNS queries multiple times.
It will also cache your site and act as a Content Delivery Network. Not only that, it can also minify or make the files of your website smaller in order to accelerate it even further. And there’s still many many more.
Do I Have to Pay?
Cloudflare, and all of the features I mentioned above is absolutely free. You can pay for more advanced features, but really, for the typical website, the free features of Cloudflare is already good enough.
How Can I Use It?
Well, first of all, you’d need a Cloudflare account. Go to their official website and sign up.
Now, there are 2 ways you can go with Cloudflare.
Option 1: Through Cloudflare
The first option is to offload all the DNS stuff to Cloudflare and bypass your hosting provider entirely. This way, the original server IP will be hidden and when someone tries to find out where do you really host your site, they can only see Cloudflare IP. This is a good advantage to have if your site is prone to DDOS attacks, since the attacker can only see your website URL that is protected by Cloudflare, and not the original server IP.
What you will need to do if you decide to go with this option is go to the Cloudflare Site, sign up, and after completing the sign-up, add your site to Cloudflare. Cloudflare will guide you throughout the process, and gives you two nameservers to configure on your domain registrar. Then, you will need to configure your DNS records
Then, you will need to configure your DNS records. Cloudflare can and will scan the original DNS records attached to your previous nameservers, but if you’re not sure, what you will need is 3 things:
- The IP Address of the server where your site is hosted on
- The MX Records, or Mail Exchanger Records where your mail is hosted
- List of subdomains
Remember that A record is the primary DNS record that lets the world (or in this case, Cloudflare) knows where they should locate your website files. A Records are IP Address, so it’s a series of numbers, for example: 188.8.131.52. You need to have at least 1 A records with the naked domain (example.com, for example, without the www) as the zone name. Remember to make sure that Cloudflare is enabled (the cloud symbol is showing colour instead of greyscale) for this zone. And if you are using www, remember to create an A records for www.example.com and point it to the IP address as well.
MX records are typically fully qualified domain name (FQDN) with its own associated A records. So if previously your MX is set to mail.example.com for example, you need to add an A records for mail.example.com and add your original server IP Address as the destination. Then add mail.example.com as your MX record in cloudflare.
If you originally have subdomains in your hosting provider (subdomains are for example test.example.com), you need to create A records for each of them, by following the example i cited above.
After that, go ahead, and change the nameservers of your domain to the ones that Cloudflare gave you. After DNS propagation is complete, your IP should be hidden and your site is now protected by Cloudflare.
Option 2: Through your Hosting Provider
Many hosting providers these days integrate Cloudflare with their cPanel. Here, for example is HostPapa control panel:
As you can see, you can just click the Cloudflare Icon, and it will take you to a login page. Login with your Cloudflare account details, and you’ll be able to skip all the setup on the cloudflare side, and control it from inside your control panel.
You Might Also Like:
- What is DNS Propagation? Why Should I Wait After Making a DNS Change?
- My Emails Landed in The Junk Folder, What Should I Do???
- ELI5: What is a CDN, and How Can it Help Me?
- Sending Mass Email: Why You Need to Use a Transactional Mail Provider
- What Is Mod_Security? And Why Am I Blocked By It?