Hands-on tutorial
Tutorials · Routing & Internet
How to Set Up Split-Horizon DNS for Internal and External Users
Make the same hostname resolve to an internal address inside the office and a public address outside, so portals, NVRs and servers work everywhere without hairpin NAT.
Before you start
- An internal DNS server (gateway, server or directory DNS)
- The public DNS zone for your domain
- The internal and public addresses of each service
Step by step
List the services
Identify names used both inside and outside, for example portal.example.com or files.example.com.
Create internal records
On the internal DNS server, create the same names pointing to internal addresses.
portal.example.com. A 10.0.20.15 files.example.com. A 10.0.20.30
Keep public records unchanged
Public DNS continues to answer with public addresses for external users.
Point clients to internal DNS
Make sure DHCP gives clients the internal DNS server, and that VPN users also receive it.
Forward everything else
The internal server answers for your own zone and forwards other queries to a filtering or public resolver.
Test from both sides
Resolve the names from the office, over VPN and from a phone on mobile data.
nslookup portal.example.com 10.0.0.53 nslookup portal.example.com 9.9.9.9
Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.
Pro tips
- Keep internal and public records documented together to avoid drift.
- Use the same TLS certificate names inside and out, so browsers do not warn.
- Avoid exposing internal-only names in public DNS.
FAQ
Frequently asked questions
Why not just use hairpin NAT?
Hairpin NAT sends internal traffic out and back through the gateway; split-horizon DNS keeps it local and simpler.
Does split-horizon DNS affect email?
Only if you create internal records for mail names; usually only application names are split.
Keep learning
Related guides
DNS troubleshooting with dig and nslookup
Read more →DNS filtering
Read more →NAT and port forwarding safely
Read more →How to Set Up Dual-WAN Failover With a 4G LTE Backup
Keep a branch online when the fibre fails: add a 4G LTE link as a backup WAN with health checks and automatic failover.
Read more →How to Plan IP Addressing and Subnets for a Business Network
A clean IP plan makes networks easier to secure, troubleshoot and grow. Learn a simple scheme you can reuse on every site.
Read more →How to Configure DHCP Scopes, Reservations and Options
Hand out addresses reliably: one scope per VLAN, reservations for printers and cameras, the right DNS and gateway options and sensible lease times.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.