Cloudflare provides DDoS mitigation, Internet security services in between website visitors and the server on which content is being hosted. At the moment Cloudflare is one of the most popular free CDN service providers. 1. Registration.
To use the services, registration has to be done on the Cloudflare system. This can be done via the following link:https://dash.cloudflare.com/sign-up
Enter your domain that you want to protect into "Add your site" field and press the "Add site" button:
Select a Suitable Cloudflare service plan (Free is also suitable). Proceed with the current DNS record scan, by pressing the "Continue" button.
2. DNS change
Set the nameservers that you will receive. In this example, it was dane.ns.cloudflare.com and tegan.ns.cloudflare.com. However, it is very likely that for your domain it will be different. This change has to be done from your domain registry (company on which you have registered your domain). Usage of both Nameservers is mandatory. The change will be fully saved after TTL of the DNS servers will pass.
After the change, you will have to wait until it will be completed.
Cloudflare system will automatically refresh the information of changes.
Manual check initiation is also possible by pressing the "Re-check now" button. If you have closed domain management panel it can
be re-opened again by selection "Overview" menu option and choose the
3. Change of attacked IP address.
When Cloudflare will be in use, it should have the records that are set on your current DNS servers. If adjustments for the records will be needed, you can do it now, or wait until further steps, because adjustments will be needed in the end anyway:https://support.cloudflare.com/hc/en-us/articles/360019093151-Managing-DNS-records-in-Cloudflare
Check if the domain is fully protected by the Cloudflare service. If protection is active - the "Overview" section should show the following message:
When the Cloudflare protection will be active, as seen in the image above, that will hide your server IP when checking the domain, under
Cloudflare reverse proxy.FROM THIS STEP DO NOT TURN OFF THE CLOUDFLARE PROTECTION THAT HIDES THE IP ADDRESS.
The protection is required because the old IP that was attacked before at this moment is still related to your server. To solve this, you should order an additional IP
address for your VPS.
After you will make the payment for the IP address order, you have to open a ticket from your client area with the request of changing the old IP address with the newly ordered. This is required that old IP, that is under attack, would no longer point harmful traffic to your server.4. Final changes for domain DNS zone records.
After the old IP will be replaced, we will inform you via the ticket system. Now you should change the domain DNS zone records in the Cloudflare system. When changing instead of the old IP address, you should set the new one. The change can be done using the previously provided DNS change guide.