How to Use Cloudflare CDN with DreamHost Hosting in 2025
Cloudflare's Content Delivery Network (CDN) dramatically improves website speed by serving your content from servers closest to your visitors. Combined with DreamHost's reliable hosting, Cloudflare provides faster page loads, better security, and enhanced performance—all available on Cloudflare's free plan.
This comprehensive guide shows you how to integrate Cloudflare with your DreamHost website, optimize settings for maximum performance, and troubleshoot common issues.
What is Cloudflare and Why Use It?
What Cloudflare Does
Content Delivery Network (CDN):
- Caches static content (images, CSS, JavaScript) on 310+ servers globally
- Serves content from server nearest to visitor
- Reduces server load on DreamHost
- Faster page loads worldwide
Security Features:
- DDoS protection (Distributed Denial of Service)
- Web Application Firewall (WAF)
- SSL/TLS encryption
- Bot protection
- Hotlink protection
Performance Optimization:
- HTTP/2 and HTTP/3 support
- Auto-minification of HTML, CSS, JavaScript
- Image optimization (Paid plans)
- Mobile optimization
- Browser caching optimization
Cloudflare Benefits for DreamHost Sites
Speed Improvements:
- 30-50% faster page loads average
- Better Google PageSpeed scores
- Improved Core Web Vitals
- Faster international access
Bandwidth Savings:
- Reduced DreamHost bandwidth usage
- CDN serves cached content
- Less server resource consumption
Security Enhancement:
- Firewall protects against attacks
- SSL/TLS termination
- Real-time threat blocking
- Protects against spam and bots
Free Plan Includes:
- Unlimited bandwidth
- Unlimited DDoS mitigation
- Shared SSL certificate
- 3 Page Rules
- Universal SSL
Cost: FREE (paid plans from $20/month add features)
Two Methods to Integrate Cloudflare with DreamHost
Method 1: Direct Cloudflare Setup (Recommended)
Advantages:
- Full Cloudflare feature access
- Complete control over settings
- Advanced analytics
- More page rules
- Better caching control
Disadvantages:
- Requires nameserver change
- More steps to configure
- Manage DNS yourself
Best For: Users wanting maximum control and features
Method 2: DreamHost Built-in Cloudflare
Advantages:
- Simpler setup
- No nameserver changes
- DreamHost manages integration
- One-click enable
Disadvantages:
- Limited features
- Less control
- Fewer optimization options
- Not recommended by experts
Best For: Users wanting simplest setup (but experts recommend Method 1)
Important: This guide focuses on Method 1 (Direct Cloudflare Setup) for best results.
Prerequisites
Before integrating Cloudflare:
Active DreamHost Hosting
- Website hosted on DreamHost
- Domain working properly
Domain Access
- Domain registrar login credentials
- Ability to change nameservers
DNS Record Knowledge (Helpful)
- Understand basic DNS concepts
- Can copy/paste DNS records
Cloudflare Account (Free)
- Will create during setup
- No credit card required for free plan
Step-by-Step: Direct Cloudflare Integration
Step 1: Document Current DNS Settings
Before changing anything, record your current DNS configuration.
In DreamHost Panel:
Navigate to DNS
- Panel > Domains > Manage Domains
- Click "DNS" under your domain
Screenshot DNS Records
- Take screenshot or copy all records
- Note: Type, Name, Value for each record
- Save this information
Common DNS Records:
- A Record: Points to IP address
- CNAME: Alias to another domain
- MX: Mail server records
- TXT: Verification and SPF records
Important: You'll recreate these in Cloudflare.
Step 2: Create Cloudflare Account
Visit Cloudflare
- Go to https://cloudflare.com
- Click "Sign Up" (top right)
Create Account
- Enter email address
- Create strong password
- Click "Create Account"
Verify Email
- Check email inbox
- Click verification link
- Return to Cloudflare
Step 3: Add Your Site to Cloudflare
Add Site
- Dashboard: Click "Add a Site"
- Enter your domain: yourdomain.com
- Click "Add Site"
Select Plan
- Choose "Free" plan ($0/month)
- Click "Continue"
- Free plan includes all essentials
DNS Scan
- Cloudflare scans existing DNS records
- Wait 60-120 seconds
- Displays found DNS records
Step 4: Review and Add DNS Records
Important Step: Ensure all DNS records transferred correctly.
Review Scanned Records
- Cloudflare shows found DNS records
- Compare with your DreamHost DNS screenshot
Add Missing Records
- If any missing, click "Add Record"
- Enter Type, Name, Content
- Click "Save"
Critical DNS Records:
A Record (Required):
- Type: A
- Name: @ (or yourdomain.com)
- Content: Your DreamHost IP (from DreamHost DNS)
- Proxy status: Proxied (orange cloud)
WWW CNAME (Recommended):
- Type: CNAME
- Name: www
- Content: yourdomain.com
- Proxy status: Proxied (orange cloud)
MX Records (Email - Critical):
- Type: MX
- Name: @ or yourdomain.com
- Mail server: From DreamHost DNS (e.g., mx1.dreamhost.com)
- Priority: From DreamHost DNS (usually 10, 20)
- Proxy status: DNS only (gray cloud) - IMPORTANT!
TXT Records:
- Copy exactly from DreamHost
- SPF, DKIM, verification records
- Proxy status: DNS only
- Continue
- After verifying all records
- Click "Continue"
Step 5: Update Nameservers
Cloudflare now provides custom nameservers for your domain.
Cloudflare Nameservers: Cloudflare displays two nameservers like:
- cora.ns.cloudflare.com
- trey.ns.cloudflare.com
Your nameservers will be different - copy YOUR assigned nameservers exactly.
Update Nameservers at Domain Registrar:
If Domain Registered at DreamHost:
DreamHost Panel
- Domains > Registrations
- Click domain name
Nameservers
- Click "Nameservers" tab
- Select "Use another host's nameservers"
Enter Cloudflare Nameservers
- Nameserver 1: [Your Cloudflare NS1]
- Nameserver 2: [Your Cloudflare NS2]
- Delete any additional nameservers
- Click "Save Nameservers"
If Domain Registered Elsewhere:
Process varies by registrar (GoDaddy, Namecheap, etc.):
- Log into domain registrar
- Find DNS or Nameserver settings
- Change to custom nameservers
- Enter Cloudflare's provided nameservers
- Save changes
Propagation Time:
- Can take 2-48 hours
- Usually completes within 2-6 hours
- Cloudflare emails when active
Step 6: Configure Cloudflare Settings
While waiting for nameserver propagation, optimize Cloudflare settings.
SSL/TLS Settings:
SSL/TLS Tab
- Cloudflare Dashboard
- Click "SSL/TLS"
Set Encryption Mode
- Choose: "Full (Strict)" if you have DreamHost SSL
- Or: "Full" if using DreamHost SSL
- Never use "Flexible" (insecure)
Why Full (Strict):
- Encrypts visitor-to-Cloudflare
- Encrypts Cloudflare-to-DreamHost
- Most secure option
- Requires valid SSL on DreamHost (which you have)
Caching Settings:
Caching Tab
- Click "Caching"
Caching Level
- Standard (recommended for most)
- or Aggressive (cache everything)
Browser Cache TTL
- Set to: "Respect Existing Headers"
- Or 4 hours to 1 year
Always Online
- Enable "Always Online"
- Serves cached version if server down
Speed Optimizations:
Speed Tab (or Auto Minify under "Speed")
Auto Minify
- Check JavaScript
- Check CSS
- Check HTML
- Reduces file sizes
Brotli Compression
- Enable Brotli
- Better compression than gzip
HTTP/2 to Origin
- Enable if available
- Faster communication with DreamHost
Early Hints
- Enable Early Hints
- Faster page loads
Firewall Settings:
Security Tab
Security Level
- Set to: Medium (recommended)
- Or High if experiencing attacks
Challenge Passage
- 30 minutes (default)
Browser Integrity Check
- Enable (blocks suspicious browsers)
Step 7: Verify Cloudflare is Active
Check Status:
Cloudflare Dashboard
- Overview tab
- Status should show "Active"
Verify on Website
- Visit your website
- View page source (right-click > View Page Source)
- Search for "cloudflare" or "cf-ray"
- Presence indicates Cloudflare active
DNS Propagation Check
- Visit: https://whatsmydns.net
- Enter your domain
- Select "A" record
- Should show Cloudflare IP addresses globally
Test Tools
- Visit: https://www.cloudflare.com/cdn-cgi/trace
- Should show your Cloudflare connection details
Optimizing WordPress with Cloudflare
Recommended WordPress Settings
Cloudflare WordPress Plugin:
Install Plugin
- Dashboard > Plugins > Add New
- Search "Cloudflare"
- Install "Cloudflare" official plugin
- Activate
Configure Plugin
- Settings > Cloudflare
- Enter Cloudflare API token
- Configure caching options
- Enable Automatic Cache Purge
Page Rules for WordPress:
Bypass Cache for Admin/Login:
Page Rules Tab
- Cloudflare Dashboard > Rules > Page Rules
- Click "Create Page Rule"
Admin Area Rule
- URL:
*yourdomain.com/wp-admin* - Setting: Cache Level = Bypass
- Click "Save and Deploy"
- URL:
Login Page Rule
- URL:
*yourdomain.com/wp-login.php* - Cache Level = Bypass
- URL:
Shopping Cart (WooCommerce)
- URL:
*yourdomain.com/cart* - Cache Level = Bypass
- URL:
*yourdomain.com/checkout* - Cache Level = Bypass
- URL:
Cache Everything Rule:
For maximum caching (advanced):
- URL:
*yourdomain.com/* - Cache Level: Cache Everything
- Edge Cache TTL: 1 month
Free Plan Limitation: Only 3 page rules. Choose most important.
Purging Cloudflare Cache
When to Purge:
- After publishing new content
- After website updates
- When changes don't appear
How to Purge:
Method 1: Cloudflare Dashboard
- Caching tab
- Click "Purge Everything"
- Confirm purge
- Wait 30 seconds
Method 2: WordPress Plugin
- Cloudflare plugin purges automatically
- Or manual purge in WP admin bar
Troubleshooting Common Issues
Website Shows Cloudflare Error Page
Error 521 (Web Server is Down):
- DreamHost server offline
- Check DreamHost status
- Contact DreamHost support
Error 522 (Connection Timed Out):
- Server taking too long to respond
- Check DreamHost performance
- May need to upgrade plan
Error 525 (SSL Handshake Failed):
- SSL/TLS mode incorrect
- Change to "Full" or "Full (Strict)"
- Ensure DreamHost has valid SSL
Email Stopped Working
Cause: MX records proxied through Cloudflare (wrong)
Fix:
- Cloudflare Dashboard > DNS
- Find MX records
- Click orange cloud (make it gray)
- Gray cloud = DNS only (correct for email)
- Save changes
Website Slower with Cloudflare
Possible Causes:
- SSL/TLS mode incorrect (use Full Strict)
- Cache not configured properly
- Page rules conflicting
Solutions:
- Check SSL/TLS mode
- Enable Auto Minify
- Set appropriate cache rules
- Review page rules
- Enable Brotli compression
Mixed Content Warnings
Fix:
- SSL/TLS > Edge Certificates
- Enable "Always Use HTTPS"
- Enable "Automatic HTTPS Rewrites"
Redirect Loop
Cause: SSL/TLS mode set to "Flexible" when DreamHost forces HTTPS
Fix:
- Change SSL/TLS to "Full" or "Full (Strict)"
- Disable "Always Use HTTPS" temporarily
- Re-enable after switching modes
Cloudflare Best Practices
Security:
- Enable "Always Use HTTPS"
- Enable HSTS (HTTP Strict Transport Security)
- Set security level to Medium
- Enable Bot Fight Mode
- Use Page Rules to protect admin areas
Performance:
- Enable Auto Minify
- Enable Brotli compression
- Set appropriate cache levels
- Use Cloudflare APO (paid, $5/month for WordPress)
- Enable Early Hints
Reliability:
- Enable Always Online
- Configure proper DNS records
- Monitor analytics
- Set up alerts
Monitoring:
- Check Cloudflare analytics weekly
- Review firewall events
- Monitor cache hit ratio
- Watch for suspicious traffic
Cloudflare Analytics
Available Metrics:
Traffic:
- Pageviews
- Unique visitors
- Requests
- Bandwidth saved
Performance:
- Cache hit ratio (aim for 80%+)
- Response time
- SSL/TLS traffic percentage
Security:
- Threats blocked
- Challenge success rate
- Firewall events
Access:
- Dashboard > Analytics & Logs
- Review weekly
- Identify issues early
Advanced Features (Paid Plans)
Cloudflare Pro ($20/month):
- 20 Page Rules
- Image optimization (Polish)
- Mobile optimization
- Web Application Firewall (WAF)
- Better analytics
Cloudflare Business ($200/month):
- 50 Page Rules
- 100% uptime SLA
- Advanced DDoS protection
- Prioritized email support
- Custom SSL certificates
For Most Sites: Free plan is sufficient
Frequently Asked Questions
Is Cloudflare really free?
Yes, Cloudflare's free plan includes unlimited bandwidth, DDoS protection, and SSL. No hidden costs. Paid plans add advanced features.
Will Cloudflare slow down my site?
No, Cloudflare typically speeds up sites by 30-50%. Proper configuration essential for best results.
Does Cloudflare affect SEO?
Positively. Faster page loads improve SEO. Google favors fast sites. Cloudflare helps rankings.
Can I use Cloudflare with DreamPress?
Yes, absolutely. Cloudflare works perfectly with all DreamHost plans including DreamPress.
What about DreamHost's built-in Cloudflare option?
Experts recommend direct Cloudflare signup (Method 1) over DreamHost's integration for more features and control.
Will email continue working?
Yes, if MX records configured correctly (gray cloud, not orange). Email must bypass Cloudflare proxy.
How long does setup take?
Initial setup: 30 minutes. Nameserver propagation: 2-48 hours. Total: Usually same day or next day.
Can I revert if I don't like it?
Yes, change nameservers back to DreamHost. DNS propagates back within 2-48 hours.
Does Cloudflare replace DreamHost hosting?
No, Cloudflare is a CDN that works WITH DreamHost. You still need DreamHost hosting.
What if I have questions?
Cloudflare has excellent documentation and community. DreamHost support can help with DreamHost-side issues.
Getting Started
Improve your website performance today:
Get DreamHost Hosting
- DreamHost plans from $2.59/month
- Or DreamPress for managed WordPress
Set Up Cloudflare
- Follow guide above
- Free plan recommended
- 30-minute setup
Optimize Settings
- Configure for your site type
- Enable recommended features
- Monitor performance
Find Your Domain
- Use Namr to discover perfect domain
- Pair with DreamHost + Cloudflare for optimal performance
Speed matters—combine DreamHost's reliable hosting with Cloudflare's global CDN for the fastest possible website.