I have a raspberrypi zero w using pivpn, was working fine until I upgraded to stretch, now I can still to it via the vpn and do ssh, but I have no internet.

Trying a few things in the pi, when I do a ping to any ip address like or any other, it sends-receives the packages with no problems, but if I try the host name, it fails: ping: www.google.com: Temporary failure in name resolution. If I do a traceroute it completes but is slow, 6-15s each ip.

my /etc/resolv.conf has this:

# Generated by resolvconf
nameserver XXX.XXX.XXX.XXX

Where XXX.XXX.XXX.XXX is the router's ip address that I can ping with no issues.

my /etc/network/interfaces has this: (interfaces.d folder is empty)

source-directory /etc/network/interfaces.d 

I don't have installed ufw or any other firewall on the pi at least not yet.

I wish I could just format and reinstall, however that pi is in a remote location and is not easy to just go there.

2 Answers 2


As @RalfFriedl stated in his answer you have to check your DNS resolution. For this I use dig. If you haven't already done install it with sudo apt install dnsutils. Then check if your DNS resolution works in general by querying googles DNS server for googles name google.com:

rpi ~$ dig @ google.com

; <<>> DiG 9.10.3-P4-Raspbian <<>> @ google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15493
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;google.com.                    IN      A

google.com.             299     IN      A

;; Query time: 28 msec
;; WHEN: Mon Aug 13 11:23:10 UTC 2018
;; MSG SIZE  rcvd: 55

In the ANSWER SECTION you can see what ip address google.com. has and what server was asked (SERVER:

Now try dig google.com. The result will show you what server is asked by default. It should be XXX.XXX.XXX.XXX and it should show you if you got an answer. If not then you know where to look at: your nameserver XXX.XXX.XXX.XXX has a problem then.


As the message says, your problem is not internet access, it is DNS resolution.

If your /etc/resolv.conf lists the router, then for some reasons the router doesn't resolve DNS requests for your PI.

Try watching the network packets with tcpdump on port 53, and try whether nslookup works.

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.