Issue Using OpenVPN on Ubuntu Based System

I use Surfshark VPN on all of my Android based devices and also my Windows notebook when it’s working. However when I installed it on POP OS it installed but you could not get out. I tried a few things so eventually uninstalled and notified Surfshark. (Surfshark uses OpenVPN.) Surfshark notified me to delete resolv.conf and replace with another file named the same but with their servers IP addresses in it. Now to me this is wrong so I investigated further.

I found that the problem is the server in the resolv.conf file. (Ubuntu appears to use this as some form of local caching server though is part of systemd-resolved that can be set up in different configurations.) From all accounts chrome also uses it and possibly other apps. However it can play havoc with some apps though it’s only Surfshark that so far has an issue with it on my machine. The other thing is that every time you restart resolv.conf is overwritten with the defaults so just adding Surfsharks IPs will only work in that session. I also came across some information that indicated that if you created a completely new file it would not be overwritten, but I have not come across any confirmation and I have not tried it yet. I am still looking further into this but think that it would be good for a video as others may or have come across it. This is resolv.conf is updated from another file elsewhere and I am looking into this currently. On a public forum, (stackxchange?), it was stated by one person that removing slows down Ubuntu. I think most apps probably just use the host file and DNS. One of the issues with using a VPN is that some banks, etc block you logging in if they recognise that you are coming via a VPN so you need to disable and revert as and when necessary.

I think the problem is the OpenVPN config file they give you, but I can’t prove that unless I see it.

Under no circumstances should a VPN provider require you to edit a config file that’s part of the distribution, /etc/network/interfaces, /etc/resolv.conf, etc. In a standard OpenVPN config file, there’s usually additional syntax that has to be added manually.

With some other operating systems, they may handle OpenVPN config files differently. In the OpenVPN config file, there’s an optional option (I forgot what it’s called) that tells it to use the DNS providers that belong to the OpenVPN provider while connected. Since that option is optional, it’s often omitted. I’ve had to manually edit OpenVPN config files provided by VPN providers and add that option in there. That option does require the installation of an additional package.

The reason why I don’t know the option name off the top of my head is because it’s been a long time since I had to do this. If you’re unable to find it, some time next week (or possibly later this week) I should hopefully have more available time to try and jog my memory.

1 Like