From charlesreid1

The Problem

If you're having trouble with your OpenVPN, and your symptoms match the following:

  • You can ping the virtual network gateway from the virtual network client, and vice versa (i.e., ping -I tun0 10.8.0.1 works)
  • You can see packets passing back and forth across the network when you run ping, by monitoring your tunnel interface tun0 with Wireshark
  • You see problems with DNS packets when you monitor your tunnel interface tun0 with Wireshark

The Cause

Check your /etc/resolv.conf file, where your DNS server settings are. Your DNS settings were probably obtained automatically from your gateway (i.e., from your ISP) and thus from your networking manager (at the operating system layer). And those DNS settings are likely for that ISP's customers ONLY, not for your random virtual private server sitting in Cleveland or Hong Kong where you're running your OpenVPN server. So, it refuses DNS queries, and all your tunneled DNS queries to your ISP's DNS servers are rejected.

That means you can't run ping -I tun0 google.com because your computer can't find google.com, because it's asking a server that expects queries from a certain block of customers, not from random people.

The Solution

Edit your /etc/resolv.conf and add some DNS servers that accept queries from anyone: https://www.wikileaks.org/wiki/Alternative_DNS