Skip to content

Split-horizon DNS vs Cloudflare: when internal and public answers fight

The site works from home but not the office, VPN users reach the wrong server, and intranet names started resolving publicly. Two authorities are answering for the same zone name — here is how to make them coexist on purpose.

When behaviour differs by network — fine at home, broken at the office, weird on VPN — two DNS authorities are answering for the same zone name: your internal resolver (Active Directory DNS, a corporate BIND, a firewall appliance) and Cloudflare’s public zone. Nothing synchronizes them, so every name they both know is a potential disagreement, and every name only one knows is a potential leak or outage. The fix is never to make the answers accidentally identical; it is to decide, name by name, which horizon owns what — and to stop browsers with DoH from wandering across the boundary on their own.

What’s happening

Split-horizon DNS means the answer depends on who asks: office clients query the internal resolver, which serves its own copy of example.com with private addresses and internal-only names; everyone else queries public DNS, now hosted at Cloudflare. This is a legitimate architecture — the general design is covered in split-horizon DNS: internal vs external — but moving the public side to Cloudflare disturbs whatever balance existed, in three specific ways.

First, proxied records change the public answers. A hostname that used to resolve to 203.0.113.10 everywhere now returns Cloudflare anycast IPs publicly, while the internal copy still says 203.0.113.10 or 10.0.20.5. Firewall rules, allowlists, and monitoring that assumed one consistent address now behave differently per network.

Second, imports leak. If the zone file pushed to Cloudflare came from a server that also held internal names, your intranet hostnames — and possibly RFC 1918 addresses — are now published to the world. Private addresses in public DNS are an information disclosure at best; at worst they get filtered by resolvers with DNS-rebinding protection, producing “sometimes NXDOMAIN” bugs that are miserable to trace.

Third, DNS-over-HTTPS bypasses the internal resolver entirely. A browser configured (or defaulted) to DoH sends queries to a public resolver over port 443, never consulting the corporate DNS — so office users intermittently get public answers for names that were supposed to be internal, depending on which application asked.

What to check first

  • Which names differ: compare internal and public answers for every hostname involved in the complaint.
  • Whether the internal zone is a full replica of example.com (must be maintained by hand) or an override zone for a few names.
  • Whether any RFC 1918 addresses or internal-only hostnames appear in the Cloudflare zone.
  • Whether affected users’ browsers have Secure DNS / DoH enabled, bypassing the internal resolver.
  • Whether internal firewall rules reference origin IPs that proxied records no longer return.

How to verify

# The same question, both horizons - differences are your conflict list
dig +short A app.example.com @10.0.0.53      # internal resolver
dig +short A app.example.com @1.1.1.1        # public / Cloudflare view

# Sweep a hostname list across both resolvers
for h in www app intranet mail portal; do
  echo "== $h"
  dig +short A "$h.example.com" @10.0.0.53
  dig +short A "$h.example.com" @1.1.1.1
done

# Did internal names leak into the public zone?
dig +short A intranet.example.com @1.1.1.1
dig +short A vpn.example.com @1.1.1.1

# Confirm which path a client actually reaches (edge vs internal server)
curl -sI https://app.example.com/ | grep -iE "cf-ray|server"

A cf-ray header from an office machine means that client is not using the internal answer — its traffic went to the public, proxied hostname, which usually points at DoH or a hardcoded public resolver. Public answers for intranet or vpn names mean the import brought internal records along.

The fix

  1. Decide ownership per name, in writing. Three clean models: public names live only in Cloudflare and internal clients use public answers too; shared names exist in both horizons with deliberately different answers (LAN path internally, proxied edge externally); internal-only names exist solely on the internal resolver. Any name outside these three buckets is where your incidents come from.
  2. Purge internal names from the public zone. Delete leaked intranet hostnames and every RFC 1918 address from Cloudflare — public DNS is not the place for either, per the guidance in Cloudflare’s own DNS docs. If a name must be reachable both inside and out, give it a real public path (proxied record to a published service, or an access gateway) instead of publishing a private IP.
  3. Move internal-only names to their own subdomain. A dedicated corp.example.com zone, authoritative only on the internal resolver, ends the collision permanently: the public zone never mentions it, and nothing internal needs to shadow public names to protect it. This is the single most effective change if you can make it.
  4. Keep shared-name answers deliberate. Where the office must reach a server over the LAN while the world goes through the proxy, keep the internal override — but document it, and update it when the origin moves, because nothing at Cloudflare will do it for you. If internal clients can simply use the proxied public path, delete the override; fewer horizons, fewer surprises.
  5. Bring DoH back under control. Enforce browser policy (disable Secure DNS or point it at your own DoH endpoint) via GPO/MDM, and publish the use-application-dns.net canary domain on the internal resolver so Firefox falls back automatically. Otherwise every browser update reshuffles who sees which horizon.
  6. Fix IP-based rules to match proxied reality. Internal ACLs keyed to the old origin IP must either target the origin’s stable internal address explicitly or stop caring about IPs for a hostname that now fronts through Cloudflare. What each record’s proxy status changes is laid out in proxied vs DNS only per record type.

When this fix is wrong

If everyone — office included — sees the same wrong answer, you do not have a split-horizon problem; you have an ordinary DNS problem, and the internal resolver is just forwarding it faithfully. And if the “internal DNS” is one stale hosts-file entry on a shared server, delete the entry rather than designing horizons around it. Full split-horizon is worth its maintenance cost when regulation, latency, or topology genuinely demand different answers — not as a monument to how the network grew.

Common mistakes

  • Importing the internal zone file into Cloudflare and publishing the intranet to the internet in one click.
  • Maintaining a full internal replica of the public zone by hand and letting it drift for months.
  • Publishing 10.x addresses publicly and burning days on resolver-dependent NXDOMAIN reports caused by rebind filtering.
  • Forgetting VPN clients, who flip between horizons every time the tunnel connects and disconnects.

Prevention

  • Keep a name-ownership inventory: every hostname mapped to public, shared, or internal — reviewed whenever either zone changes.
  • Alert on internal-looking names appearing in the Cloudflare zone (the audit log plus a scheduled export diff catches this).
  • Standardize new internal services onto the internal-only subdomain from day one.
  • Manage browser DoH policy centrally instead of discovering it one support ticket at a time.
  • Re-test both horizons after any Cloudflare migration, from a wired office machine, a VPN client, and an outside connection.

Split-horizon setups fail quietly and get blamed loudly — usually on Cloudflare, which is the only component doing exactly what it was told. 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.