-1

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

Aaron
  • 559
  • 6
  • 8
  • 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? – Steve Robillard Apr 03 '16 at 19:22
  • 2
    Edit in the output from ping google.com. – goldilocks Apr 03 '16 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 03 '16 at 21:06
  • Sounds like you have a problem with your internet connection. – Jacobm001 Apr 04 '16 at 18:31
  • But ssh works fine. – Aaron Apr 04 '16 at 18:39
  • The fact that one network host connected to a private network can reach another network host connected to the same private network is not proof that either should be able to reach a separate private or public network. Judging by the error message you mentioned–it is clear that your Raspberry Pi does not have a DNS name server set to search for hostnames. – medbot Apr 05 '16 at 01:44
  • @Aaron: I assume you're using SSH from within the same network? I think you're having trouble getting out of the local private network. – Jacobm001 Apr 05 '16 at 04:13

2 Answers2

1

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.

Kenneth Spear
  • 436
  • 2
  • 5
  • 12
  • 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 07 '16 at 12:07
  • You're on a private network so you need to give permission to your RPi. – ahmetertem Apr 07 '16 at 13:55
1

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

goobering
  • 10,730
  • 4
  • 39
  • 64
dilumj
  • 41
  • 3