Everytime I try to use Git or the Dropbox API, I get the same error: Error: Couldn't resolve host.

  • 1
    How is the Pi connected to the net? Can you browse the web? Did you set a static IP, but not set the DNS/Gateway addresses? What is the output of ifconfig? Apr 3, 2016 at 19:22
  • 2
    Edit in the output from ping google.com.
    – goldilocks
    Apr 3, 2016 at 19:42
  • It's connected via Wifi dongle. I can't access the gui, because I use ssh. I have a static Ip and didn't set dns/gateway. Ping google.com doesn't work: unknown hose.
    – Aaron
    Apr 3, 2016 at 21:06
  • Sounds like you have a problem with your internet connection.
    – Jacobm001
    Apr 4, 2016 at 18:31
  • But ssh works fine.
    – Aaron
    Apr 4, 2016 at 18:39

2 Answers 2


You have a problem with your internet access. If the device you are ssh-ing into the Pi from is on the same network as the Pi itself, it is possible to ssh into it without having actual internet access.

You can confirm that this is the issue this way.

1) SSH into the Pi as you said you are able to do

2) Once you are logged in to the Pi, ping the IP address of the device you used to SSH in to the Pi.

If you can successfully ping the host from the Pi then the issue is what I originally stated.

  • You seam to be right! Pinging my laptop with the local ip address works, but it doesnt work with the global one. So now what?
    – Aaron
    Apr 7, 2016 at 12:07
  • You're on a private network so you need to give permission to your RPi.
    – ahmetertem
    Apr 7, 2016 at 13:55

Try editing the resolv.conf file.

sudo nano /etc/resolv.conf

Add the following line:


Save and close it, then try to ping google.com

  • This did it for me! The nameserver was pointing to my router for some reason...
    – Dovahkiin
    Nov 28, 2020 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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