Split-horizon DNS

Also known as: split DNS

On this page 7

Split-horizon DNS is a configuration in which the same domain name resolves to different answers depending on who asks, most often giving internal clients private addresses and internet clients public ones. In DNS, the core naming system of the Internet, it is also called split DNS, and it is a deliberate policy decision made by the operator of an authoritative or recursive server rather than a protocol feature.

The technique lets an organization publish one name, such as app.example.com, while steering employees to an internal load balancer and customers to a public edge address. It solves real routing and privacy problems, but it also creates two versions of the truth that must be kept consistent, which is where most operational trouble begins.

How split-horizon DNS selects an answer

A split-horizon server answers each query by first classifying the client and then consulting the zone data assigned to that class. The classifier is usually the source IP address of the query, matched against address lists that define the internal network, partner networks or the public internet.

In BIND, the mechanism is implemented with views: each view has a match-clients list and its own copy of the zone. Other servers use equivalent constructs, such as policy-based DNS in Windows Server, GeoDNS rules in commercial platforms, or separate server instances that hold different zone files. The resolver on the client side never knows a split exists; it simply receives the answer for its view.

The following table shows how a single name can map to different records across typical views.

ViewClient sourceAnswer for app.example.com
Internal view10.0.0.0/8 office and VPN ranges10.20.5.15 (internal load balancer)
Partner viewDedicated partner address block172.16.40.8 (private interconnect)
External viewAll other addresses203.0.113.25 (public edge proxy)
Example answers for one name in three views

Selection by TSIG key is also possible and is more robust than address matching, because a signed query proves which server or client sent it. This approach is common for zone transfers between views, where an address alone cannot distinguish two views hosted on the same secondary server.

Common deployment models

Organizations implement split-horizon DNS in a few recognizable patterns, and the choice determines how much duplication and how much risk of drift the operators accept. Each model below has been used widely; none is universally superior.

ModelHow it worksMain advantageMain drawback
Views on one serverOne authoritative server holds several viewsSingle place to manage policyA misclassified client sees the wrong zone
Separate internal and external serversInternal resolvers host a private copy of the zoneStrong isolation of internal dataTwo zone files drift apart
Conditional forwardingInternal resolvers forward one zone to private authoritative serversSimple to add to existing resolversForwarding failures break internal names
Cloud private zonesA private hosted zone is attached to selected virtual networksManaged service with access controlNames resolve only inside attached networks
Deployment models and their trade-offs

A frequent variant is partial overlap, where the internal view contains only a handful of overridden records. Many servers do not merge views automatically, so an internal zone that defines example.com must also contain every public record that internal users need, such as mail exchangers and verification TXT records, or those names will fail internally.

Split-horizon DNS is easily confused with neighboring concepts because several techniques produce location-dependent answers. The distinction lies in why the answer differs and who controls the decision.

TechniqueBasis for different answersTypical goal
Split-horizon DNSNetwork membership or trust level of the clientInternal versus external routing and privacy
GeoDNSApproximate geographic location of the resolverSend users to the nearest region
AnycastRouting of one address to many sitesSame answer, nearest server by network path
Private-use TLDA name that does not exist publicly at allPurely internal namespace
Hosts file overridesStatic entries on one machineLocal testing or emergency fixes
Split-horizon DNS and similar approaches

Split-horizon DNS interacts closely with the DNS cache and Time to live values. A laptop that caches an internal answer and then leaves the office will keep using a private address that is now unreachable until the cached record expires, which is a classic source of intermittent failures.

Practical design and configuration guidance

A sound split-horizon design starts with a clear inventory of which names genuinely need different answers. The fewer names that differ, the smaller the surface for inconsistency, so many teams use a dedicated internal subdomain, such as corp.example.com, instead of splitting the main zone.

  • Generate both views from one source of truth, such as an IP address management system or a templated repository, rather than editing two zone files by hand.
  • Define view membership precisely, including VPN pools, container networks and IPv6 ranges that are easy to forget.
  • Use short TTLs for records that differ between views when clients roam between networks.
  • Monitor both perspectives with probes inside and outside the network that compare answers continuously.
  • Document the split so that incident responders know a name can legitimately return two different addresses.

The decision table below summarizes when split-horizon DNS is a good fit and when an alternative is wiser.

SituationRecommended approachReason
Internal users must reach a public service by its private pathSplit-horizon override for that nameAvoids hairpin NAT and external round trips
Internal hostnames must stay hiddenSeparate internal subdomainNo risk of leaking records into the public view
Hybrid cloud with private endpointsPrivate zones plus conditional forwardingMatches the cloud provider’s network model
Remote staff on and off VPNSplit-horizon with short TTLsLimits stale cached answers after network changes
When to use split-horizon DNS

Limitations, risks and failure modes

The most serious limitation is configuration drift: a record added to the external view but forgotten in the internal one works for customers and fails for employees, or the reverse. Such faults are hard to diagnose because each group reports a different experience of the same name.

Encrypted DNS is a newer risk. Browsers and operating systems that use DNS over HTTPS or DNS over TLS with a public resolver bypass the internal server entirely, so internal clients receive external answers. Enterprises typically counter this with managed browser policies or a canary domain that signals clients to disable automatic encrypted DNS.

DNSSEC adds further care. Each view that is signed needs valid signatures, and an internal view that overrides a signed public zone must either be signed with the same keys or be served to validators that are configured to trust it; otherwise validating resolvers return SERVFAIL. Leaking internal records through a misclassified client or an open zone transfer is another common security finding.

SymptomLikely causeFix
Name works externally but not internallyRecord missing from internal viewGenerate views from one source
Remote users fail after leaving VPNCached private answerLower TTL, flush cache on disconnect
Internal clients get public addressesEncrypted DNS to a public resolverEnforce resolver policy on managed devices
Validation failures on internal namesUnsigned override of a signed zoneSign the internal view or use a separate subdomain
Symptoms, causes and fixes

Put simply

Split-horizon DNS is like a building receptionist who gives directions based on who is asking. A staff member asking for the finance office is sent down the internal corridor, while a visitor asking for the same office is sent through the front entrance. Both get the right destination, but by different routes.

The catch is that the receptionist needs two accurate sets of directions. If one set is updated and the other is forgotten, one group gets lost. Keeping both versions in sync is the whole job.

In practice

A mid-sized software company hosts its customer portal at portal.example.com. Public visitors resolve the name to 203.0.113.40, a reverse proxy at the network edge. Engineers in the office, however, previously had to leave the network and come back through the firewall, which caused hairpin NAT problems and slow uploads.

The network team creates an internal view on its resolvers that answers portal.example.com with 10.30.2.10, the application’s internal load balancer, and keeps every other record identical through a script that builds both views from one repository. They set a TTL of 300 seconds on the overridden record so laptops that leave the office stop using the private address within five minutes.

After rollout, internal upload times fall noticeably and firewall logs show no more hairpin traffic. A month later, a monitoring probe flags that a newly added mail verification record exists only externally, and the shared build script corrects it in both views, showing why automated generation matters.