subdomain DNS resolution for a lan host

Started by jata, October 09, 2024, 02:41:22 AM

Previous topic - Next topic
I have a simple opnsense setup for my home network. I use the adguard plugin together with unbound on port 5335

Everything is working fine for dns resolution for all of my lan hosts.

I have one host that I need to resolve for any subdomain on this host as follows:

host.lan -- 192.168.1.10 (working)
test.host.lan  -- 192.168.1.10 (DOES NOT WORK)

Is there a way to allow / config so that anything.host.lan resolves to the same ip as host.lan?




So it seems like I can get this to work by adding a host override in my unbound config. See attached screen shot.

so now wetty.omv.lan or test.omv.lan resolve to the IP of omv.lan

I guess it is a bit limited as it will only work while the IP of omv.lan does not change... 

Any other ways to do this?


Delete any overrides you created, then...

Create a file named (something like) /usr/local/etc/unbound.opnsense.d/my_redirect_zones.conf , containing:


server:
  local-zone: "host.lan" redirect


and restart the Unbound service

Thank you. I will give this a try.

I have another idea to test that is not as good as your suggestion but might also work. That is to use a DNS rewrite rule in adguard.