Internal DNS only works for fqdn

Started by rheilke, August 06, 2026, 07:03:06 PM

Previous topic - Next topic
Hi.

I am having trouble getting DNSMasq and Unbound to behave the way I'm wanting.

I have a domain, and my ISP hosts my email (mail.domain.com) and website (www.domain.com). This works fine. I have named my internal network lan.domain.com. So, my NAS is nas.lan.domain.com. In order to resolve the name of any internal system I need to use the fqdn (like the example above, nas.lan.domain.com).

How do I get DNSMasq and Unbound to resolve using just the hostname, since every internal system is in the same lan.domain.com sub-domain? I shouldn't have to always use the fqdn for my internal systems. Or do I need to punt Unbound and install BIND?

Any help would be greatly appreciated.

Details:   - most systems have DNS reservations in DNSMasq
      - all internal systems, including the firewall, are in the lan.domain.com sub-domain
      - I have a mix of BSD, Linux, and Windows systems
      - I defined a DHCP range for the LAN interface to see if it would help
      - I tried an override in Unbound to see if it would help
      - lan.domain.com is set as a private domain in Unbound, again,  to see if it would help

Did I miss anything?


Set the DHCP search domain option to "lan.domain.com" so your clients that got a lease from the DHCP server append that name when you lookup for "nas".
Hardware:
DEC740

Exactly which page is this on? (I have lan.domain.com already explicitly set in several (all?) places. Also, I assume this is set within the server, and not as a setting passed to clients which would require a reboot.)

Its a client setting, the client decides how to ask the DNS server for a name.

Clients either get it via DHCP option or you set it manually in them.

In dnsmasq its the "domain" setting in each range.

Here some context what a search domain is:
https://en.wikipedia.org/wiki/Search_domain

Here where we explained it for dnsmasq:
https://docs.opnsense.org/manual/dnsmasq.html#dhcpv4-with-dns-registration

If it doesnt work, its entirely up to the client, the DNS server cannot do anything about it.
Hardware:
DEC740

OK, thank you. So, it will only work after the client asking has rebooted? That's going to be a pain. :( This also explains my nslookup results.

I always thought this was a server-side setting...

Thank you again, I've learned something new.
R