DNS issues with OpenVPN connection on Debian/Ubuntu GNU/Linux

Sometimes OpenVPN account connects but nothing is accessible. However, you are able to ping some remote IP address in terminal. It’s a DNS issue which may happen when you use DNS server, which isn’t located in your LAN. Here are several ways to resolve that.

1. Use custom script provided with OpenVPN.

This is a recommended method, it will allow you to use correct DNS IPs provided by VPN server. It is the method to make geolocation tracking tools to work correctly.
Edit OpenVPN configuration file inside gopenvpn client or with gedit. You need run in terminal:
sudo gedit /etc/openvpn/openvpn-plain-default-123456.conf
Remember to replace ‘openvpn-plain-default-123456.conf’ with the actual file name you have in /etc/openvpn. Add following lines at the end of configuration file:
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

Save the file. Make sure you have /etc/openvpn/update-resolv-conf and permissions allow

Leave a Reply