Proton VPN Wireguard Client - not using VPN DNS

I have a Flint 2.

I have setup custom LAN DNS to point to a Raspberry PI running AdGuard Home.

When connecting to Proton VPN with a device, the DNS stays as the Raspberry PI/AdGuard Home DNS Server, and does not change the the Proton VPN DNS Servers.

I need to be able to use Proton’s DNS Servers for streaming services to work correctly as it doesn’t like it when a custom DNS is used, rather than Proton’s own.

Please advise how I can resolve this so that clients use the VPN’s DNS rather than the local DNS.

Thanks.

Go to be to Network > DNS and disable:

Allow Custom DNS to Override VPN DNS

Also, why not use the built in Adguard Home that's pre-installed on the Flint 2?

This is already disabled - note the custom DNS is set at the LAN/DHCP level, not the WAN DNS settings (as per screenshots).

I am using a Raspberry PI as historically I have always used it - plus it is running Unbound for DNS.

I don’t want to have to setup client settings, blocklists, custom filtering rules etc. again.

It appears the LAN DNS setting overrides all other DNS settings, including those used by VPN Clients.

Note this is only happening in Policy Mode when specifying individual clients - when set to Global Mode, all traffic (including DNS) is routed over the VPN as expected.

This is not ideal - is there a fix for this (i.e. is it a bug) or is this expected behavior?

Seems like this was also reported here: Flint 2 DNS - do I have this right? Manual/VPN - #4 by gbh

Hi

This is the expected behavior.

When DNS is distributed through DHCP, LAN devices send their DNS queries to the Raspberry Pi.
The Raspberry Pi then forwards those queries over the WAN interfaceto the configured DNS servers, since it is not included in the VPN policy.


If you want devices in the VPN policy list to use the VPN DNS while others use the Raspberry Pi’s DNS, please follow these steps:

  1. Remove any DNS servers configured in DHCP so that all LAN devices use the Flint 2 LAN IP as their DNS resolver.

  2. In Network → DNS, configure the Raspberry Pi’s LAN address as the manual DNS server (Cloudflare DNS is used here as an alternative).

  3. Disable Allow Custom DNS to Override VPN DNS.

Configuration:

Test results:

I did this, it “works”.. but…

This then "breaks" the DNS logging in AGH on my Raspberry Pi as the client making the DNS requests then becomes the router IP, rather than the individual device/clients IP's - this I why I need to set the DNS at the LAN/Client level so that they report into AGH correctly.

Also, this doesn't explain why the VPN DNS WORKS when using Global Mode, but does NOT work in Policy Mode when using LAN/Client DNS in both scenarios...

The VPN DNS would not work with your settings been shared as well.
This should only work if "Override DNS Settings of All Clients" is enabled or if your VPN provider intercepts and rewrites unencrypted DNS requests.

Test Configuration:

Verification:
DNS queries of LAN devices are transmitted via the VPN tunnel and adhere to the DHCP DNS settings.

Well, it seems there's no good solution to this problem.

If the devices in the VPN policy list are persistent, you could consider manually configuring their DNS to the router's LAN address.

The VPN DNS would not work with your settings been shared as well.
This should only work if "Override DNS Settings of All Clients" is enabled or if your VPN provider intercepts and rewrites unencrypted DNS requests.

But it does work in Global Mode without that setting enabled - and this is what I can’t figure out why it’s not doing it in Policy Mode.

When I am home from work this evening I will test again and post screenshots with the results.

Here we go - these are the results using Global Mode with the exact same DNS settings when using Policy Mode.

As you can see, the LAN DNS is overwritten with the VPN DNS Server, which does not happen in Policy Mode selecting an individual device or devices.

No additional settings are enabled per the screenshot.

That's strange — we haven't been able to reproduce this issue on our side.

We replicated your setup as closely as possible, including the VPN server configuration, with the only difference being that our LAN DHCP assigns Google DNS.
However, the DNS leak test still correctly reports the Google DNS provided by LAN DHCP.

To investigate this more thoroughly, could you please connect your device to GoodCloud and share the results with us?
You can follow this guide: Technical Support via GoodCloud - GL.iNet Router Docs 4

Please send the device’s MAC address and login password to us via private message so we can examine it further.

Additionally, could you share the AdGuard Home configuration from your Raspberry Pi?
If possible, please PM us the configuration file directly.

I’ve sent this now, Will.

Thanks.

There does not appear to be an AdGuard Home configuration file for the Raspberry Pi in PM.
Could you please send us your current configuration, such as the backup or export file?

We have exported your router configuration and imported it into our test device for a 1:1 comparison.
So far, we have been unable to reproduce the issue: in global mode, all clients' DNS requests follow the DNS settings provided via DHCP, regardless of whether they are connected via Ethernet or Wi-Fi.

Do you have any specific AdGuard Home settings in place, such as using the VPN DNS as the default with another DNS server as a fallback in case of failure?
This type of configuration might also apply to your scenario.

My AdGuard Home instance is using Unbound, and reaches out to the Authoritative Root Servers for DNS resolution.

No VPN DNS servers or fallback DNS servers are set.

That makes sense.

In global mode, the VPN DNS is still not being used.
It's just that your Unbound is using the VPN IP as the exit point to access the DNS leak test's authoritative DNS server for the address—so the DNS leak test shows the VPN IP address.

OK - that makes sense I guess.

I can’t test this to confirm at the moment as I am travelling for work.

However, in that case, is there any way (either with a firewall rule/traffic route rule/etc. to redirect the LAN DNS to point to the VPN for DNS when using either Global or Policy Modes?

Or is this a setting GL-iNet can implement and provide to end-users as an option to override LAN DNS to the VPN?

I had this option on my Asus router and it worked with no issue so I don’t see why it can’t be implemented here.

This is a major downside for me that it doesn’t work this way but does on other routers from different brands.

This would make or break me keeping this router or having to go back to Asus again.

At present, you can force all LAN clients’ unencrypted DNS traffic to be redirected to the router by enabling Network > DNS > “Override DNS Settings of All Clients” option.

When “Allow Custom DNS to Override VPN DNS” is disabled and the VPN is enabled, the system will use the VPN’s DNS as intended.

It does.. yes…

But then all LAN traffic gets redirected to the WAN DNS (which is set to Quad9) and bypasses the RPi DNS altogether - which is not what I want.

I ONLY want the DNS redirected for VPN clients connected in either Global or Policy Mode.

We may not have explained this clearly earlier.

When you enable or disable the VPN, would it be acceptable for you to manually toggle this option to redirect DNS?

At the moment, this process cannot be automated.
However, we will raise this requirement with our product team to evaluate whether it can be supported in a future release.

Also, if you can provide the corresponding ASUS configuration (particularly how it handles DNS routing logic when VPN state changes), it would assist us in evaluating feature parity and potential implementation options.

Thank you for your cooperation and patience.

Not really - this would then redirect non-vpn clients to the WAN DNS at the same time, which is not what I want to do with them.

This is how the Merlin firmware for Asus implements PBR for VPN clients: Policy based routing · RMerl/asuswrt-merlin.ng Wiki · GitHub

As a side-note this is how it implements DNS redirection in general - allowing for selective DNS redirection for clients (ie routing some clients to LAN, some to WAN, or some to a whole other specified DNS provider)

Oh, so this functionality is provided by Asuswrt-Merlin rather than the stock ASUSWRT firmware.

If you have experience with advanced third-party firmware, you may consider installing and configuring luci-app-pbr, which can offer part / similar policy-based DNS routing behavior. But please note that this falls outside our official support scope.

Of course, we will also continue evaluating the feasibility of adding such features to the GL UI with our product team.