← All posts

Split-horizon DNS for a homelab

My services answer at the same name inside and outside the house, without going out to the internet and back.
November 24, 2026·4 min read#dns#opnsense
Say you host nextcloud.example.com at home. Outside, its name points at your public address. Inside, you want your laptop to reach it directly, not hairpin out through the internet and back.
Split-horizon DNS gives the same name two answers: the public one for the world, and your inside address for devices at home. On OPNsense, Unbound does it with host overrides.
  • Point every device at home at your own resolver (OPNsense Unbound), and only that.
  • Add an override for each public name you host, pointing at your reverse proxy’s inside address.
  • Don’t forget the bare domain (example.com) as well as the subdomains. I did, once.
Then block outbound DNS to anything else, so a device with a hard-coded resolver can’t skip your overrides.
The payoff is lovely: services work the same everywhere, keep working when the internet is down, and stay fast because the traffic never leaves the house.
🏠
Written from my homelab. Everything here runs in my own rack first. Spotted a mistake, or run something better? Tell me.