I am experiencing some problems while attempting to set up a "Custom DNS" server in combination with a WireGuard VPN tunnel. I have followed the guide provided by MullVad, which can be found here: Link to the guide.
My goal is to have a setup where I can use OpenDNS for content filtering (To prevent loading the device RAM too much with adblock) and utilize OpenWRT's luci-app-adblock as a small additional DNS adblocker. Here's the configuration I have tried so far:
Setting "Use custom DNS servers" to OpenDNS (208.67.220.220 & 208.67.222.222) under Interfaces » wan » Advanced Settings.
Setting "Use custom DNS servers" to OpenDNS (208.67.220.220 & 208.67.222.222) under Interfaces » WireGuard » Advanced Settings.
Setting "Use custom DNS servers" to OpenDNS (208.67.220.220 & 208.67.222.222) under Interfaces » lan » Advanced Settings.
Setting "DNS forwardings" to OpenDNS (208.67.220.220 & 208.67.222.222) under Network » DHCP and DNS.
With these configurations, I intended to have DNS requests from devices on the network first go to 192.168.98.1 (which is OpenWRT's own IP address, hosting its built-in DNS server with Adblock). From there, the OpenWRT router should forward the requests to OpenDNS outside of the WireGuard tunnel. However, I have encountered a problem: the DNS requests always get tunneled through the WireGuard tunnel to the Mullvad DNS, instead of being forwarded to OpenDNS.
I have verified that the enforcement of the 192.168.97.1 DNS is functioning correctly, as the Adblock application is working as intended. The issue lies in the forwarding of DNS requests to OpenDNS outside of the WireGuard tunnel.
I would appreciate any insights or suggestions on how to resolve this problem. Ideally, I would like the DNS requests from devices on the network to be sent to 192.168.98.1, the OpenWRT router's built-in DNS server with Adblock, and then forwarded to OpenDNS.
Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have
ubus call system board; \
uci export network; \
uci export dhcp; \
ls -l /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
Currently I'm away trom the computer, had to boring my daughter to swimming lessons.
I'll run that command as wel when I get home again in about half an hour.
How would you set up this static routing for OpenDNS?
I've never worked with that before.
So far there is no sign of any Mullvad dns in your configuration, so it is more likely that Mullvad is hijacking them.
As a sidenote you don't need the OpenDNS servers in lan interface or in the server section of the dnsmasq. We add them in the interface where they are reachable.
For the static routes you can go to the Luci and add it. Fill in target, interface, and gateway.
Whoops indeed, stupid mistake.
When @egc was talking about DNS Hijacking I searched it some more.
Indeed MullVad is normally Hijacking DNS and tunnel it's traffic through MullVad.
In the MullVad app on Android you have to option to use custom DNS is you want to.
This is where I found the following article: Use Custom DNS Servers With Mullvad And Any WireGuard Client
I'm going to try this, and report back my results.
I 'll have to re-setup the WireGuard interface anyhow, so generating a new priv.key in the proces.