1

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

2
  • Yes it was because of an upgrade. Usually the security based ones.
    – ricbax
    Nov 5, 2010 at 3:40
  • But how do I resolve this issue?
    – Conor
    Nov 12, 2010 at 20:19

2 Answers 2

0

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.

1
  • 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, 2010 at 20:21
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .