On a cPanel server, assume the origin IP is public knowledge. Every outbound email stamps it into a Received: header, DNS history services archived the A record from before the proxy, the DNS-only records for mail and cpanel publish it right now, and on shared hosting any un-proxied neighbour on the same IP gives it away for everyone. The orange cloud makes the origin harder to find casually — it does not make it secret. The defensible posture is the opposite of secrecy: treat the IP as known, and firewall the web ports so that knowing it buys an attacker nothing.
What’s happening
Cloudflare only conceals the origin for hostnames that are both proxied and never leaked. A cPanel server violates both conditions structurally:
Mail headers. Exim adds the sending server’s hostname and IP to every outbound message. Any recipient — including an attacker who signs up for the site’s newsletter or password-reset email — reads the origin from raw headers.
DNS history. Services like SecurityTrails archive resolution history. A domain proxied last month resolves to Cloudflare today, but its pre-migration A record is one query away, and server IPs rarely change.
DNS-only service records. mail.example.com, cpanel.example.com, ftp.example.com must stay grey to function, and each one answers with the origin. The list of records that cannot be proxied is exactly the list of records that publish the IP — see cPanel service records that must stay DNS-only.
Certificate transparency. Every AutoSSL issuance is logged publicly. Searching CT logs for the domain surfaces hostnames (including the server’s own hostname certificate) that resolve straight to the origin.
Shared-IP neighbours. On a shared cPanel box, one tenant behind Cloudflare shares an IP with tenants who are not. Reverse-IP lookups list the un-proxied sites; their A records are the shared origin.
What to check first
Decide what threat you are actually defending against. Scanner bots and opportunistic exploit traffic hitting the raw IP are a firewall problem with a clean fix. A motivated attacker running volumetric floods at the IP is a bandwidth problem no origin firewall can absorb. The work below fixes the first and honestly frames the second.
How to verify
# Does the origin answer web requests sent directly to the IP?
curl -skI --resolve example.com:443:203.0.113.10 https://example.com/ | head -3
# Which service records publish the IP by design?
dig +short A mail.example.com
dig +short A cpanel.example.com
# What does outbound mail reveal? Send a test, then read the headers
# at the recipient; on the server, confirm the sending host line:
grep " <= " /var/log/exim_mainlog | tail -5
If the curl --resolve probe returns your site, anyone who learns the IP can bypass every Cloudflare protection today. After the CSF lockdown below, the same probe should time out from any address outside Cloudflare’s ranges — keep it as the regression test.
The fix
- Restrict web ports to Cloudflare at the firewall. Remove 80 and 443 from the open list in
/etc/csf/csf.conf(TCP_IN) and allow them only from Cloudflare’s published ranges via port-scoped entries in/etc/csf/csf.allow. The maintained recipe — including the refresh cron and LFD’s ignore list — is in allowlisting Cloudflare IP ranges in CSF and LFD. This is the real payoff: direct-to-IP web probes, scanners, and proxy-bypass exploit attempts die at iptables. - Be clear about what the lockdown does not cover. Ports 25, 465, 587, 993, 995, 21, 22, and the cPanel ports must stay reachable by users and mail peers, so the origin still answers on them. The firewall closes the web bypass; it does not make the server invisible.
- Add Authenticated Origin Pulls for depth. Cloudflare’s free mTLS option makes Apache require Cloudflare’s client certificate on 443, so even a spoofed-source request that slips through network filtering cannot impersonate the edge. Configuration is per-zone in SSL/TLS » Origin Server.
- If header leakage matters, move outbound mail off the origin. Routing outbound through a smarthost (WHM » Exim Configuration Manager, smarthost routelist) or a commercial relay changes what recipients see; pick a relay that rewrites originating headers, and verify by reading your own raw headers afterwards, because many relays faithfully preserve the origin’s
Received:line. - For a genuinely targeted site, rotate to a clean IP — once, properly. Change the server or site IP, put the proxy in place before the new IP ever serves the domain, keep mail on a different IP or relay, and never let the new address appear in a DNS-only web record. A rotation without fixing the leak vectors buys you the time it takes the attacker to re-run the same lookups.
- Re-run the verification probe from an outside host and archive the result in the runbook.
When this fix is wrong
If the concern is volumetric DDoS aimed at the raw IP, iptables drops packets after they have already crossed your uplink — the pipe still fills. That class of attack is absorbed upstream or not at all: by the host’s network, or by architectures where the origin has no public address (Cloudflare Tunnel, or Spectrum/Magic Transit on Enterprise plans). And if the site is low-risk, a full origin lockdown adds operational friction — broken monitoring probes, surprised uptime checkers — for little gain; the DNS-only architecture without lockdown is a legitimate stopping point.
Common mistakes
Believing the orange cloud hides an IP that mail.example.com publishes two records down. Rotating the IP while the old Exim configuration keeps stamping the new one into every message. Allowlisting Cloudflare on all ports, which converts “locked to Cloudflare” into “reachable through anything that can egress from Cloudflare’s ranges, including Workers.” Locking 80/443 to Cloudflare on a server where some domains are not proxied — those sites go dark for everyone. Forgetting that monitoring systems now need explicit allow entries.
Prevention
Treat exposure as a recurring audit, not a one-time cleanup: quarterly, re-run the curl --resolve probe, search CT logs for new hostnames, and re-check which records are DNS-only. Keep high-risk tenants on dedicated IPs so their exposure profile is theirs alone. The published edge ranges you are allowlisting live at cloudflare.com/ips, and Cloudflare’s guidance on protecting origins is in the fundamentals documentation.
Running Cloudflare in front of cPanel/WHM is a stack Stack Harbor operates daily as an official cPanel NOC partner — cPanel server management covers the DNS, mail, SSL, and firewall plumbing, and you can start a conversation any time.