1

On my raspberry Pi 3B, attempting to access the internet for downloads fails. Anything that uses it (chromium, apt-get, etc) does not work, giving errors such as DNS server not found, or just hanging. However, ping google.com or ping 10.0.0.1 works just fine (connecting to my Router's setup page via 10.0.0.1 in chromium seems to work also)

This issue occurs on both LAN and WiFi.

I have looked at other forums which have similar issues, but their solutions do not seem to apply - the LAN lights are active on the Ethernet port, the MTU value of all interfaces is set to 1400, and my Router has DHCP enabled (the PI is detected)

  • OS: Raspbian 4.9.80 v7
  • Manufacturer: element14
Fuzzyzilla
  • 119
  • 6
  • Might not be relevant, but I should mention this issue just started today, and this is the first time this has ever happened on this board (it worked fine yesterday!) – Fuzzyzilla Apr 04 '18 at 04:45
  • It would help if you can be more specific about the errors – if you can, cut and paste the error message. It would also help to know the OS version you're using and how you are connected to the Internet. If you have other machines on the network, how is their connectivity? – dlu Apr 04 '18 at 05:01
  • Fuzzyzilla, you should add your comment to your question. – NomadMaker Apr 04 '18 at 05:03
  • @dlu My OS is Raspbian 4.9.80 v7 (fresh install today). In the case of errors, well, there just aren't any - chromium simply gives a generic DNS not found, and `apt-get` downloads trees, then hangs on 0%. – Fuzzyzilla Apr 04 '18 at 05:04
  • Is the DNS server not found or is the address you are asking for unresolved? – dlu Apr 04 '18 at 05:06
  • @dlu Guess I got the error wrong, sorry. Here is the error: `This site can't be reached. google.com took too long to respond. ERR_CONNECTION_TIMED_OUT` – Fuzzyzilla Apr 04 '18 at 05:09
  • Ok, that sounds like you may have a connectivity issue or a routing problem. – dlu Apr 04 '18 at 05:18
  • Just posted some testing steps. – dlu Apr 04 '18 at 05:27
  • Or it may be that you don't have a good address configured for the DNS server. – dlu Apr 04 '18 at 05:46

1 Answers1

0

In cases like this it helps to break the problem down – which in turn means knowing something about the pieces that need to line up for a network connection to succeed. Much of this information isn't specific to the Pi or it's OS, but it will be helpful to know the tools and foibles of the particular hardware and OS that you are using.

This question and its answers may help: How do I set up networking/WiFi/static IP address?.

Testing with other devices on the same network may also help pinpoint where the problem lies. Rebooting often works wonders.

In general you want to start close and expand as you test, so you might:

  1. Check that your network is up and basically working by trying to ping a machine on your local net by IP address (ping 10.0.0.42).
  2. Check that you can talk to your router by attempting to ping the internal interface of your router by IP address (ping 10.0.0.1).
  3. Check that your router is routing by doing a ping to the external interface of your router by IP address (ping 1.2.4.192).
  4. Now try to reach your router's router by attempting to ping your router's default route by IP address (ping 1.2.4.8). Success means that you can reach a remote machine – specifically the machine that your router will be forwarding all of your Internet traffic to
  5. Now verify that it is all working with a to ping something far away by IP address (ping 8.8.8.8).

If those all work then you have a network connection that is working at the IP level. If any of them fail, then that is the spot to start investigating further.

Next test that DNS works. You could:

  1. Use dig to check it DNS requests are getting resolved. Use a well known server by IP address (e.g., 8.8.8.8 or 1.1.1.1) – dig google.com @1.1.1.1
  2. Then try the same thing using the DNS server that you have configured.
  3. Then try pinging a "new" host (one that you're confident isn't in your local resolver cache.

If you don't have dig or nslookup or a similar tool you can use ping instead.

dlu
  • 439
  • 3
  • 19
  • Thank you for this answer! On my pi. steps 1-5 work, though I don't really know what 4 or 5 mean (forgive me!). As for the DNS testing, I get a `dig: command not found` spit back at me. I might need to install dig, but that's not really an option now! I should also point out that connecting to 10.0.0.1 via chromium *does* bring up my router's config page, so I don't think it's chromium's fault. – Fuzzyzilla Apr 04 '18 at 05:33
  • Added some more... Yes, chromium sounds like it is behaving (although there may still be a DNS problem). – dlu Apr 04 '18 at 05:45
  • `ping google.com` functions correctly. I've also tried for a lot of other sites, and they all ping as expected. EDIT: found a site that doesn't work - the one that `apt-get` is trying to access! `ping mirrordirector.raspian.org` drops all packets. – Fuzzyzilla Apr 04 '18 at 05:49
  • You can use ```ping``` instead of ```dig.``` – dlu Apr 04 '18 at 05:49
  • Firewall? Try ```curl``` (```curl google.com```) if you have it installed? Since you can get to 10.0.0.1 the problem is probably at your router or beyond. – dlu Apr 04 '18 at 05:51
  • So that site might be down. The address resolves for me but everything times out after that. – dlu Apr 04 '18 at 05:54
  • `curl google.com` hangs. I would agree that the issue is probably the router -> internet stage, but every other device (wired or wireless) on the network has perfect connectivity. – Fuzzyzilla Apr 04 '18 at 06:00
  • Eventually curl should time out with an error? What is the error message? Since everybody else on the network is connecting it seems like the problem is on the Pi and is DNS related. That's where I'd look next. – dlu Apr 04 '18 at 06:05
  • Yep, you're right - Curl times out with `curl: (7) Failed to connect to google.com port 80: Connection timed out`.The weirdest part of this issue for me is that it was working fine, then died without me changing anything... – Fuzzyzilla Apr 04 '18 at 06:10
  • Have you rebooted the Pi? It may be an OS bug, maybe a problem with resource allocation or caching. Odd in any case. – dlu Apr 04 '18 at 07:08
  • Have you rebooted the internet router? What gives `cat /etc/resolv.conf`? Can you ping the nameserver in that? – Ingo Apr 04 '18 at 11:22
  • @dlu I've restarted the PI several times, even let it sit unplugged for ~12 hours. I've also reinstalled the OS twice, and the problem persists - to me, this seems like a BIOS or hardware issue/failure... – Fuzzyzilla Apr 04 '18 at 16:35
  • I don't think so. You've demonstrated that the underlying network is functioning so it seems that both the hardware and software are very likely to be good. Compare the result of ```curl google.com``` with ```curl 172.217.1.78``` (one of the IP addresses for google.com). If the first fails and the second succeeds you have a DNS issue. Which probably translates to a DHCP issue. – dlu Apr 04 '18 at 17:03