Skip to content

cPanel + Cloudflare: DNS-only vs proxied modes, when to use each

The operational consequences of running Cloudflare in DNS-only (grey cloud) vs proxied (orange cloud) mode in front of cPanel, and which records should be which.

The orange cloud isn’t a default — it’s a posture. Proxying everything through Cloudflare buys DDoS absorption and a WAF, but it also hides the real source IP, breaks mail-server certificate validation, and turns IP-based fail2ban on the cPanel host into noise. Walking through which records should be proxied is the kind of thing that should be decided once per zone, then documented.

The trade-off

In DNS-only (grey cloud) mode, Cloudflare resolves the record but the client connects directly to your cPanel host. You keep real source IPs, AutoSSL works against the host directly, and mail flows normally — but you get no L7 filtering, no DDoS mitigation, and your origin IP is in public DNS.

In proxied (orange cloud) mode, Cloudflare terminates the connection, applies WAF and bot rules, and forwards to your origin. You get DDoS protection and edge caching — but the connecting IP is now a Cloudflare IP unless you restore real IPs via mod_remoteip or mod_cloudflare, AutoSSL needs HTTP-01 to pass through Cloudflare’s edge, and SMTP/IMAP/POP3 records must stay grey because Cloudflare doesn’t proxy those ports on standard plans.

How to decide

Default posture per record type:

RecordModeWhy
@, www, app subdomainsproxiedHTTP/S — benefits from edge + WAF
mail, smtp, imap, pop3, webmailDNS-onlySMTP/IMAP not proxied; certs need direct path
autodiscover, autoconfigDNS-onlyMail client setup hits real host
ftp, sftpDNS-onlyNon-HTTP protocols
cpanel, whm, cpcalendars, cpcontactsDNS-onlyLong-running uploads, large response bodies; proxy timeouts will bite
_dmarc, _domainkey.*, SPF TXTn/aTXT records aren’t proxyable
*.example.com wildcarddependsIf wildcard covers subdomains that need direct access, leave grey

What to do

  1. Audit the zone in Cloudflare — anything orange-clouded on a non-HTTP port is wrong.
  2. Restore real visitor IPs on the cPanel host. WHM > Apache Configuration > Include Editor, post-VirtualHost section, add RemoteIPHeader CF-Connecting-IP and the Cloudflare IP ranges. Rebuild Apache.
  3. Set the Cloudflare SSL mode to Full (strict). Anything weaker accepts MITM between Cloudflare and your origin.
  4. If you proxy WHM/cPanel, raise the Cloudflare proxy read timeout — or just leave those subdomains grey.
  5. For mail, publish SPF, DKIM, DMARC against the real host IP, not the Cloudflare range.

For managed cPanel operations, Stack Harbor sets up the Cloudflare posture per zone as part of onboarding.