I recently bought a VPN service and have been playing around with the settings and functions but found that I was still leaking my IP address to some sites.

Akamai Technologies kept serving up websites close to my Geolocation meaning that it knew where my IP address originated.

Turns out it was an issue with my ISP provider. I have been looking into fixing the DNS leak using DNSCrypt but the only guide I could find is for Windows and Mac machines.

I currently use OpenVPN and found this related (and unanswered) question in Ask Ubuntu: How do I fix a DNS leak?

That points to this guide: http://www.ubuntubuzz.com/2015/09/how-to-fix-openvpn-dns-leak-in-linux.html

But it does not say what the name of the .ovpn file is. I searched for the .ovpn file on my system but couldn't find anything with that extension.

Any assistance is greatly appreciated!

  • If there is an .ovpn file for your connection it's your .ovpn file, you created it. The author of the article can't know what you named it. Nov 12, 2017 at 2:37
  • I haven't created an .ovpn file. The guide also mentioned that it would update the /etc/resolv.conf folder automatically. My machine currently does not have a /etc/resolv.conf folder. Not too sure how to proceed. I am running OpenVPN.
    – Berrik
    Nov 12, 2017 at 2:47
  • 1
    Are you routing all traffic through this VPN, or only some of the traffic? You also need to be careful as anyone else on the VPN could tunnel back into your machine, so you should set up appropriate firewall measures. Does the VPN provider send DNS info? It should be sending suggested addresses for DNS when your computer requests an IP on that network, from DHCP.
    – dobey
    Nov 12, 2017 at 2:51
  • 1
    @OrganicMarble NetworkManager doesn't use standard OpenVPN config files to manage VPN connections.
    – dobey
    Nov 12, 2017 at 14:22
  • 1
    I was looking for a low impact VPN service. I managed to fix the DNS leak by finding the DNS servers my VPN provided. I simply updated my DNS connection and this fixed the DNS leak.
    – Berrik
    Nov 12, 2017 at 17:00

1 Answer 1


If you have a DNS leak with 17.x or 18.04 as indicated by checking on www.browserleaks.com or dnsleaktest.com, For 16.04 LTS, see the link below.

  1. Shut off your VPN connection

  2. Attempt to undo any .conf file edits you've wasted time already making. If you've been trying a lot of various suggestions, your best good chance might be to do a fresh install and ensure you've also installed networkmanager-openvpn-gnome as Ubuntu does not have VPN config importing provided by default.

  3. Install dnsmasq

    sudo apt update sudo apt install dnsmasq

  4. Disable resolved

    systemctl disable systemd-resolved.service systemctl stop systemd-resolved.service

  5. Remove /etc/resolv.conf and create a new one:

    rm /etc/resolv.conf nano /etc/resolv.conf

  6. Enter into your empty .conf file:

    nameserver that's all!

  7. save and exit out of your new resolv.conf file.

  8. Edit your NetworkManager.conf file

nano /etc/NetworkManager/NetworkManager.conf

and add the following:


beneath the lines, [main] and plugins=ifupdown, keyfile

this is what your edited file should look like

plugins=ifupdown, keyfile

save and exit.

9.Back out of the terminal, and reboot the system and check your dnsleak test site for results.

With thanks to Anonymous VPN whose solutions for Leaks on Ubuntu/Network Manager seem well researched and successful. THEY WORK and when no other solutions worked for me, these did. The above shown solution works for Ubuntu 17.x and 18.04 LTS. For 16.04 LTS, [see his other solution]5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.