People have been asking me what an easy way to secure their website from a networking standpoint. Now for beginners, there are a lot of things that can come into play. I mean we have firewalls, load balancers, the actual server ports themselves and a lot of different variables that can come into play. For simplicity, I am starting from something that can help and that is CloudFlare. CloudFlare is by no means a 100% secure way, but it can help with certain security features such DDOS attacks which are most common. Other features include WAF (Web Application Firewall) and SSL so like I mentioned before these are pretty high-level areas but these are some good things to put in place. With that being said you can do all of these without CloudFlare, it just makes it easier. So I have
There are two ways to enable CloudFlare for your domain name:
1. By means of a CNAME record for www.domain.com (that is created automatically once you have clicked on the grey cloud next to your domain name).
2. By pointing a domain name to CloudFlare nameservers which is possible after signing up with CloudFlare in cPanel too, but additional steps below should be performed in order to make your domain work properly.
Once you have signed up, you will receive an email from CloudFlare with a password setup link. Click on it and you will be redirected to a menu with an option to set up the password for the CloudFlare account. Once done, you will be able to log in.
On the very first page after logging in you will need to enter the domain name you’d like to enable CloudFlare for and click on Scan DNS records:
After the scan is over, click Continue:
On the next page you will need to double-check if the DNS records match the ones in your cPanel and click Continue.
NOTE: It is not recommended to modify DNS records at this stage as you will be able to do this after the setup is complete.
Choose the desired service plan and click Continue:
NOTE: After signing up with CloudFlare in cPanel you will get a free plan. However, you can choose one of the paid CloudFlare plans if you wish to get more features. You can compare these plans here.
On the next page, you will be offered to change nameservers to the CloudFlare ones:
If your domain is registered with another domain registrar, you need to log into your account there and change the nameservers for the domain.
If your domain is registered with Namecheap, you need to follow the instructions below:
1. Log into your Domain account in my case it’s my Namecheap account in a separate tab if you are not logged in yet. Once you are in, mouse over the Account option in the upper right corner of the page and choose Domain List or choose the Domain List menu in the left sidebar:
2.Click on the Manage option in front of the domain name you wish to point to CloudFlare DNS:
3. On the Domain tab, please click the drop-down menu next to the Nameservers option and select Custom nameservers type:
4. Enter the nameservers specified in the CloudFlare account, then click Save changes:
NOTE: Once the nameservers have been set up, it may take up to 24 hours (in rare cases more) for local ISPs to update their DNS caches so that everyone can see your website. Since the caching time varies between ISPs, it takes time for DNS changes to be totally in effect.
Once the nameservers are set up, return to the CloudFlare tab and click Recheck Nameservers:
If the nameservers have been successfully updated, you will see Status: Active message. Now you may proceed with setting up DNS records in the DNS menu:
On the DNS Records page, you may add or delete the DNS records for your domain. In order to add any record, click Add Record (2) and choose the record type you need (1), the hostname (subdomains or domain itself) and value of the record. TTL will be set up automatically. Also, you may deactivate (3) or activate (4) the CloudFlare service for each record by clicking on the orange/grey cloud under the Status column:
NOTE: After the nameservers change all the DNS records for your domain in cPanel will be no longer active. That`s why make sure they have been set up in your CloudFlare account. The new DNS records should be created in the Cloudflare account as well. For instance, if you wish to switch to another mail service or update the IP address for your domain, the MX and A records should be updated correspondingly.