Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Anything that asks for something via localhost fails. I can't get any result from pinging localhost. The only way I can reach anything in my network would be to resort to connecting to my externalIP:port# and that will route myself back in. My host file seems to look ok... How can I fix this?

share|improve this question
    
Does it seem to look okay or is it okay? You post it here? Has it ever worked? Do you remember changing anything? –  slhck May 17 '12 at 12:53
    
does ping 127.0.0.1 work? –  Kamil Klimek May 17 '12 at 15:17
    
well, it was where I could delete my preferences folder out of my system level Library and reboot and I could then ping 127.0.0.1 and localhost successfully. now when I reboot doing the same I can only ping 127.0.0.1 and localhost is still "ping: cannot resolve localhost: Unknown host" –  Chris May 20 '12 at 3:37
    
also I tried deleting my hosts file to let the OS re create it and issue persists –  Chris May 20 '12 at 3:37
add comment

1 Answer

Are you 100% sure your host file is correct?

If ping is giving you Unknown host that means it doesn't have that info on the host files or any thing to resolve to localhost being your computer.

Open a terminal window

Type in sudo pico /private/etc/hosts

Check if you have something like this

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

If you don't have this lines (which you probably don't by the result of your ping) then your host file is not ok.

You need those lines, specially the first one to be able to resolve to localhost.

share|improve this answer
add comment

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.