Split-horizon DNS: why internal and public lookups differ, and how to monitor both
Split-horizon DNS gives different answers inside and outside your network. How it breaks, how to debug it with dig, and how to monitor the public and internal view.
· 6 min read · By the Spot Downtime team
Split-horizon DNS (also called split-brain or split DNS) means the same name returns different answers depending on who asks. Inside your office, VPN or cloud network, app.example.com resolves to a private address like 10.0.4.20. From the public internet, it resolves to a public IP, or not at all.
It is useful and common. It also produces the classic complaint "it works for me but not for them", and it hides one view from the other. This post covers how it fails and how to monitor each side.
How split-horizon is usually built
- Two zones for one domain. A public zone at your DNS provider, and an internal zone on a resolver inside the network, such as BIND, Windows DNS, CoreDNS or an Active Directory server.
- Cloud private zones. For example a Route 53 private hosted zone attached to a VPC, or Azure Private DNS. Queries from inside the VPC see the private zone, and everyone else sees the public one.
- Resolver overrides. A router or Pi-hole returning a LAN address for a name that is public elsewhere.
The key rule: an internal zone that exists replaces the public one for every name under it, not just the names you defined. If the internal example.com zone lacks www, internal users get NXDOMAIN for it even though the public zone has the record.
The failures it causes
The missing record in the internal zone
Someone adds a record to the public zone and forgets the internal copy. The site works for customers and fails for staff, or the other way around. The symptom is NXDOMAIN on one side only.
Private IPs leaking to the public
A private address copied into the public zone makes the name unreachable from outside. Visitors see timeouts, such as ERR_CONNECTION_TIMED_OUT, because 10.x.x.x goes nowhere from the internet.
Clients using the wrong resolver
A laptop on VPN with a public resolver such as 1.1.1.1 configured manually never asks the internal one, so internal names fail. Browsers using DNS over HTTPS can bypass the corporate resolver in the same way.
Stale internal copies
You moved the site to a new IP, updated the public zone, and forgot the internal zone. Staff keep reaching the old server. See DNS TTL explained for why caches make the timing worse.
Debug it by asking each resolver directly
Query the internal and public resolvers explicitly and compare:
# Public view
dig +short app.example.com @1.1.1.1
# Internal view (use your resolver's address)
dig +short app.example.com @10.0.0.2
# What does this machine use by default?
resolvectl query app.example.com # systemd-resolved
scutil --dns | head -30 # macOSIf the answers differ, check which one is wrong. Also ask the authoritative servers directly to rule out the public zone:
dig NS example.com +short
dig app.example.com @ns1.your-dns-provider.comMonitoring the public view
An external monitor sees the public view by design: it resolves your name the way any visitor does. Spot Downtime checks from Virginia, Amsterdam and Singapore and confirms every failure from all three before alerting. That makes it a good test of the public zone, including the "private IP leaked to the public" mistake. A DNS monitor on the record also alerts you when the answer changes from what you expect, which catches an accidental edit to the public zone. Read how to monitor DNS records for the setup.
External monitors can't see inside
Monitoring the internal view
For the inside, run a small check from inside the network and report in with a heartbeat. A cron job on an internal host can resolve the name against the internal resolver, compare it to the expected address, and ping a heartbeat monitor only when it matches:
#!/bin/sh
# Runs every 5 minutes from a host inside the network
EXPECTED="10.0.4.20"
GOT=$(dig +short +time=3 +tries=1 app.example.com @10.0.0.2 | head -n1)
if [ "$GOT" = "$EXPECTED" ]; then
curl -fsS -m 10 --retry 2 https://YOUR-HEARTBEAT-URL > /dev/null
fiIf the internal answer is wrong or the resolver is down, the ping is skipped and the heartbeat alerts you that it is overdue. The setup is explained in how to set up a heartbeat monitor. The grace period should be a little longer than the cron interval, as described in heartbeat grace period and interval.
Keep the two zones in step
- Keep zone files in version control and generate both views from one source where you can.
- List which names are public-only, internal-only and both. Review it when adding a record.
- Never put RFC 1918 addresses (
10.x,172.16-31.x,192.168.x) in a public zone. - After any DNS change, query both resolvers and compare, as above.
- Lower the TTL before planned changes so mistakes clear faster.
Get new guides by email
Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.
Keep reading
- DNS · Monitoring · How-toHow to change nameservers without downtimeMoving DNS to a new provider doesn't have to break your site or email. Copy the zone, test it, handle DNSSEC, switch the NS records and keep the old zone alive.November 17, 2026 · 8 min read
- DNS · Troubleshooting · IncidentsWhat to do when your DNS provider goes downWhen your DNS host has an outage, your site disappears even though your servers are fine. How to confirm it, what you can do during it, and how to prepare.November 12, 2026 · 6 min read