Skip to content

Instantly share code, notes, and snippets.

@padmick
Created February 17, 2020 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save padmick/bd1db2e1e8b39e6f641b97f432d97720 to your computer and use it in GitHub Desktop.
Save padmick/bd1db2e1e8b39e6f641b97f432d97720 to your computer and use it in GitHub Desktop.

DDoS protection starts with DNS protection and works as follows:

  • Requests to your domain name do not come to your server, but to intermediate Cloudflare servers
  • Cloudflare checks the source of the request and, if an attack is detected, the request blocked
  • If the request is secure, it is passed to your server for processing.

Cloudflare has a lot of servers distributed throughout the world. They take the brunt of DDoS attacks, leaving your server safe. In addition to that:

  • Hide the real IP of your server
  • Cache static content (pictures) of your website on their servers to provide quick access to it (CDN).

Domain Setting

Register on cloudflare.com and click the Add a Site button:

Next, enter the name of our domain and click Add Site:

Click Next, select a free plan and click Confirm Plan:

After that, we can immediately specify the IP address or host of our server. Click Continue:

Now the most difficult 🙂 — we need to specify the Cloudflare DNS server in the settings of our domain registrar page (where you bought the domain). I have GoDaddy and it looks like this:

After you have updated the DNS server settings on the registrar page, click Continue on the Cloudflare page:

Updating DNS settings can take from 10 minutes to 1 hour. Then you will see this screen:

This means that now Cloudflare manage your domain. You can:

  • Enter IP address of your server
  • Create subdomains
  • Add SSL certificate for your site
  • View statistics for your site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment