What does the "Local domain" setting do?

Under LuCI>Network>DHCP and DNS>General Settings you have the following:
image
What is the purpose of this setting? I was unable to find documentation for it. I noticed that all the regular DNS requests made by devices on the network were having .lan appended to them, e.g. example.com became example.com.lan. I found that if I remove lan from that setting, the problem went away.

I'm not sure what the purpose of this setting is. Does it have a more general name? The only similar thing that I can think of is mDNS with a .local domain.

.lan is set as hostname part on your "devices" and your "devices" do DNS lookups appending it. It is not OpenWRT that sends their DNS requests.
https://openwrt.org/docs/guide-user/base-system/dhcp.dnsmasq#etcconfigdhcp

3 Likes

The essence about it is described by https://en.wikipedia.org/wiki/Fully_qualified_domain_name,

The hostname (let's call it "foo") you set for your router and client devices is not a FQDN by itself, it needs to be appended by the domain name ("lan" in this case, and anchored by a trailing "."), so the FQDN of your client would be "foo.lan.". In this context, ".lan." doubles down as the search domain handed out in the DHCP leases as well (should the client accept the DHCP option), so you may be able to address your clients by the hostname ("foo") only (at least from within your own network), but that still silently expands to the FQDN ("foo.lan." behind the curtain for you).

--
Technically ".lan." is not a reserved domain by IANA and isn't formally allowed for this purpose, but there are few alternatives and even fewer sane ones, so it's technically a kind of domain squatting for a good purpose. If you own your own domain, your can replace ".lan" with a subdomain as well, e.g. ".home.example.com", which would expand to an FQDN of "foo.home.example.com.".

4 Likes