pharsfalvi
pharsfalvi

Reputation: 807

Can not resolve http://localhost:8080/ on Mac OSX Lion

I'm trying to use a local server on my mac, but it seems to ignore the localhost settings in the /etc/hosts file. Found several pages where solution was to do a reinstall, and put localhost to the first place of /etc/hosts etc... I believe these are more than needed.

Does anybody still have the same problem?

Upvotes: 3

Views: 16303

Answers (3)

chris
chris

Reputation: 1

I guarantee it's your hosts file. I did all of this and have been messing around with the proxy settings and hosts - and no surprise, I screwed things up. This is what I did: Put you osx proxy settings back to default (*.local, 169.254/16) and leave passive checked. Nothing else is checked. Make sure your hosts file has the right header section - the first few lines. If you don't know what this is, you never touched it so don't worry. Either way, check it at /etc/hosts. You can do a quick search for the default osx hosts file (sorry, this site is too strict for me to paste) Don't forget to flush your osx dns! dscacheutil -flushcache on 10.7 +. You should be good. For me, I need to stop messing around so much with things like this because it is easy to mess up and then a pain to troubleshoot. Good luck.

Upvotes: 0

pharsfalvi
pharsfalvi

Reputation: 807

Found that behind proxy by the default only the *.local is excluded, so just need to add localhost and 127.0.0.1 to avoid DNS resolution on the local machine. Put

*.local, localhost, 127.0.0.1

into the following setting dialog:

System Preferences/Network/Advanced/Proxies/Bypass proxy settings for these Hosts & Domains

Upvotes: 17

lagerstedt
lagerstedt

Reputation: 42

You don't say what server you're trying to get going and maybe i'm not understanding the question. Lion comes with the localhost alias in /etc/hosts by default and it seems unlikely that that alias should stop working. Can you ping localhost? Can you access the server through 127.0.0.1?

Upvotes: 0

Related Questions