Page 1 of 1

Unable to resolve host address from wget [Solved]

Posted: Fri Nov 14, 2014 6:02 am
by netengineer
Hi guys! I'm pretty new to Raspberry Pi and I just encountered some issues just trying to download the necessary codes and stuffs to make my 2.8" tft touchscreen to work my the Pi.

It seems that I'm encountering the following issue when I'm trying to follow LadyAda's instructional steps :

wget: unable to resolve host address 'adafru.it'

some times it manages to resolve and was able to continue on to the next one and then it is unable to resolve again:

wget: unable to resolve host address 'gist.githubusercontent.com'

any other times, it'll just get stucked at the first one.

Why is this happening? Is there a remedy for it? Is this a cause of my personal network?

Thanks for reading! Suggestions appreciated! :D Cheers!

Re: Unable to resolve host address from wget

Posted: Fri Nov 14, 2014 8:02 am
by rpdom
Could you post a link to the instructions you are following so that we can check them out for you? Ta :)

Re: Unable to resolve host address from wget

Posted: Fri Nov 14, 2014 8:35 am
by netengineer
rpdom wrote:Could you post a link to the instructions you are following so that we can check them out for you? Ta :)
Oh yea! Here it is:
https://learn.adafruit.com/adafruit-pit ... sy-install
:D

Re: Unable to resolve host address from wget

Posted: Fri Nov 14, 2014 8:42 am
by B.Goode
Works as written for me -

Code: Select all

pi@raspberrypi ~ $ wget http://adafru.it/pitftsh
--2014-11-14 08:40:11--  http://adafru.it/pitftsh
Resolving adafru.it (adafru.it)... 207.58.139.245
Connecting to adafru.it (adafru.it)|207.58.139.245|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://gist.githubusercontent.com/ladyada/f86f777df68fe41181b0/raw/ [following]
--2014-11-14 08:40:17--  https://gist.githubusercontent.com/ladyada/f86f777df68fe41181b0/raw/
Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 192.30.252.156
Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|192.30.252.156|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: `pitftsh'

    [ <=>                                   ] 13,736      --.-K/s   in 0.1s

2014-11-14 08:40:23 (118 KB/s) - `pitftsh' saved [13736]

I would indeed suspect your networking arrangements.

Re: Unable to resolve host address from wget

Posted: Fri Nov 14, 2014 8:48 am
by rpdom
Thanks. The instructions look ok, and the wget command worked for me. It looks to be a problem with your DNS name resolving.

So, we'll start with some standard checks for that.

Please post the output of the following commands

Code: Select all

cat /etc/resolv.conf
cat /etc/network/interfaces
ping -c 1 8.8.8.8
ping -c 1 google.com
ip route
ip addr

Re: Unable to resolve host address from wget

Posted: Fri Nov 14, 2014 9:25 am
by netengineer
rpdom wrote:Thanks. The instructions look ok, and the wget command worked for me. It looks to be a problem with your DNS name resolving.

So, we'll start with some standard checks for that.

Please post the output of the following commands

Code: Select all

cat /etc/resolv.conf
cat /etc/network/interfaces
ping -c 1 8.8.8.8
ping -c 1 google.com
ip route
ip addr
Thanks rpdom and B.Goode for helping to check it out!

From the commands rpdom posted. I'm getting the following

Code: Select all

root@raspberrypi:/# cat /etc/resolv.conf
nameserver 192.168.1.254
root@raspberrypi:/# cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
address 192.168.1.26	# Static IP I want
netmask 255.255.255.0
gateway 192.168.1.254	# IP of router used
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp
root@raspberrypi:/# ping -c 1 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=44 time=11.7 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 11.728/11.728/11.728/0.000 ms
root@raspberrypi:/# ping -c 1 google.com
PING google.com (74.125.68.138) 56(84) bytes of data.
64 bytes from google.com (74.125.68.138): icmp_req=1 ttl=44 time=8.25 ms

--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 8.254/8.254/8.254/0.000 ms
root@raspberrypi:/# ip route
default via 192.168.1.254 dev wlan0 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.15 
root@raspberrypi:/# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether b8:27:eb:5e:20:c9 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether e8:4e:06:17:70:30 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.15/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever

Re: Unable to resolve host address from wget

Posted: Fri Nov 14, 2014 9:58 am
by topguy
Do you have other WifFi devices connected to that router at 192.168.1.254 ?

I see no obvious errors, but you can test by changing the ip adress in resolv.conf to "8.8.8.8" which is google's DNS server, and see if that helps. ( Or you can lookup your ISP's DNS server and use that. )

BTW: resolv.conf is probably overwritten at reboot.

Re: Unable to resolve host address from wget

Posted: Fri Nov 14, 2014 10:26 am
by netengineer
topguy wrote:Do you have other WifFi devices connected to that router at 192.168.1.254 ?

I see no obvious errors, but you can test by changing the ip adress in resolv.conf to "8.8.8.8" which is google's DNS server, and see if that helps. ( Or you can lookup your ISP's DNS server and use that. )

BTW: resolv.conf is probably overwritten at reboot.
Yep! I do have several other devices connected to that router. Could that be a cause of my network problems?

I added dns-nameserver to /etc/network/interfaces and used "8.8.8.8" to my wlan0, and now it seem to work.
I've managed to saved the files using wget.

But I still think that I'll face unresolvable hostname using wget in future.

Anyway, a big thank you to Topguy and the rest of the guys who's check out my post ! Appreciate it! :D

Re: Unable to resolve host address from wget

Posted: Fri Nov 14, 2014 11:22 am
by netengineer
netengineer wrote:
topguy wrote:Do you have other WifFi devices connected to that router at 192.168.1.254 ?

I see no obvious errors, but you can test by changing the ip adress in resolv.conf to "8.8.8.8" which is google's DNS server, and see if that helps. ( Or you can lookup your ISP's DNS server and use that. )

BTW: resolv.conf is probably overwritten at reboot.
Yep! I do have several other devices connected to that router. Could that be a cause of my network problems?

I added dns-nameserver to /etc/network/interfaces and used "8.8.8.8" to my wlan0, and now it seem to work.
I've managed to saved the files using wget.

But I still think that I'll face unresolvable hostname using wget in future.

Anyway, a big thank you to Topguy and the rest of the guys who's check out my post ! Appreciate it! :D
Oh yes! It finally worked! I've left one step out suggested by topguy, I've just changed the nameserver to '8.8.8.8' at /etc/resolv.conf and wget hasn't yet failed on me after this. Thanks topguy!! ;)