How to Resolve Local Hostnames in OPNSense
My router runs OPNSense Business. I like having an open-source router, but I have a few gripes with it.
My biggest issue is that, by default, OPNsense can’t resolve hostnames on my local network.
Why can’t OPNsense resolve local hostnames? 🔗︎
For every other router I’ve owned in my life, if there’s a computer on my network named foo123 and I run ping foo123 from my main desktop, then everything just works. My desktop successfully pings foo123.
With OPNsense, I can’t ping foo123 from my desktop. OPNsense seems to not resolve local hostnames by default, and I don’t understand why.
I’ve found workarounds that improve the situation somewhat, but it’s still not perfect.
Tell Unbound to resolve local hostnames 🔗︎
Go to Services > Unbound DNS > General.
Check these options:
- Register ISC DHCP4 Leases
- Register DHCP Static Mappings

Check “Register ISC DHCP4 Leases” and “Register DHCP Static Mappings”in Unbound settings
Click Apply to apply the changes.
Manually specify hostnames 🔗︎
Despite configuring Unbound, I find that OPNsense still doesn’t always resolve local hosts, and I don’t know why.
In situations where I just need OPNsense to resolve, I force the mappings manually.
Choose a local domain name 🔗︎
- Go to System > Settings > General.
- Under “Domain” specify a domain name for your local network.
- I always thought you were supposed to choose
local, but the help text warns that you’re not supposed to do that. - I chose
home.arpa, as that’s the technically correct domain for a home network, but wow is it ugly. - According to the IETF’s definition, the domain should actually be
home.arpa.(with a trailing dot), but OPNsense rejects that as a domain and recommendshome.arpa, so I’m sticking with that.
- I always thought you were supposed to choose
- Click “Save” to apply the change.
Create a static mapping for the host 🔗︎
- Go to Services > ISC DHCPv4 > Leases
- Find the host in the list of hosts that you want OPNsense to resolve.
- Click the
+icon at the right end of the table row. This should bring you to the Static DHCP Mapping dialog. - Enter a local IP address in the
IP addressfield. - Click “Save” to save the static IP mapping.
Create a manual override for the hostname 🔗︎
- Go to Services > Unbound DNS > Overrides.
- Under “Host Overrides”, click the orange “+” button to add a new override.
- Under “Host” enter the hostname you specified in the static mapping.
- Under “Domain” enter
home.arpa. - Under “IP address” enter the IP address you chose in the static mapping.
- Click “Save”.
Specifying hosts with the .home.arpa domain suffix 🔗︎
Sometimes, when OPNsense fails to resolve host foo123, it successfully resolves foo123.home.arpa, so I always try adding the domain suffix if the bare hostname doesn’t work.
I’m not sure why OPNsense needs the suffix, as the lack of domain name should make it obvious that I’m talking about a host on the local network, but the .home.arpa domain sometimes makes a difference.
Other improvements? 🔗︎
If you have suggestions for making OPNsense’s hostname resolution less brittle and more reliable, let me know in the comments.
Read My Book

I'm writing a book of simple techniques to help developers improve their writing.
My book will teach you how to:
- Create clear and pleasant software tutorials
- Attract readers and customers through blogging
- Write effective emails
- Minimize pain in writing design documents
Be the first to know when I post cool stuff
Subscribe to get my latest posts by email.
