in Linux

How to fix DNS leak with OpenVPN & Network Manager

Adding following lines into the .ovpn file before I import it to Network Manager on Ubuntu fixed DNS leak with my VPN connection established by NetworkManager.

script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

These lines should be added below the lines of initial commands and before the lines of certificates.

Leave a Reply


  • How to keep VPN connection alive automatically on debian – Ertuğrul Harman

    […] Lastly, you should check if there is a DNS leak, while your VPN is active. can be used for this purpose. If you use OpenVPN and you have DNS leak, check this post. […]