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. /example.com/10.1.1.1) 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 "*.example.com" 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.
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.