I have recently installed my own OpenVPN server on digital ocean following this guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-14-04

I tried playing with the following option:

push "redirect-gateway def1 bypass-dhcp"

When it is commented out, my original IP is visible, when this option is on, I can only ssh or ping servers by ip, but cannot by any means get their name servers resolved.

I tried all the solutions offered here: openvpn client connects to server but name resolution does not work

But unfortunately nothing worked.

Server: Ubuntu 16.04 @ Digital Ocean Client: tried both Viscosity and TunnelBlick (OSX El Capitan)

  • Is "bypass-dchp" strictly necessary in this instance? – Sam3000 Oct 2 '16 at 1:15
  • Otherwise my original up is visible as I noted, thus Von does not work – Oleg Belousov Oct 2 '16 at 1:16
  • Sorry I should have clarified, does [push "redirect-gateway def1"] without the "bypass-dchp" element help? – Sam3000 Oct 2 '16 at 1:17
  • Trying now let me see – Oleg Belousov Oct 2 '16 at 1:18
  • Hold on, are you referring to google's DNS server there? If so, DCHP and DNS are very different things - DCHP is required to automatically provide IP addresses to things that connect to your VPN server, DNS is to turn "www.google.com" into its IP address for computers to understand and use. – Sam3000 Oct 2 '16 at 1:19

This is just a guess, but if your current DNS servers are assigned by your ISP for example, they will stop resolving domains for you when your VPN is up. Because your public IP address changed, your ISP no longer recognizes you as one of their customers. Rationale: your queries come from an IP address that doesn't belong to them.

If you use an open DNS resolver like Google ( this should work.

You should check which name servers are current defined on your client. Depending on your OS you may have to tweak network settings, the OpenVPN config will not always be able to 'push' the desired settings to the client.

Here is a link that describes the problem and how to fix it with an up/down script: OpenVPN DNS resolution not working

On a Linux platform this command should tell you which name servers are currently active:

cat /etc/resolv.conf

You can test with nslookup or dig. for example type:


And then:

server x.x.x.x  -> where x.x.x.x is the IP address of the name server your want to test

And then type a domain name ie. superuser.com and see the results.

  • Added that one to the server, did not work unfortunately, I did my share of googling – Oleg Belousov Oct 2 '16 at 1:48
  • Also tried some client side hook which did not work either – Oleg Belousov Oct 2 '16 at 1:48
  • Ok it is solved, any idea how to do it automatically? – Oleg Belousov Oct 2 '16 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.