Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wget: unable to resolve host address `http'

I am getting this strange thing on my Ubuntu 12.04 64-bit machine when I do a wget

$ wget google.com

--2014-07-18 14:44:32--  http://google.com/

Resolving http (http)... failed: Name or service not known.

wget: unable to resolve host address `http'

I have encountered this problem earlier when I got it for any web pages (and not http), which required me to add my nameserver to /etc/resolv.conf.

However, here that doesn't seem to be the problem, instead it is recognizing http as something different. Any advise?

like image 761
kausal_malladi Avatar asked Jul 18 '14 09:07

kausal_malladi


3 Answers

The DNS server seems out of order. You can use another DNS server such as 8.8.8.8. Put nameserver 8.8.8.8 to the first line of /etc/resolv.conf.

like image 148
whitecoffee Avatar answered Oct 06 '22 03:10

whitecoffee


remove the http or https from wget https:github.com/facebook/facebook-php-sdk/archive/master.zip . this worked fine for me.

like image 13
Kibrom Gebrehiwot Avatar answered Oct 06 '22 02:10

Kibrom Gebrehiwot


I have this issue too. I suspect there is an issue with DigitalOcean’s nameservers, so this will likely affect a lot of other people too. Here’s what I’ve done to temporarily get around it - but someone else might be able to advise on a better long-term fix:

  1. Make sure your DNS Resolver config file is writable:

    sudo chmod o+r /etc/resolv.conf

  2. Temporarily change your DNS to use Google’s nameservers instead of DigitalOcean’s:

    sudo nano /etc/resolv.conf

Change the IP address in the file to: 8.8.8.8

Press CTRL + X to save the file.

This is only a temporary fix as this file is automatically written/updated by the server, however, I’ve not yet worked out what writes to it so that I can update it permanently.

like image 7
jabriil warsame Avatar answered Oct 06 '22 01:10

jabriil warsame