I have been struggling to get local DNS name resolution to work on a fresh install of 25.7 with very few changes to the default configuration. Hopefully someone can help me understand what I need to do to get opnsense to resolve local host names.
Here is what I have done:
Fresh install of opnsense 25.7 from USB
Reboot
left WAN cable plugged in, opnsense automatically setup WAN interface with IPv4 and IPv6.
Updated (to 25.7.2) from console
Reboot
Plug in LAN cable to a single host
Ran through the System:Configuration:Wizard
- Unchecked "Override DNS (Allow DNS servers to be overridden by DHCP/PPP on WAN)"
- Left "DNS [Unbound] : Enable Resolver" checked
- Accepted WAN defaults with no changes
- Accepted LAN defaults with no changes
- Changed root password
- Apply
Reboot
Returned to System | Settings | General
- "Allow DNS server list to be overridden by DHCP/PPP on WAN is still checked" (despite unchecking in the Configuration Wizard - maybe a bug?)
- Unchecked "Allow DNS server list to be overridden by DHCP/PPP on WAN is still checked"
Visited Interfaces | Diagnostics | DNS Lookup from my laptop (x1c7) which is plugged into the LAN interface to try local name resolution:
- Tried x1c7, and x1c7.internal. Both fail
Visited Interfaces | Diagnostics | Ping
- Tried ping x1c7, failed right away
- Tried ping x1c7.internal - this seem to never error out
From my laptop:
- nslookup x1c7.internal
- Returned "** server can't find x1c7: NXDOMAIN"
It's also worth noting that I can ping opnsense.internal and opnsense successfully from my laptop (x1c7). If I monitor dst_port = 53 on the firewall log, I'm able to see that the default firewall rules pass DNS requests (both ipv4 and ipv6).
I've also enabled the following options in Services | Unbound DNS | General:
- Register ISC DHCP4 Leases
- Register DHCP Static Mappings
- Flush DNS Cache during reload
So I can't resolve local host names, even from the opnsense host. Internet hosts resolve without an issue.
Thanks for the help.
Sumtin aint right there.
You applied a change, rebooted, and the applied change reverted back?
What if you apply a change, bounce the web gui, login again and check. Did it go back?
I would start with that problem 1st, then come back to DNS issue.
DHCP is dnsmasq in 25.7
The most minimal change required to make local dns work out of the box still hs to be implemented, but you can also do it manually:
https://github.com/opnsense/core/issues/8969
Or by following these docs:
https://docs.opnsense.org/manual/dnsmasq.html#dhcpv4-with-dns-registration
Quote from: BrandyWine on September 04, 2025, 05:03:26 AMYou applied a change, rebooted, and the applied change reverted back?
What if you apply a change, bounce the web gui, login again and check. Did it go back?
That's correct. I was surprised as well. Seems like a bug.
Quote from: Monviech (Cedrik) on September 04, 2025, 06:07:36 AMDHCP is dnsmasq in 25.7
The most minimal change required to make local dns work out of the box still hs to be implemented, but you can also do it manually:
https://github.com/opnsense/core/issues/8969
Or by following these docs:
https://docs.opnsense.org/manual/dnsmasq.html#dhcpv4-with-dns-registration
Thanks! I will give that a try. It's definitely not obvious.
FWIW, I see a lot of conversation about this on the Internet. For example, if I use Google to search for "opnsense local dns not working", this is the first link that shows up: https://mtlynch.io/notes/opnsense-local-dns. I'm sure this is not a good solution -- the author even claims that it doesn't really work that well.
About the reverting change: Point #5 from this (https://forum.opnsense.org/index.php?topic=42985.0), maybe? I.e., you left the USB stick in the machine?