0

I recently purchased a VPN (PIA) and set it up on my Pi 3 using openVPN and I am not sure if it is working or not.

When I do an ifconfig, I do get a tun0 interface, but when I open a browser and try to connect to a webpage, I get this error:

Error resolving 'google.com': Name or service not known

My torrents seemed to be running okay, but when I tried the IpMagnet tool nothing comes up and I don't know if this is good or bad.

Any insight/help would be appreciated! Thanks!

**EDIT:**I talked to PIA's support and they basically said there's no real support yet for Raspbian.

So to make it easier on myself I switched to Ubuntu Mate, downloaded the PIA app and it worked perfectly. For anyone else trying to do the same, I recommend switching to Ubuntu mate as well. Sorry there isn't a real answer here. The troubleshooting guide below is an awesome help though!

1 Answer 1

1

Summary

  1. Try to ping 8.8.8.8. If you can't, your Internet connectivity is broken and you need to fix that.
  2. Check your /etc/resolv.conf to make sure it has working nameservers in it. Run host example.comnameserver to check that it's producing good replies.
  3. Replace the nameserver in /etc/resolv.conf with 8.8.8.8 (after checking as per the two steps above) and see if ping example.com= works. If so, you have things working temporarily but need to figure out whyresolv.conf` is not being set up properly.

Details

All computers on the Internet are addressed by IP addresses that look like 8.8.8.8. To help people, a system called DNS can translate names, such as google.com into these addresses, but it's very important to remember that the Internet Protocol (IP) networking itself never uses these for communication, only the numbers.

The way DNS works is that code on your computer called the "resolver" sends the name to a DNS server (which it obviously must know the IP address of) and the server sends back the address for that name.

The message Error resolving 'google.com': Name or service not known indicates a DNS error; this is on a level above IP connectivity. Here's how to start debugging it.

The name resolution code in your system is trying to send messages to DNS servers to get the IP addresses of names like google.com. To do this it must already know the address of one or more DNS servers. These addresses are stored in /etc/resolv.conf.

If in that file you don't see any nameserver lines, your networking system did not add them. In that case you can try to get things working temporarily by editing the file to add a nameserver such as Google's public resolving server:

nameserver 8.8.8.8

(This file is generally regenerated on reboot or networking restart; you will need later to work out why your system didn't automatically put addresses in that file.)

If there is an address in there, you should try to ping it to see if you have IP network connectivity to that address:

ping -n 8.8.8.8

If you don't have connectivity, either the name servers there are incorrect or your lower-level networking setup is not working. In the former case you can simply replace the nameserver(s) with one known to be working, as above (but do the same ping test on that one). In the latter case, you need to look at why you don't have Internet connectivity; your VPN setup instructions will hopefully provide some help here.

You can query a server directly to see if it's giving you good replies using the host command:

$ host example.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases: 

example.com has address 93.184.216.34
example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946
4
  • Thank you for the response. I was unable to ping 8.8.8.8, 100% packet loss. I checked my resolv.conf and tested it for replies, no luck there either, "no servers could be reached." Changed nameserver to 8.8.8.8 and tried again, no luck there either. I stopped running openVPN and tried all of the tests again, and they all worked...Finally, I started openVPN again and pinging 8.8.8.8 works, however the host example nameserver tells me again that no servers could be reached.
    – ddrossi93
    Apr 8, 2017 at 23:07
  • I've just added to paragraphs to the start of the "Details" section; I hope that will help make it clear why, if you can't ping an IP address, checking your resolv.conf or any other part of the DNS doesn't make sense.
    – cjs
    Apr 9, 2017 at 2:41
  • When I type host example.com nameserver with nameserver in italics, that means fill in the IP address of your name server, not type the string "nameserver." That's how you tell if an individual IP address, such as one from your resolv.conf, has a working name server running on it.
    – cjs
    Apr 9, 2017 at 2:42
  • That's what I did. Haha all good.
    – ddrossi93
    Apr 9, 2017 at 2:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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