Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
24.7 Production Series
»
subdomain DNS resolution for a lan host
« previous
next »
Print
Pages: [
1
]
Author
Topic: subdomain DNS resolution for a lan host (Read 379 times)
jata
Newbie
Posts: 17
Karma: 1
subdomain DNS resolution for a lan host
«
on:
October 09, 2024, 02:41:22 am »
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?
Logged
jata
Newbie
Posts: 17
Karma: 1
Re: subdomain DNS resolution for a lan host
«
Reply #1 on:
October 09, 2024, 08:14:39 am »
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?
Logged
dseven
Sr. Member
Posts: 317
Karma: 34
Re: subdomain DNS resolution for a lan host
«
Reply #2 on:
October 09, 2024, 10:39:19 am »
Delete any overrides you created, then...
Create a file named (something like) /usr/local/etc/unbound.opnsense.d/my_redirect_zones.conf , containing:
Code:
[Select]
server:
local-zone: "host.lan" redirect
and restart the Unbound service
Logged
jata
Newbie
Posts: 17
Karma: 1
Re: subdomain DNS resolution for a lan host
«
Reply #3 on:
October 09, 2024, 10:30:45 pm »
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.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
24.7 Production Series
»
subdomain DNS resolution for a lan host