If you're already using Web Hosting with DirectAdmin, adding Cloudflare as an additional layer will make your website load faster, become more secure, and gain free SSL instantly. This guide walks you through every step from start to finish.
📋 Table of Contents
- What is Cloudflare and Why Use It
- What You Need Before Starting
- Sign Up for Cloudflare and Add Domain
- Review DNS Records
- Change Nameservers at Your Registrar
- Configure SSL and Security Settings
- Performance and Caching Settings
- Email Configuration with Cloudflare
- Verify Everything is Working
- Troubleshooting Common Issues
- Frequently Asked Questions
What is Cloudflare and Why Use It
Cloudflare is a free CDN (Content Delivery Network) and DNS Management service used by over 20 million websites worldwide. It acts as an intermediary between your visitors and your Hosting Server.
| Feature | Cloudflare Free | Cloudflare Pro |
|---|---|---|
| CDN (Content Delivery Network) | ✅ Unlimited | ✅ Unlimited |
| DDoS Protection | ✅ Basic | ✅ Advanced |
| Free SSL | ✅ | ✅ |
| Page Rules | 3 rules | 20 rules |
| WAF (Web Application Firewall) | ❌ | ✅ |
| Price | Free | $20/month |
What You Need Before Starting
Before configuring Cloudflare with DirectAdmin Hosting, prepare the following information:
- Hosting IP Address — Find it in DirectAdmin → Server Information, or in your account confirmation email
- Current DNS Records list — Go to DirectAdmin → DNS Management → Export DNS Zone
- Domain Registrar access — You need to be able to log in and change Nameservers
- Email address for Cloudflare registration
Sign Up for Cloudflare and Add Domain
Enter your email and password, then verify your email address.
Type your domain name (e.g., example.com) and click Continue.
The free plan is sufficient for most websites. No credit card required.
After about 1–2 minutes, Cloudflare will import your existing DNS records for review.
Review DNS Records
This is the most critical step. Incorrect DNS Records will cause your website and email to stop working.
A Records for Website
| Type | Name | Content | Proxy |
|---|---|---|---|
| A | @ | Your Hosting IP, e.g., 103.x.x.x | 🟠 Proxied |
| A | www | Your Hosting IP | 🟠 Proxied |
| MX | @ | mail.example.com | ⚫ DNS only |
| A | Your Hosting IP | ⚫ DNS only |
Change Nameservers at Your Registrar
Cloudflare will display the Nameservers to change, such as alice.ns.cloudflare.com and bob.ns.cloudflare.com.
Such as AsiaGB Domain, GoDaddy, Namecheap, or any other registrar.
Change the NS records to the Nameservers that Cloudflare assigned to you.
Wait for DNS Propagation (24–48 hours, though usually faster at 4–8 hours).
dig example.com NS. If you see Cloudflare's NS, the change was successful.
Configure SSL and Security Settings
SSL/TLS Encryption Mode
Go to SSL/TLS → Overview and select the appropriate mode for your Hosting:
| Mode | Description | Recommended For |
|---|---|---|
| Off | No HTTPS at all | ❌ Not recommended |
| Flexible | HTTPS between User-Cloudflare but HTTP between Cloudflare-Hosting | Hosting without SSL |
| Full | HTTPS both ways but no certificate verification | Self-signed SSL |
| Full (Strict) | HTTPS both ways with valid certificate verification | ✅ Valid SSL certificate |
Always Use HTTPS
Go to SSL/TLS → Edge Certificates and enable "Always Use HTTPS" to automatically redirect HTTP → HTTPS.
Performance and Caching Settings
Recommended Speed Settings
- Speed → Optimization → Auto Minify — Enable JavaScript, CSS, HTML
- Speed → Optimization → Brotli — Enable file compression
- Caching → Configuration → Browser Cache TTL — Set to 4 hours or 1 day
Email Configuration with Cloudflare
Email on DirectAdmin Hosting works through a direct IP connection (not through Proxy), so DNS must be configured correctly.
DNS Records for Email
; A Record for mail subdomain — must be DNS Only
A mail <Hosting IP> DNS only
; MX Record — points to mail.example.com
MX @ mail.example.com (Priority 10) DNS only
; SPF Record
TXT @ "v=spf1 ip4:<Hosting IP> ~all"
; DKIM — get the key from DirectAdmin → Email Accounts → DKIM
TXT default._domainkey "v=DKIM1; k=rsa; p=..."
Verify Everything is Working
After setup is complete and propagation has finished, verify using these methods:
- Open the website in a browser — should see HTTPS and lock icon
- Check the header:
curl -I https://example.com— should seecf-ray:header - Test sending and receiving email
- Use a Speed Test tool like GTmetrix or PageSpeed Insights to compare before and after
Troubleshooting Common Issues
Issue: ERR_TOO_MANY_REDIRECTS
Caused by SSL Mode set to Flexible while your Hosting already has an HTTP→HTTPS redirect. Fix by changing SSL Mode to Full or Full (Strict).
Issue: Email Not Working
Verify that MX Records and the mail A Record have Proxy disabled (grey cloud). Change any orange cloud records to DNS only immediately.
Issue: Website Not Updating After File Changes
Enable Cloudflare Development Mode (Speed → Optimization → Development Mode) or Purge Cache at Caching → Configuration → Purge Everything.
Frequently Asked Questions
Cloudflare DNS is a free service that speeds up your website through its CDN network, protects against DDoS attacks, and hides your server's real IP address, making your site faster and more secure.
Sign up for Cloudflare, add your domain, wait for DNS scan, change Nameservers at your Registrar, verify A Records point to your Hosting IP, enable Proxy (orange cloud), and wait 24-48 hours for propagation.
Yes, as long as MX Records are configured correctly. MX Records must point to your mail hostname and the Proxy must be disabled (grey cloud), not orange, because email does not work through Cloudflare Proxy.
Yes, the Cloudflare Free Plan includes CDN, DDoS protection, free SSL, and DNS management, which is sufficient for most websites on AsiaGB Hosting.
Yes, it is recommended to set SSL Mode to Full or Full (Strict) when your Hosting already has an SSL Certificate, ensuring HTTPS is encrypted both between the User and Cloudflare, and between Cloudflare and the server.
Generally 24-48 hours, but Cloudflare is usually faster. Most sites become accessible within 1-4 hours. You can verify using whatsmydns.net or the dig command.
Summary
Setting up Cloudflare DNS on DirectAdmin Hosting is simpler than it seems. The main steps are: sign up for Cloudflare → review DNS Records → change Nameservers → wait for propagation → configure SSL Mode correctly.
The most important thing to remember is that MX Records for email must be DNS Only at all times, and the SSL Mode should be Full (Strict) when your Hosting already has SSL, to avoid redirect loops.
If you need assistance, AsiaGB Hosting supports DirectAdmin with fast SSD Storage, 99% Uptime, and a support team ready to help.