☁️
How-To Guides

Cloudflare DNS Setup Guide: From Zero to Protected

📅 Mar 8, 20269 min read✍️ Hostao LLC

Cloudflare is one of the most popular DNS providers, offering a free plan with enterprise-grade performance. This guide walks you through setting up Cloudflare DNS for your domain from scratch.

Why Use Cloudflare DNS?

  • Speed — Cloudflare operates one of the fastest DNS networks globally with a 1.1.1.1 resolver and anycast routing.
  • Free plan available — Basic DNS hosting, DDoS protection, and SSL are free.
  • DDoS protection — Automatic protection against DNS-based attacks.
  • Easy management — Clean UI for managing DNS records.
  • Additional features — CDN, SSL/TLS, page rules, and more.

Step 1: Create a Cloudflare Account

Sign up at cloudflare.com. The free plan is sufficient for most websites.

Step 2: Add Your Domain

  1. Click Add a Site in the Cloudflare dashboard.
  2. Enter your domain name (e.g., example.com) and click Add Site.
  3. Select the Free plan (or a paid plan if you need advanced features).
  4. Cloudflare will scan your existing DNS records automatically.

Step 3: Review DNS Records

Cloudflare imports your existing DNS records, but always verify:

  • Check that all A, AAAA, CNAME, MX, and TXT records are present.
  • Pay special attention to MX records (email) and TXT records (SPF, DKIM, DMARC).
  • Add any missing records manually.

Step 4: Understanding the Proxy Toggle

Each record has an orange cloud (proxied) or gray cloud (DNS only) toggle:

  • Orange cloud (Proxied) — Traffic routes through Cloudflare's CDN and security features. Use for web traffic (A and CNAME records for your website).
  • Gray cloud (DNS Only) — Cloudflare only provides DNS resolution. Use for MX records, mail subdomains, FTP, and any service that shouldn't be proxied.

Important: Never proxy MX records or mail-related subdomains. This will break email delivery.

Step 5: Update Your Nameservers

Cloudflare will give you two nameserver addresses like:

ada.ns.cloudflare.com
bob.ns.cloudflare.com

Go to your domain registrar and replace the existing nameservers with these Cloudflare nameservers. The process varies by registrar — see our guide on How to Change Nameservers for specific instructions.

Step 6: Wait and Verify

Nameserver changes can take up to 24 hours. Cloudflare will send you an email once your site is active. You can also check the status in your Cloudflare dashboard.

Step 7: Configure SSL/TLS

Once active, go to SSL/TLS settings and set the encryption mode:

  • Full (Strict) — Recommended if your origin server has a valid SSL certificate.
  • Full — If your origin has a self-signed certificate.
  • Flexible — Only if your origin doesn't support HTTPS at all (not recommended for production).

Post-Setup Checklist

  • Verify your website loads correctly
  • Test email sending and receiving
  • Enable "Always Use HTTPS" under SSL/TLS settings
  • Set up page rules if needed
  • Review security settings and firewall rules

Cloudflare's DNS is a powerful free tool that improves your domain's speed and security. The setup takes about 15 minutes, and the benefits are immediate.

Share this article

Related Posts