Here's how you fix the issue: This is a bug that's fixed in upstream NetworkManager. That said, the various GUI tools which write the NetworkManager config files haven't been updated to ensure that DNS leaks are prevented when using vpn connections.
To prevent system dns from appearing and being used in /etc/resolv.conf when using a VPN, edit your vpn configuration (i.e. the file in /etc/NetworkManager/system-connections/<vpn name>) so it's something like this: [ipv4] dns=<vpn dns server ip address>; ignore-auto-dns=true method=auto dns-priority=-1 the negative dns-priority means only this dns server will be used. Then reload the config file: sudo nmcli c reload <vpn name> and toggle the vpn. /etc/resolv.conf should now only include the one dns ip address defined in the config file. References: https://developer.gnome.org/NetworkManager/stable/settings-ipv4.html https://bugzilla.gnome.org/show_bug.cgi?id=758772 ** Bug watch added: GNOME Bug Tracker #758772 https://bugzilla.gnome.org/show_bug.cgi?id=758772 -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to network-manager in Ubuntu. https://bugs.launchpad.net/bugs/1211110 Title: network manager openvpn dns push data not updating system DNS addresses Status in network-manager package in Ubuntu: Confirmed Status in openvpn package in Ubuntu: Confirmed Bug description: [Triage Notes] Apparently fixed on Ubuntu 17.04, nobody caring about LTS versions. Please see wall of text on comment 50 for a long excuse. [Original Description] When IPv4 Method is set to Automatic VPN, DNS address recieved from OpenVPN server do not update resolv.conf. This can be achieved when using a standard openvpn config file by adding the lines: script-security 2 up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf In Network-manager there seems to be no option to run connection specific scripts and the DNS data from the server is ignored. Ubuntu 13.04 Network-manager 0.9.8.0-0ubuntu6 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1211110/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp