0

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 8.8.8.8(googledns) 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 8.8.8.8 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.

1

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 8.8.8.8 for googles name google.com:

rpi ~$ dig @8.8.8.8 google.com

; <<>> DiG 9.10.3-P4-Raspbian <<>> @8.8.8.8 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

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             299     IN      A       216.58.214.46

;; Query time: 28 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; 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: 8.8.8.8#53(8.8.8.8).

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.

1

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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