-2

I've an active subscription with VPNUnlimited, and they have sent a few settings in order to be able to use OpenVPN client with their service. (they have sent me pre-made .ovpn files for each of their servers)

the thing is, I've followed a tutorial to setup OpenVPN in my raspberry pi, and whenever I start the OpenVPN client with the .ovpn file, it authenticate and connects successfully.

this looks great but the problem is after a successfull connection, it looks like DNS configuration is not correct as any trial to navigate/ping any domain name fails, although pinging any IP is succeeded, so it's normally state that there is a DNS problem.

disconnecting the session will restore back the ability to resolve domain names normally and use the built-in web browser to browse websites.

I've searched for a while and found that one possible fix is to add the following line (provided from this question) to the client.conf file in order to force the client to use Google DNS:

dhcp-option DNS 8.8.8.8

but unfortunately it's not working.

this is what is on my screen as a result on connecting to openvpn: enter image description here

and this is the ifconfig after the connection is established: enter image description here

and this is the ifconfig result when I disconnect the OpenVPN client: enter image description here

I hope I could clarify the situation, and if anyone can help me to setup the proper configuration to make my raspberry pi use google DNS (or anything that would work) I would much appreciate it as I can't figure it out yet.

1 Answers1

1

The interface settings are fairly unimportant. Instead - look in /etc/resolv.conf

The OpenVPN client should write this content on connection

nameserver 8.8.8.8
nameserver 8.8.4.4

and restore your original nameservers on exit.

Criggie
  • 2,219
  • 13
  • 25
  • Thank you for your reply, actually it's not. although I describe the full details of what I'm doing, so I don't know why it's not doing it as it supposed to do. – Mohammed Swillam Jan 16 '17 at 10:27
  • @MohammedElSayed perhaps you have some other DNS resolver on the local machine. Please post the content of ```/etc/resolv.conf``` with and without the VPN connected. – Criggie Jan 16 '17 at 19:02
  • Actually the problem was that the contents of the file was not changing when the VPn connects, and when I change the DNS to 8.8.8.8 in the `resolv.conf` file, it solved the problem of DNS not resolving, but also not changing between VPN sessions. I really appreciate your answer :) – Mohammed Swillam Jan 16 '17 at 19:04
  • Are you establishing the VPN as root ? You might need to tweak permissions to allow a the VPN / non-root user to edit the resolv.conf file. – Criggie Jan 16 '17 at 19:40
  • I'm establishing it as root. – Mohammed Swillam Jan 16 '17 at 19:41