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.

Last week I fired up a website that I'm currently developing locally only to find out that it wasn't working as it was the night before, (or at all). After an inital stage of panic and 'what did I do' moments... I deduced the problem down to the fact that my OS X now wont resolve localhost properly, so connections to my SQL database were failing.

I can still ping localhost in the terminal, but in order to get my websites up and running again, I had to change all the localhost entries to 127.0.0.1

This isn't a huge problem as everything is up and running again, but I would like to try to get to the bottom of it. I have a sneaking suspicion that an apple software update caused this issue, as I don't recall doing anything else that would have had any effect.

Other than my hosts file (which looks normal), what else could be causing this? Running OSX 10.6.4

share|improve this question
    
Yes it was because of an upgrade. Usually the security based ones. –  ricbax Nov 5 '10 at 3:40
    
But how do I resolve this issue? –  Conor Nov 12 '10 at 20:19
add comment

2 Answers

Check the hosts file (probably) /etc/hosts for an entry like.

127.0.0.1 localhost

I think OSX has a gui for editing those but I have forgotten how to find it off hand. I will have to check my OSX machine at home to confirm.

share|improve this answer
    
As I mentioned in my post, my hosts file looks completely fine, and I have other namespaces that point to 127.0.0.1 that resolve fine, just not localhost. –  Conor Nov 12 '10 at 20:21
add comment

Check your directory services hosts entries. Open Terminal and open dscl.

  1. cd /Local/Default/Hosts and readall.

  2. cd /BSD/local/Hosts and readall again.

Post the results, maybe there's something suspicious.

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.