when m doing curl it says could not resolve host what can i do ?

curl http://npmjs.org/install.sh | sudo sh

curl: (6) Couldn't resolve host 'npmjs.org'

http://npmjs.org/

/etc/resolv.conf

search x1
nameserver x2
nameserver 8.8.8.8
nameserver 8.8.4.4

nslookup result

 nslookup google.com
Server:         x1
Address:        x1#53

Non-authoritative answer:
*** Can't find google.com: No answer

Non-authoritative answer: * Can't find google.com: No answer

link|improve this question

50% accept rate
feedback

1 Answer

Make sure that your DNS is working fine:

$ nslookup google.com

If not, change to Google's DNS and try again:

# echo "8.8.8.8" > /etc/resolv.conf
# echo "8.8.4.4" >> /etc/resolv.conf

i can access internet by proxy

You can make curl use HTTP proxy with:

$ curl -x proxyhost:port http://npmjs.org/install.sh | sudo sh
link|improve this answer
pls check question with your answer result . – Rahul Mehta Oct 5 '11 at 4:40
Delete two first lines in /etc/resolv.conf and try again. – quanta Oct 5 '11 at 4:50
after deleteing when m doing nslookup google.com it gives ;; connection timed out; no servers could be reached – Rahul Mehta Oct 5 '11 at 4:53
Do you have Internet connection? ping 8.8.8.8? – quanta Oct 5 '11 at 4:54
i can access internet by proxy , and ping result is PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. – Rahul Mehta Oct 5 '11 at 4:56
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

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