Skip to content

Origin IP still exposed behind Cloudflare: how it leaks and how to actually hide it

Turning on the orange cloud does not erase your server's address. DNS history archives, grey-clouded subdomains, mail headers, and certificate scans all leak the origin IP — and attackers check every one of them before they bother with your WAF.

Enabling the proxy hides your origin IP from future DNS lookups — and from nothing else. The address is already archived in DNS-history services from before the move, still published by every grey-clouded subdomain (mail, ftp, direct, cpanel), stamped into the Received headers of every email your server sends, and indexed by internet-wide scanners that found your certificate on the origin’s port 443. Anyone who wants to bypass Cloudflare checks those four places first. Hiding the origin for real means locking the origin down to Cloudflare-only traffic and then moving to a fresh IP that has never been public.

What’s happening

The proxy is a lookup-time control: queries for orange-clouded names return Cloudflare anycast IPs. It does not reach back in time, and it does not cover the side channels:

DNS history. Passive-DNS services have been recording resolution data for years. Your pre-Cloudflare A record — hostname, IP, date range — is one search away, permanently. If the origin kept the same IP through the migration, the proxy hides nothing from anyone who looks.

Grey-clouded records. Mail must stay DNS only (the MX target cannot be proxied), and ftp, webmail, cpanel, or a forgotten direct.example.com often do too. Every one of those names resolves straight to the origin. On cPanel stacks the standard service subdomains make this nearly universal — what proxying does and does not cover on cPanel maps them out.

Mail headers. If the web server sends mail (contact forms, order confirmations, cron alerts), the receiving side sees your server’s IP in the Received: chain. One email to a throwaway mailbox is a complete deanonymization kit.

Certificate scans. Scanners like Shodan and Censys walk the whole IPv4 space, save whatever certificate each IP presents on 443, and make it searchable. An origin that presents a certificate naming example.com to anyone who connects has indexed itself.

What to check first

  • Whether the origin IP predates the Cloudflare move — if yes, assume it is public knowledge.
  • Which records in the zone are grey, and which of them resolve to the same IP as the proxied site.
  • Whether the web origin sends outbound mail directly.
  • What certificate the origin presents to a connection by bare IP.
  • Whether the origin’s firewall accepts port 80/443 traffic from arbitrary sources today.

How to verify

# What do the grey-clouded names give away?
dig +short A mail.example.com @1.1.1.1
dig +short A ftp.example.com @1.1.1.1
dig +short A cpanel.example.com @1.1.1.1

# Does the origin still answer for the site when addressed directly?
curl -s -o /dev/null -w "%{http_code}\n" --resolve www.example.com:443:203.0.113.10 https://www.example.com/

# What certificate does the bare IP present to a scanner?
true | openssl s_client -connect 203.0.113.10:443 2>/dev/null | openssl x509 -noout -subject

# Send a test email from the server and read the Received: headers at the destination
echo "test" | mail -s "header check" you@example.net

If the curl --resolve returns your site with a 200, the origin serves anyone who knows the address — the proxy is decoration for informed attackers. The openssl check tells you whether certificate-transparency scanners can match the IP to your hostname.

The fix

  1. Lock the origin to Cloudflare before anything else. Restrict ports 80/443 at the origin firewall to Cloudflare’s published IP ranges (they are versioned and documented under Cloudflare’s fundamentals docs), and keep the list updated. Better: enable Authenticated Origin Pulls so the origin requires Cloudflare’s client certificate on every connection — covered under Cloudflare’s SSL docs and available on all plans. Best: Cloudflare Tunnel, which makes an outbound-only connection from the origin and lets you close inbound 80/443 entirely.
  2. Move to a clean IP. History cannot be scrubbed. Once the origin is locked down, re-IP the server (or move the workload) and update the records. The new address has value only if it never appears in public DNS — bring it up already firewalled, and never point a grey record at it.
  3. Split mail away from the web origin. Send outbound mail through a relay or a separate mail host so Received: headers stop naming the web server. This also fixes the “MX target must be grey” exposure in one move: the grey mail records now point at a different machine.
  4. Stop the origin from introducing itself to scanners. The default vhost on the bare IP should present a self-signed certificate with no real hostname and serve nothing. Real certificates for real hostnames belong only behind hostname-matched vhosts.
  5. Sweep the zone for leftovers. direct., origin., old., server1. — convenience records from past debugging are the most common leak. Delete them or orange-cloud them; if a third party genuinely needs direct access, allowlist their source IPs at the firewall instead of publishing yours in DNS.

When this fix is wrong

If the threat model is “casual DDoS against the hostname”, the proxy alone already handles it, and a full re-IP project may be more disruption than the risk justifies — locking the firewall to Cloudflare ranges and stopping there is a defensible middle. This article is also the wrong place to start if you deliberately need direct origin access for debugging; do that without publishing anything, as described in grey-clouding a record to debug safely.

Common mistakes

  • Enabling the proxy and calling the origin “hidden” while mail.example.com still points at the same box.
  • Re-IPing the server before locking it down, so the new address leaks the same way the old one did.
  • Firewalling to Cloudflare ranges but never updating the list, then blaming Cloudflare when a new range gets blocked.
  • Leaving old direct. records in place because “nobody knows about them” — passive DNS knows.

Prevention

  • Treat the origin IP as a secret from day one of any new deployment: firewall first, DNS second.
  • Standardize on Tunnel or Authenticated Origin Pulls for new builds so the origin never accepts anonymous connections.
  • Route all outbound mail through a relay as a matter of policy, not per-site exception.
  • Add a quarterly check: query every grey record, curl --resolve the origin, and search your domain in a passive-DNS service.
  • Keep mail, web, and admin services on separate IPs so no single grey record unmasks everything.

An origin that only speaks to Cloudflare, from an address the internet has never seen, is the standard worth aiming at — everything less is a WAF with a side door. Moving a production zone onto Cloudflare without dropping mail or exposing the origin is exactly the kind of work Stack Harbor handles under Managed Cloud Ops — book an infrastructure review if you want it done with a rollback plan.