Linux – Disabling DNS change in openvpn client

domain-name-systemlinuxopenvpnvpn

I connect to a VPN with openvpn which sets my DNS to the Google DNS servers (8.8.8.8 and 8.8.4.4). For some reason this does not work on a linux client, only on windows (the effect is that I can't resolve any domain names while connected to the VPN). I would like to disable this feature on the linux client (so it uses its own DNS configuration). How can I do it?

Best Answer

Gnome's network manager with OpenVPN lets you only get Addresses from the VPN server and have your own DNS server and search domains be configured. Not sure if your requirement is for a Desktop System or a server and what desktop environment you are using.

But, there exists a case where you might not be able to access your own DNS service (from the one provided by your service provider) because all your traffic including DNS'es would be routed from the VPN server. In this case you can manually set google's free DNS server addresses there.

Not sure if you are using network-manager's OpenVPN module to configure VPNs. But that would be a better way.

Also this script/tutorial might be of help to you.