Cloudflare Setup Guide: Free CDN & DNS Configuration

Set up Cloudflare in under 30 minutes and get free CDN, DNS, SSL, and DDoS protection. The single biggest free performance upgrade for any website.

15 min read Updated April 2026 Names.Center Editorial Team

Cloudflare is the most impactful free tool available to website owners. It sits between your visitors and your web server, caching content on 300+ global data centers, blocking malicious traffic, providing free SSL certificates, and dramatically reducing page load times. Over 20% of all websites use Cloudflare, including major enterprises and personal blogs alike.

Setting up Cloudflare takes under 30 minutes and requires zero technical expertise. You do not need to change your hosting provider, modify your website code, or install any server software. The entire setup happens through Cloudflare's dashboard and a single nameserver change at your domain registrar. This guide walks you through every step, from account creation to advanced optimization settings that most tutorials skip.

Quick win: Cloudflare Free plan includes unlimited bandwidth CDN, DDoS protection, DNS hosting, and SSL — features that would cost $50-200/month from other providers. Pair it with quality web hosting for maximum performance.

Why Use Cloudflare

Cloudflare provides five core services on its free plan that every website benefits from:

Global CDN

Static content cached across 300+ data centers worldwide. Visitors load from the nearest server, reducing latency by 30-60%.

DDoS Protection

Absorbs DDoS attacks up to 100+ Tbps. Your server stays online even during massive attacks that would overwhelm any single server.

Free SSL/TLS

Automatic HTTPS for your entire site with zero configuration. Universal SSL certificate included free, renews automatically.

Fast DNS

Industry-leading DNS resolution speeds (sub-10ms). Anycast network ensures DNS queries are answered by the nearest data center.

Beyond these core features, Cloudflare also provides basic bot management, hotlink protection, email address obfuscation, and analytics — all free. The paid Pro plan ($20/month) adds Web Application Firewall (WAF), image optimization (Polish), mobile optimization (Mirage), and more detailed analytics.

Step-by-Step Cloudflare Setup

Step 1: Create Your Account

Visit cloudflare.com and sign up with your email. Choose the Free plan to start — you can upgrade later without any migration. Cloudflare will ask for your domain name (e.g., yourdomain.com). Enter the root domain without www or any subdomain.

Step 2: Automatic DNS Import

Cloudflare scans your existing DNS records automatically. Review the imported records carefully — it catches A records, CNAME records, MX records, and TXT records in most cases. However, verify that:

  • Your main A record points to the correct server IP
  • www CNAME exists and points to your root domain
  • MX records are present if you use email on this domain
  • Any SPF, DKIM, and DMARC TXT records are imported correctly

Add any missing records manually. This step is critical — incomplete DNS import is the #1 cause of email disruption after Cloudflare setup.

Step 3: Change Your Nameservers

Cloudflare provides two nameservers (e.g., ada.ns.cloudflare.com and bob.ns.cloudflare.com). Log into your domain registrar and replace the existing nameservers with Cloudflare's. Here is where to find the setting for popular registrars:

RegistrarPath to Nameserver Settings
NamecheapDomain List > Manage > Nameservers > Custom DNS
GoDaddyMy Products > DNS > Nameservers > Change
Google DomainsMy Domains > DNS > Custom Nameservers
PorkbunDomain Management > Authoritative Nameservers

Propagation typically completes in 5-30 minutes, though it can take up to 24 hours. Cloudflare emails you when your nameservers are active. Until then, traffic continues flowing to your server normally — there is zero downtime during migration.

Step 4: Quick Start Guide

Cloudflare shows a Quick Start setup wizard after nameserver activation. Enable these recommended settings:

  • Auto Minify: Enable for HTML, CSS, and JavaScript (reduces file sizes 10-20%)
  • Brotli compression: Enable (better compression than gzip, supported by all modern browsers)
  • Always Use HTTPS: Enable (redirects all HTTP requests to HTTPS automatically)
  • Automatic HTTPS Rewrites: Enable (fixes mixed content issues by rewriting HTTP URLs to HTTPS)

DNS Configuration Best Practices

Understanding Cloudflare's DNS proxy is essential for correct configuration. Each DNS record has a proxy toggle (orange cloud = proxied, gray cloud = DNS only).

What to Proxy (Orange Cloud)

  • A record for @ (root domain): Proxy to enable CDN, DDoS protection, and SSL
  • CNAME for www: Proxy for the same benefits on www subdomain
  • A/CNAME for any web subdomain: blog, shop, app — proxy all web-facing subdomains

What NOT to Proxy (Gray Cloud)

  • MX records: Never proxied (Cloudflare does not handle email)
  • Mail server A records: If mail.yourdomain.com points to your mail server, keep it gray
  • FTP subdomains: FTP traffic cannot pass through Cloudflare's proxy
  • Game servers, SSH, VPN: Non-HTTP traffic requires gray cloud or Cloudflare Spectrum (paid)
Common mistake: Proxying mail-related A records breaks email delivery. If your email stops working after Cloudflare setup, check that mail server DNS records are set to gray cloud (DNS only). See our email hosting guide for proper email DNS configuration.

SSL/TLS Settings

Cloudflare offers four SSL/TLS encryption modes. Choosing the correct one is critical for security and avoiding redirect loops:

ModeHow It WorksWhen to Use
OffNo encryptionNever (insecure)
FlexibleHTTPS visitor→Cloudflare, HTTP Cloudflare→serverServer has no SSL certificate (temporary only)
FullHTTPS both legs, self-signed cert OK on serverServer has self-signed or expired certificate
Full (Strict)HTTPS both legs, valid cert required on serverServer has valid SSL cert — USE THIS

Recommended: Use Full (Strict) whenever possible. Install a free Cloudflare Origin CA certificate on your server (valid for 15 years) to encrypt traffic between Cloudflare and your server. This prevents man-in-the-middle attacks on the server-side connection. If you use the Flexible mode, the connection between Cloudflare and your server is unencrypted — a significant security gap.

For a comprehensive SSL overview including certificate types and installation for various hosting platforms, read our SSL certificate guide.

Speed Optimization Settings

After basic setup, these Cloudflare speed settings squeeze maximum performance from the free plan:

Caching Settings

  • Caching Level: Set to "Standard" (default). This caches static files based on file extension.
  • Browser Cache TTL: Set to "Respect Existing Headers" or at least 1 month. Longer cache = fewer repeat requests = faster return visits.
  • Always Online: Enable. Cloudflare serves cached pages if your server goes down, keeping your site accessible during outages.

Speed Settings

  • Auto Minify: Enable for HTML, CSS, JavaScript. Removes unnecessary whitespace and comments, reducing file sizes by 10-20%.
  • Brotli: Enable. Modern compression algorithm that produces 15-25% smaller files than gzip.
  • Early Hints: Enable (free). Sends 103 Early Hints responses to preload critical assets before the full HTML response, improving LCP (Largest Contentful Paint).
  • Rocket Loader: Test carefully. It defers all JavaScript loading to improve paint times but can break scripts that expect immediate execution. Enable, test your site thoroughly, and disable if you see JavaScript errors.

Performance Impact

With these settings properly configured, expect these typical improvements:

MetricBefore CloudflareAfter CloudflareImprovement
TTFB (Time to First Byte)400-800ms50-200ms60-80% faster
Full Page Load3-6 seconds1-3 seconds40-60% faster
Server Bandwidth100%30-50%50-70% reduction
Google PageSpeed Score50-7070-90+20-30 points

For even better results, combine Cloudflare with fast origin hosting. See our VPS hosting guide or web hosting comparison for recommended providers.

Security Configuration

Cloudflare's free security features protect against common web attacks. Configure these settings immediately after setup:

Essential Security Settings

  • Security Level: Set to "Medium" (default). Challenges suspicious IPs. Increase to "High" or "I'm Under Attack" during active attacks.
  • Bot Fight Mode: Enable. Blocks known malicious bots from consuming server resources and scraping content.
  • Email Address Obfuscation: Enable. Hides email addresses on your site from scrapers while keeping them visible to visitors.
  • Hotlink Protection: Enable. Prevents other sites from embedding your images, saving bandwidth.
  • Browser Integrity Check: Enable. Evaluates visitor browser headers and blocks requests from bots that fake browser user agents.

HTTPS Security Headers

Add these security headers via Cloudflare Transform Rules (free) or your server configuration:

  • Strict-Transport-Security: max-age=31536000; includeSubDomains — Forces HTTPS for one year
  • X-Content-Type-Options: nosniff — Prevents MIME-type sniffing
  • X-Frame-Options: SAMEORIGIN — Prevents clickjacking
  • Referrer-Policy: strict-origin-when-cross-origin — Controls referrer information

Learn more about domain security fundamentals in our WHOIS privacy guide.

Page Rules & Cache Optimization

The Cloudflare Free plan includes 3 page rules. Use them strategically for maximum impact:

Recommended Page Rules (Free Plan)

#URL PatternSettingPurpose
1http://*yourdomain.com/*Always Use HTTPSForce all HTTP to HTTPS
2*yourdomain.com/wp-admin/*Cache Level: Bypass, Security Level: HighProtect admin area, prevent caching of admin pages
3*yourdomain.com/*.jpgCache Level: Cache Everything, Edge TTL: 1 monthAggressively cache images at the edge

For WordPress sites, rule #2 is essential — without it, Cloudflare might cache your admin dashboard or login page, causing authentication issues. The "Always Use HTTPS" page rule is a belt-and-suspenders approach alongside the SSL/TLS settings toggle.

Cache Everything for Static Sites

If your site is fully static (HTML files with no dynamic content), use this powerful page rule:

*yourdomain.com/*Cache Level: Cache Everything, Edge Cache TTL: 1 month

This caches your entire site at Cloudflare's edge, serving all content from the CDN without hitting your origin server. This achieves near-zero TTFB globally and effectively makes even a cheap shared hosting plan perform like a premium dedicated server for visitors.

Cloudflare with WordPress

WordPress powers 43% of all websites, and Cloudflare integrates perfectly with it. Follow these WordPress-specific optimizations:

Essential WordPress + Cloudflare Setup

  • Install the Cloudflare plugin: It adds automatic cache purging when you publish or update content, and shows Cloudflare analytics in your WordPress dashboard.
  • Configure real IP restoration: Cloudflare proxies requests, so your server sees Cloudflare's IP by default. The plugin (or mod_cloudflare for Apache / set_real_ip_from for nginx) restores the real visitor IP in logs and comments.
  • APO (Automatic Platform Optimization): For $5/month, Cloudflare APO caches your entire WordPress site (including dynamic HTML) at the edge. This is the single most impactful paid optimization — it typically reduces TTFB from 400ms to under 50ms globally. If you spend any money on Cloudflare, spend it on APO.

Compatibility Notes

Cloudflare works with all major WordPress caching plugins (WP Rocket, W3 Total Cache, LiteSpeed Cache). If using both Cloudflare and a caching plugin, let the WordPress plugin handle HTML caching and Cloudflare handle static asset caching to avoid cache conflicts. Disable Rocket Loader if you use WP Rocket's JavaScript optimization, as they can conflict. Compare your hosting and site builder options in our website builder comparison.

Frequently Asked Questions

Yes, Cloudflare's Free plan includes CDN caching, DNS hosting, basic DDoS protection, shared SSL/TLS certificates, 3 page rules, and basic analytics. The free tier handles millions of requests per month with no bandwidth limits. Paid plans ($20-200/month) add WAF, image optimization, advanced analytics, and priority support — but the free plan is genuinely production-ready for most websites.

No — Cloudflare speeds up your website. By caching static content across 300+ global data centers, visitors load your site from the nearest server. Typical improvements are 30-60% faster TTFB and 40-70% faster page loads. The only scenario with minimal added latency is for uncacheable dynamic content from a nearby server, but the difference is negligible (1-5ms).

After creating a Cloudflare account and adding your domain, Cloudflare provides two nameservers. Log into your registrar (Namecheap, GoDaddy, etc.), find the nameserver settings, and replace existing nameservers with Cloudflare's. Propagation takes 5 minutes to 24 hours (usually under 1 hour). Cloudflare imports your existing DNS records automatically during setup.

Yes, Cloudflare provides free SSL on all plans including the Free tier. Universal SSL (shared, automatic) is sufficient for most sites. Advanced Certificate Manager ($10/month) provides dedicated certificates. Cloudflare also offers free Origin CA certificates for encrypting traffic between Cloudflare and your server — valid for up to 15 years.

Absolutely. Cloudflare is one of the best performance upgrades for WordPress. Install the official Cloudflare plugin to auto-purge cache on publish. Enable Auto Minify, set Browser Cache TTL to 1 month, and consider Cloudflare APO ($5/month) for dramatic TTFB improvements. These optimizations typically improve PageSpeed scores by 20-40 points.

Orange cloud (proxied) means traffic passes through Cloudflare, enabling CDN, DDoS protection, and SSL. Gray cloud (DNS only) means Cloudflare handles DNS resolution only — traffic goes directly to your server. Use orange cloud for web traffic (website A/CNAME records). Use gray cloud for mail servers, FTP, and non-HTTP services.

Supercharge Your Website Today

Cloudflare is free, takes 30 minutes to set up, and dramatically improves speed and security. Start with a great domain name.

Search Domain Names Best Registrars