OpenVPN DNS error - Checking location info

Hello,
since a new system install OSMC (Version Nov’19) refuses to connect Addons to the Internet. I found out, that the Problem is in the VPN connection. When Logging into a Provider the NordVPN Addon shows the following error message:

Connected, checking location info…’ checking location info

I changed th.e nameserver entry in the resolv.conf file in /etc to:
nameserver 8.8.8.8
(As adviced to an other user here:
VPN Manager troubles - #6 by sam_nazarko)

Now Kodi it connects to the VPN server. Since this solution gives an DNS leakage and the file entry is resetted everytime i restart kodi i am asking you for any advice how to solve this problem.

TY Wolf

OpenVPN Log:

arent you paying nordvpn for support ?

NordVPN is working on all machines: 2xAndroid, 1xWindows
So i guess its a specific Problem with Kodi or OSMC.

It looks like the NordVPN AddOn uses …/libs/common.py to change the DNS settings, and that relies on the script /etc/openvpn/update-resolv-conf. That script should come with the OpenVPN install, but I’d check to make sure it exists.

if xbmcvfs.exists(“/etc/openvpn/update-resolv-conf”):
infoTrace(“common.py”, “Found update-resolv-conf and will call it when the connection goes up and down”)
append_file.write(“dhcp-option DNSSEC allow-downgrade\n”)
append_file.write(“dhcp-option DOMAIN-ROUTE .\n”)
append_file.write(“script-security 2\n”)
append_file.write(“up /etc/openvpn/update-resolv-conf\n”)
append_file.write(“down /etc/openvpn/update-resolv-conf\n”)
elif xbmcvfs.exists(“/etc/openvpn/scripts/update-systemd-resolved”):
infoTrace(“common.py”, “Found update-systemd-resolved and will call it when the connection goes up and down”)
append_file.write(“script-security 2\n”)
append_file.write(“setenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n”)
append_file.write(“up /etc/openvpn/scripts/update-systemd-resolved\n”)
append_file.write(“down /etc/openvpn/scripts/update-systemd-resolved\n”)
append_file.write(“down-pre\n”)
else:
errorTrace(“common.py”, “To attempt a DNS fix, you need to install update-resolv-conf script in /etc/openvpn”)
errorTrace(“common.py”, “Alternatively for systemd enabled installations, install update-systemd-resolved in /etc/openvpn/scripts”)
errorTrace(“common.py”, “After installation of one of the scripts, apply the DNS fix again.”)

I use Openpyn myself and it works and appears to use the same script, which you can get here if you don’t have it.

I haven’t tried your setup, so that’s all a guess from trying to follow the code. All I can say for sure is it works on my OSMC using Openpyn.

1 Like

Hi @gecko ,

As @DSAnduril suggests the update-resolv.conf script is provided but the system needs an additional package installed, in order to automatically update /etc/resolv.conf. I suggest try installing openresolv:

sudo apt-get update
sudo apt-get install openresolv

Thanks Tom.

1 Like

@DSAnduril: TY for your advice. I checked update-resolv-conf : its already there

@Tom_Doyle: Problem solved!
TY for helping. I wonder that OSMC or the NordVPN app doesnt provide these additional packages by itself…
Though i was reading a lot of threads, i´d have never found the solution by myself.

Wolf

Hi,

I think its because its not required by default, as manually setting dns entry works; I think if it had been manually set via myosmc dns shouldn’t need to be reset when kodi is restarted. Also there are alternatives to open-resolv.

Thanks Tom.