Mwan3 with dns forwarding for different WANs not working

I have 2 WANs, and actually, 1 of them is an intranet without internet access capability (WANB), and the other is for internet (WAN) access.
WAN uses public DNS servers, while WANB has its own DNS server for resolving internal domain names.
I tried to set up DNS forwarding for WANB (e.g. / but not working. I can ping the intranet DNS server IP but am unable to ping with domain names.
Any idea how to setup DNS for different WANs?

I need all "*" traffic to query the intranet DNS server, and the rest uses public DNS servers.

It doesn't look like you need mwan3 here.
Disable the default gateway on wanb, add a few static routes for the address space of the company, including the company nameservers, and leave the default gateway only on the wan interface to connect to the internet.
Then make sure that all lan hosts and the OpenWrt use the dnsmasq for address resolving.

Thanks for the reply

LAN hosts use the default DNS server address provided by the DHCP server, does this mean that use the dnsmasq for address resolving?

I tried to set static routes with DNS forwarding, but still did not work.

My steps to set up my router:

  1. remove lan1 from br-lan
  2. create wanb with lan1, and uncheck default gateway
  3. set static routes with wanb. (I could see the routing table was correct in OpenWRT ssh using commands "ip r"
  4. set DNS forwarding

any idea which step went wrong or was missing?

I think I found why dns forwarding not working.
responses from company's dns server contains some strange message, which makes openwrt mark the package rebinded. uncheck rebind protection would solve my issue.
Thanks a lot.

1 Like

Yes the default is to advertise OpenWrt as the nameserver.

If you receive private IPs as replies, it is expected.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.