[OpenVPN] Ubuntu/LinuxMint problems with DNS
As an OpenVPN client, Ubuntu (14.04 probably also 13.04 and 12.04) and LinuxMint (the releases based on Ubuntu) have a common DNS resolution problem (when connected to an OpenVPN server).
The same bug was reported here :
When IPv4 Method is set to Automatic VPN, DNS address recieved from OpenVPN server do not update resolv.conf.
The status of the bug changed to ‘Confirmed’ because the bug affects multiple users, but no updates until now !
script-security 2 up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf
Here is a little explanation:
--script-security level [method]
According to OpenVPN official documentation this directive offers policy-level control over OpenVPN’s usage of external programs and scripts. Lower level values are more restrictive, higher values are more permissive. Settings for level:
0 — Strictly no calling of external programs.
1 — (Default) Only call built-in executables such as ifconfig, ip, route, or netsh.
2 — Allow calling of built-in executables and user-defined scripts.
3 — Allow passwords to be passed to scripts via environmental variables (potentially unsafe).
The method parameter indicates how OpenVPN should call external commands and scripts. Settings for method:
execve — (default) Use execve() function on Unix family OSes and CreateProcess() on Windows.
system — Use system() function (deprecated and less safe since the external program command line is subject to shell expansion).
The –script-security option was introduced in OpenVPN 2.1_rc9. For configuration file compatibility with previous OpenVPN versions, use: –script-security 3 system
up/down a reabout shell command to run after TUN/TAP device open/close
Everything should run OK this time. Think about restarting OpenVPN:
service openvpn restart
killall openvpn; openvpn /etc/openvpn/client.conf