Question about Openvpn

Hi there
I use many VPN Providers such as Unlimited VPN ,Nord VPN and Express VPN
I configured OpenVPN on my router and want to block outside DNS


When I use this command " block-outside-dns " in my config file , Ovpn can't be connected
I also tried this command dhcp-option DNS X.X.X.X and nothing !!!! It only works when I set DNS in " Use custom DNS servers " in WAN and I have to change custom DNS when I want to switch between VPN Providers,Just prefer not to do that

What command Should I use in my config to block outside DNS?!! Just wanted to use VPN Provider's DNS

The easiest way is to disable peer DNS and use a major public upstream DNS provider.
It should work fine for VPNs thanks to geolocation-based load balancing.

Another way is to utilize OpenVPN hook scripts to apply the settings pushed by the server.

Alternatively, it should be possible to use hotplug scripts to change DNS based on the interface state.

3 Likes

See last part of manual: https://github.com/StreisandEffect/streisand/wiki/Setting-an-OpenWrt-Based-Router-as-OpenVPN-Client