How to use CloudFlare for free DNS, free CDN and free DDoS protection

CloudFlare is the world’s largest CDN provider (referred to as CF below). Its free plan offers unlimited free CDN, plus powerful, fast DNS resolution

CloudFlare is the world's largest CDN provider (referred to as CF below). Its free-plan account comes with unlimited free CDN, plus powerful and fast DNS resolution!

In most cases, webmasters only need the free plan to add unlimited domains, resolve domains without limit, and use CF's free CDN without limit.

1. Register an account

Open https://www.cloudflare.com/. On the desktop page you can switch the language in the top-right corner. Click to register; you'll need to verify your email, so use a mailbox that can receive mail.

2. Add a domain

After logging in, click "Add domain" in the top-right corner. In most cases you should turn off the proxy and set it to DNS only.

Toggle proxy status:

You can adjust the proxy toggle when creating a new record or editing an existing one;

Next, choose Free, ¥0/month.

CF will then assign 2 NS servers to your domain.

3. Change your domain's DNS servers to the two CF assigned

Open "My domains" --> select the domain --> change its DNS:

Change the domain's DNS servers to the two CF assigned and save.

If there is a third entry, submit DNS servers 1 and 2, then clear the content of the 3rd DNS server and save.

For overseas access, DNS usually takes 15–30 minutes to take effect.

In China, some regions/community networks have their own cache, which can make the update time close to a day.

4. Notes on using CF proxy when enabled

Generally, free proxy IPs are all in the US, so loading in China is slower; the paid plan also has no mainland-China or Hong Kong IPs.

If you want faster loading for users in China, turn off the proxy;

If a domain was previously blocked and you need a proxy/acceleration service to reach it again, turn off the CF proxy;

5. Why we recommend CF

CF offers free, efficient CDN and cache settings (which can effectively save server traffic), a full-featured firewall for blocking, a full-featured free DNS service with latency as low as 1 minute, free email forwarding, and free SSL certificates. In most cases, the free plan is enough.

If you want to use the following CF features, they only take effect for domains with the CF proxy enabled; domains whose DNS does not have the CF proxy enabled will not have these settings apply.

For example:

SSL/TLS --> enable HTTPS or force HTTPS

Rules --> Page Rules (domain forwarding, caching)

Security --> firewall rules and other protection rules, which can block access from certain regions/IPs

6. Other tips

  • If possible, we suggest registering a separate CF account for each domain, e.g. a.com uses one email and b.com uses another. Each domain then gets independent DNS and CDN IPs, which helps avoid one domain being blocked or false-blocked from affecting others. (Tested: since 2023, multiple domains under one account using the same DNS are also assigned different IPs.)
  • If you have many domains, you can prepare a business mailbox @your-domain.com and use [CloudFlare.com - select an added site your-domain.com - Email, enable "forward all mail to one of your mailboxes"], which indirectly forwards all your domain's mail to your mailbox;
  • Gmail supports adding a dot "." anywhere in the mailbox name, e.g. the same address with dots in different positions all receive and send mail normally.

End.