Why change DNS to cloudfare
if you know that DDOS is most easy attack that deny and stop your website from working, to use DDOS attack just open a terminal using Linux or Windows command prompt find the DNS of a website and start send huge request at the same time, the server will not be able to handle so much request and that's will cause your website to be unavailable, therefore there is cloudflare and it's main job is to deny DDOS attack, so let's see how to install cloudfare for your website.
How to change DNS to cloudfare
To change your domain DNS to cloudflare and protect your website from ddos attack, first step you have to create cloudflare account, next add your website to cloudfare, then update your domain DNS name servers to the DNS you will get from cloudflare, let's see that step by step .
How to add new website to cloudfare
In cloudflare Home page click Add a Site a window will show up just add your website example.com and click again Add a Site, next step cloudflare will query your domain and find your DNS records, so before you change your DNS to cloudflare your domain DNS zone must be configured, if you have subdomain or redirection, you must configure it before configure cloudfare because here in this step cloudfare will query all your domain DNS records and import them to cloudfare.
Cloudfare create free plan
Select your preferred plan, there it is free plan and 3 payed plan, in my case i will choose free plan with Global CDN Unmetered, Mitigation of DDoS attacks, Free shared SSL certificate, and click Confirm Plan, a confirmation contract will show up just click Confirm again, and next you will be at DNS query results for your domain in this step cloudfare will show you what it find after scan your DNS records.
Get cloudfare DNS name server records
After cloudfare query and show you the DNS import result. click Continue, in this step cloudfare will give you two DNS record in this example i got candy.ns.cloudflare.com darwin.ns.cloudflare.com, you must change your domain DNS server name in your domain panel to the cloudfare DNS.
Change your DNS name server to cloudfare
To change your DNS to cloudfare log into your domain panel find and navigate DNS servers and change the default DNS to cloudfare DNS, the change will take a time between 5 min and hour depending your hosting server provider. Notice: your domain must successfully changed before you redirect to cloudfare.
Cloudfare Recheck name servers
After your DNS changed, now go back to cloudfare and click on Recheck Nameservers, in this step your domain DNS record changed to cloudfare and your website will turned from pending to active.