localhost unavailable - 127.0.0.1 works
Posted by: Mchl (---.neoplus.adsl.tpnet.pl)
Date: August 08, 2008 10:54AM

Hello all
I've been running WAMP on several machines, mostly without any serious problems.
Recently however, my main development system started to behave strange.
Out of sudden [localhost] is not accessible. Web browsers pointed to this location start looking for localhost.com, www.localhost.com etc...
Luckily (but strangely) [127.0.0.1] works just fine.
It's not a big problem, as I just have to accustom myself to typing '12' into adress bar instead of 'lo', but I was wondering, what could be causing this.
I'm running a Vista Businness 32bit. WAMP used to work flawlessly on this system.

Options: ReplyQuote
Re: localhost unavailable - 127.0.0.1 works
Posted by: toivo (---.nsw.bigpond.net.au)
Date: August 08, 2008 01:06PM

Have you checked the integrity of the hosts file in c:\windows\system32\drivers\etc\hosts? You should have an entry there for localhost:

127.0.0.1 localhost

Make sure you do not have viruses or spyware, which sometimes add their own entries to hosts file to prevent the browser from doing a proper Domain Name lookup for anti virus updates, for example.

Regards,

toivo
Sydney, Australia

Options: ReplyQuote
Re: localhost unavailable - 127.0.0.1 works
Posted by: Mchl (---.neoplus.adsl.tpnet.pl)
Date: August 08, 2008 01:26PM

I have only these two entries in my hosts file:

127.0.0.1 localhost
::1 localhost

I don't really know what to make out of it. I tried to comment the second line, but the file seems to be in use by another application (yeah, I stopped WAMP)

There's up to date AV software installed, and it doesn't report any malicious stuff.

[edit]

Being curious I googled some info about hosts file.
I downloaded an example file from [www.mvps.org] and copied it over my file (couldn't edit it, but let me overwrite it... Vista's great), and my localhost is back.
Thanks for giving me a clue winking smiley



Edited 1 time(s). Last edit at 08/08/2008 01:49PM by Mchl.

Options: ReplyQuote
Re: localhost unavailable - 127.0.0.1 works
Posted by: yfastud (Moderator)
Date: August 08, 2008 04:10PM

Actually, you just need to take out the last line

::1 localhost

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: localhost unavailable - 127.0.0.1 works
Posted by: Mchl (---.neoplus.adsl.tpnet.pl)
Date: August 08, 2008 06:24PM

That would suffice, yes, and it was the first thing I tried to do. I just somehow couldn't edit the file (should've tried to overwrite it it seems). Wonder how did this entry get there.

On the other hand, now I've hosts file that is said to block a lot of nasty internet stuff.

Options: ReplyQuote
Re: localhost unavailable - 127.0.0.1 works
Posted by: toivo (---.nsw.bigpond.net.au)
Date: August 08, 2008 11:18PM

Thanks for the tip. What a great idea, that pro-active hosts file should stop the marketeers and racketeers from the dark side of the net in their tracks :-)

toivo
Sydney, Australia

Options: ReplyQuote
Re: localhost unavailable - 127.0.0.1 works
Posted by: yfastud (Moderator)
Date: August 09, 2008 02:40AM

Many anti-adware uses this technique and it does has 2-side effect though.

Good: prevent some popular adware sites ;-)

Bad: your own sites might crawl to load when that list way too long :-(

Tip: Good to use it on computer that for every day usage, but not on the server; for example, I'm using my server to host, but never use it for any other purposes

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: localhost unavailable - 127.0.0.1 works
Posted by: Mchl (---.neoplus.adsl.tpnet.pl)
Date: August 09, 2008 07:51PM

I trust other people in configuring production servers. I just needed it for my laptop winking smiley

There's also an advice in the site I linked, to disable DNS service in Windows, which should remedy slowdowns incurred by large hosts file.



Edited 1 time(s). Last edit at 08/09/2008 07:52PM by Mchl.

Options: ReplyQuote


Sorry, only registered users may post in this forum.