Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

Make sure that your DNS is working fine:

$ nslookup google.com

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

# echo "nameserver 8.8.8.8" > /etc/resolv.conf
# echo "nameserver 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
share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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