When connecting to a VPN by using OpenVPN or other Linux software, the system will not add the DNS server(s) of the network you are connecting to, to the /etc/resolv.conf file.
This implies that you will be able to ping the IP addresses of all computers being part of the network you are connecting to, but not their respective hostnames. This can be a problem in certain situations.
- This issue is basically universal on Linux and affects the vast majority of distributions
- This issue does not occur on MS Windows
I'm going to show you the solution I found when using OpenVPN, which comes preinstalled on EasyOS (and usually also on other distros):
1) Go here to download and install the package openresolv_3.12.0-3_all.deb
2) Go here and download (or just copy / paste the code) the script update-resolv-conf.sh . Place it on /etc/openvpn making it executable and keeping its name
3) add these parameters to the command through which you are launching OpenVPN:
Code: Select all
--setenv PATH '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --script-security 2 --up /etc/openvpn/update-resolv-conf.sh --down /etc/openvpn/update-resolv-conf.sh --down-pre
4) Enjoy your ability to ping all the hostnames of your remote network computers when you are connected through OpenVPN.