Summary
- Try to ping 8.8.8.8. If you can't, your Internet connectivity is broken and you need to fix that.
- Check your
/etc/resolv.conf
to make sure it has working nameservers in it. Run host example.com
nameserver
to check that it's producing good replies.
- 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 why
resolv.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