Skip to content

Grey-clouding a Cloudflare record to debug: what you lose, what you expose, the safer way

Flipping a record to DNS only feels like the obvious way to test the origin — and it publishes your origin IP to the world, drops the WAF for every visitor, and can break TLS outright. Here is the procedure that gets the same answer without the blast radius.

You almost never need to grey-cloud a record to test the origin. curl --resolve (or a hosts-file entry) sends your request straight to the origin IP while the rest of the world keeps going through the proxy — same diagnostic value, zero exposure. Flipping the record to DNS only instead publishes the origin IP into permanent DNS-history archives within minutes, removes the WAF, DDoS protection, and cache for every visitor rather than just you, and breaks TLS on the spot if the origin runs a Cloudflare Origin CA certificate, which browsers do not trust without the proxy in front.

What’s happening

“Is it Cloudflare or is it my server?” is the right debugging question, and bypassing the proxy is the right way to answer it. The mistake is doing the bypass in public DNS. A grey-clouded record changes what every resolver on the planet hands out; you only needed to change what your client connects to.

Three costs arrive the moment the record goes grey. First, exposure: passive-DNS collectors record the origin IP more or less immediately, and that archive does not expire — the details are in origin IP still exposed behind Cloudflare. Second, protection: WAF rules, rate limiting, bot mitigation, and caching stop applying to the hostname for everyone, for as long as you leave it grey. Third, TLS: if the origin’s certificate is a Cloudflare Origin CA cert — standard practice for proxied setups, per Cloudflare’s SSL docs — it is only trusted by Cloudflare. Grey-cloud the record and every browser hitting the origin directly gets a full-screen certificate warning. Your “quick test” becomes a customer-visible incident.

The timing at least is manageable: proxied records use Auto TTL, and the flip to grey serves a 300-second TTL, so the change reaches most resolvers within minutes — in both directions. That speed is what makes a short, controlled grey window survivable when one is genuinely required.

What to check first

  • Whether the test actually requires third parties to reach the origin, or just you — that decides hosts-file versus DNS change.
  • What certificate the origin presents: publicly trusted, or Origin CA (grey-clouding the latter breaks browsers immediately).
  • Whether the origin firewall only allows Cloudflare IP ranges — if so, direct visitors will be blocked the moment the record goes grey.
  • Whether the hostname is under active attack or heavy bot pressure right now; grey-clouding mid-incident removes your shield.
  • Who else is debugging: a teammate re-oranging “your” grey record mid-test wastes everyone’s afternoon.

How to verify

Everything below tests the origin directly while public DNS stays untouched:

# Hit the origin by IP while presenting the real hostname (HTTP and TLS)
curl -sv --resolve www.example.com:443:203.0.113.10 https://www.example.com/ -o /dev/null 2>&1 | head -25

# Compare the same request through the proxy
curl -sv https://www.example.com/ -o /dev/null 2>&1 | grep -E "HTTP|server|cf-ray"

# A cf-ray header means the edge answered; its absence means you reached the origin
curl -sI --resolve www.example.com:443:203.0.113.10 https://www.example.com/ | grep -iE "cf-ray|server"

# Check what the world currently resolves (should stay on Cloudflare IPs)
dig +short A www.example.com @1.1.1.1

If the --resolve request reproduces the bug and the proxied request does too, the problem is the origin. If only the proxied path fails, the problem is edge configuration — SSL mode, cache rules, WAF — and grey-clouding would have “fixed” it only by turning those features off, which is a finding, not a fix.

The fix

When a direct test is genuinely needed, run it in this order:

  1. Start with curl --resolve or a hosts-file entry. This answers “origin or Cloudflare” in one command with no public change. For browser-level testing, add 203.0.113.10 www.example.com to /etc/hosts, test, remove. Expect a certificate warning if the origin runs an Origin CA cert — that warning is expected here and only here.
  2. If a third party must reach the origin, prefer a firewall allowlist over DNS. Give the vendor the IP and open your origin firewall to their source addresses. Publishing the IP in global DNS because one integrator needs it is using a broadcast where a phone call was needed.
  3. If the whole site must bypass the proxy, use “Pause Cloudflare on Site”. Under the zone’s Overview page, Advanced Actions → Pause Cloudflare on Site keeps DNS answers at Cloudflare but disables proxying and edge features zone-wide. It is one reversible switch instead of a dozen record edits — but it exposes origin IPs and drops protection exactly like grey-clouding everything, so treat it with the same respect.
  4. If you still grey-cloud a record, timebox it. Note the time, make the flip, run the test, flip back. The 300-second Auto TTL works for you on restore. Set a timer; “I’ll re-orange it after lunch” is how records stay grey for a year.
  5. Assume the IP is burned afterwards. Once a production origin IP has been in public DNS — even for ten minutes — plan its rotation if origin secrecy matters to your threat model. Passive DNS does not offer take-backs.

When this fix is wrong

If the record needs to stay DNS only permanently — mail hosts, cPanel service subdomains, non-HTTP services — that is not debugging, that is architecture, and the decision framework is different: see running Cloudflare in front of cPanel DNS-only for that pattern done deliberately. And if your test showed the bug only exists through the proxy, do not leave the record grey as the “solution” — fix the SSL mode or edge rule that actually broke, then restore the proxy.

Common mistakes

  • Grey-clouding as the first diagnostic step instead of the last resort.
  • Forgetting the origin runs an Origin CA certificate and serving browser warnings to real customers during the “test”.
  • Leaving the record grey after the incident because the site “works now” — with the WAF and cache silently gone.
  • Testing through a hosts-file entry and forgetting to remove it, then debugging phantom behaviour for days.

Prevention

  • Put curl --resolve one-liners for each site in the team runbook so nobody reaches for the DNS toggle first.
  • Alert on proxy-status changes in the zone (the Cloudflare audit log records them) so accidental grey records surface within minutes.
  • Keep origin firewalls restricted to Cloudflare ranges so a grey record fails loudly instead of quietly serving unprotected traffic.
  • Review the zone monthly for records that are grey without a documented reason.

The discipline is simple: change what your client resolves, never what the world resolves, until there is no other way. 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.