Currently i got 2 networks connceted using Wireguard, and one of them is using OpenWRT, the client network.
But i want to use the DNS server of the remote network to resolve hostnames, but how can i add the remote dns server in OpenWRT? Unfortunately in the interface setup of the Wireguard setup there is no "DNS" option.
Usually the DNS server is being added inside of the Wireguard config of the client, but in this case it's not possible, because it has been configured using LuCi.
I hope someone could help!
Add another interface, give some name, protocol static, no bridge, interface use the wireguard interface.
Give the IP and mask of your wireguard interface, along with the desired NS. Also assign it in the same firewall zone as the WG interface.
Finally remove the IP and mask from the WG interface, save/commit/apply.
Defines your subnets domains and dns servers like in my snapshot...
The resolution will become silently and simply available from and through your peer.
Unfortunately both ways didn't work.
In case of @trendys way the routes doesn't work anymore.
I've just worked this out as well. At this point I agree with @erdoukki to have the dnsmasq resolver handle it.
Your two LANs must have different domain names, for example a.lan and b.lan. They can't both be lan which is the default.
In /etc/config/dhcp, change options
domain from the default of lan to a.lan or b.lan. Add a
list server '/b.lan/<ip of the b main router>' and
list rebind_domain '/b.lan/' to the configuration of a and of course the opposite on b. You will probably have to set
localservice to 0 so that the DNS server will answer requests from the other network. That may not be necessary if the VPN tunnel interface is on the same machine where dnsmasq is running, it is not in my case.
If you just want to resolve the remote lan, use the forwarding way.
I understood that you want to use the nameserver of the remote site for everything.
I have the same problem. I try to connect the openwrt-router with wireguard to a second network and use the dns of the second network.
The connection to the second network works, but the dns of the connected network isn't used.
I tried both solutions here.
I used openwrt 21.02
Maybay I do something wrong, has anyone an idea to bring it to work for me?
Have you tried to simply add a forward to the remote DNS IP ? (without /name/)
It will forward all DNS request to the remote DNS server.
Yes, I tried it, but didn't change anything.
Yes, as @vgaetera point to, disable also host resolve file
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.