DNS Servers for 2 different networks/interfaces

Started by flowerpower, May 16, 2022, 12:20:28 PM

Previous topic - Next topic
Hi to all,
I'm using OPNsense 21.7.8-amd64
I have 2 different interfaces on my opnsense server: LAN (10.0.0.10/16) and WIFI (192.168.1.1./16)
At the moment I have setted on System -> Settings --> General  2 DNS servers: 10.0.1.10 and 10.0.0.18 (Windows DC servers)
All works fine for LAN interface, so for example if I ping from the LAN test.mydomain.org it's returned 10.0.1.19
but if I ping the same hostname from the wifi the ping return to me the external IP address of my internet provider.
Why?
And how can I set different DNS servers for different interfaces/networks?

Thank you in advance!

The DNS server(s) may be set either system-wide or individually for each DHCP-enabled interface:

System/Settings/General allow to specify "system DNS", which OPNsense itself will use and which are passed on to DHCP-enabled interfaces by default

Services/DHCPv4/[Interface] allows to specify the DNS server(s) passed to this interface only. If nothing is defined here, the system DNS servers are used.

If both are blank, you can enable Unbound to resolve DNS names (Services/Unbound). In that case, you can additionally set a "Query Forwarding" for your local domain to point to the Windows DCs.

Regards