I have connected my desktop computer (running Ubuntu 16.04) to my Raspberry Pi through a router (ethernet connection). My computer can access internet with USB tethering from my phone. I can SSH to the Raspberry Pi, but it cannot connect to internet.

ping google.com says ping: google.com: Temporary failure in name resolution

sudo apt update says Temporary failure resolving 'raspbian.raspberrypi.org'.

How to forward my computer's internet connection to Raspberry Pi?

The router is only connected to the desktop and the Raspberry Pi.


I directly connected the Raspberry Pi to my computer through ethernet, and connected a monitor to the Pi. Then I ran ifconfig in the Pi to get its IP address (it was, maybe this is the default?)

Then I sshed to the RPi from my desktop, and now it is connected to the internet. However, this does not solve the issue when RPi is connected to a router and there is no way to connect a display.

  • 1
    This is a question about your computer (and router). The Pi will use any connection with DHCP.
    – Milliways
    Commented Jul 17, 2019 at 8:21

2 Answers 2


If you can ping an IP address (like but not a URL, you have a problem with accessing a DNS server to look up names.

It's really hard to understand how your system is connected with the details you have provided but I'm hoping this helps you look in the right place.

(Sorry to use "Answer" but I don't have enough rep to "Comment")


What you call a router is probably just an ethernet switch, which means it doesn't matter whether you connect your Pi to the linux computer through it or using a direct cable. The linux computer can be configured as a DHCP server and NAT router for the Pi, I'm pretty sure this can be done using the network manager GUI so you don't have to tweak config files. Have a look at https://help.ubuntu.com/community/Internet/ConnectionSharing#GUI_Method_via_Network_Manager_.28Ubuntu_14.04.2C_16.04.29 as a starting point.

  • Where is the problem with the Raspberry Pi you solved with your answer?
    – Ingo
    Commented Jul 22, 2019 at 11:43
  • 1
    Where the actual problem is is not really clear from the description. I prefer to point to possible things to look at instead of downvoting due to wrong SE site. Getting networking right is a common issue for Raspi users, so it might be helpful to others having similar issues. Commented Jul 22, 2019 at 20:14

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.