Everytime I try to use Git or the Dropbox API, I get the same error: Error: Couldn't resolve host.
2 Answers
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?– AaronApr 7, 2016 at 12:07
-
You're on a private network so you need to give permission to your RPi. Apr 7, 2016 at 13:55
Try editing the resolv.conf
file.
sudo nano /etc/resolv.conf
Add the following line:
nameserver 8.8.8.8
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... Nov 28, 2020 at 20:37
ping google.com
.