I want to share some experiences working with VPN from Ubuntu. I had some trouble using OpenVPN as after connecting I couldn’t access any resource referenced by a domain name.
I couldn’t find any solution to this problem but finally after trying a few things out, I have come out with a solution I want to share below.
Assuming you have OpenVPN installed and working ‘.ovpn’ configuration file (but without proper DNS resolving) follow the steps below:
1. Install resolveconf

sudo apt-get install resolvconf

2. Link your auto-generated resolve.conf to existing ‘/etc/resolve.conf’

cd /etc
#backup your original resolve.conf just in case
cp resolv.con resolv.conf.orig
ln -s /etc/resolvconf/run/resolv.conf /etc/resolv.conf

3. Add the following lines to the bottom of your ‘.ovpn’ configuration file:

up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

4. Run openvpn with the following flags (as root):

openvpn --script-security 2 --config youropenvpnconfig.ovpn

That should do it.
Enjoy