0

My windows 7 is messed up somehow and no one seems to know what is wrong. My localhost runs so slow it is not even funny. To run my website on local host takes like 20 seconds to load up.

I change it to 127.0.0.1 and it loads up in 1 second. So I am not sure what the difference is between them.

I am also unsure how to set 127.0.0.1 to load up instead of localhost when running my website through Visual Studio Web Developer Express 2008.

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
chobo2
  • 441
  • 1
  • 9
  • 18
  • 2
    seems like a DNS problem. Belongs to serverfault.com – Aziz Sep 17 '09 at 06:16
  • 3
    Might also be related to IPv6. Widnows Vista and 7 use IPv6 by default. Anyway, I'd rather move this to Super User than Server Fault. – Joey Sep 17 '09 at 06:18
  • agreed with Johannes, this should be on Super User. It's not a server or programming question, it's a windows question. Voted to move/close. – Gabriel Hurley Sep 17 '09 at 06:27
  • It could be that your system is infected by something that took your HOSTS file hostage... – Wim ten Brink Sep 17 '09 at 08:59

3 Answers3

4

localhost is just a name mapped in your 'hosts' file. possibly located at:

c:\windows\system32\drivers\etc\hosts

I agree with aziz, that it's something underlying issue with DNS on your system.

  • 2
    Note, in Windows 7 the "localhost" to IP address (v4 or v6) is done in the DNS client code *not* in the hosts file (the file contains a comment to this effect). – Richard Sep 17 '09 at 09:40
1

First of all 127.0.0.1 is a IPv4 address and localhost is a host name. Host names must be resolved to get IP addresses. They can be resloved by DNS and the hosts file at c:\windows\system32\drivers\etc\hosts.

This is the entry of my hosts file:

::1 localhost

But what is this: "::1"? An IPv6 address for the local computer. You can check your web app with this url against this IPv6 adress:

http://[::1]/

This request must do well. If not your web system has problems with IPv6 addresses. If this request is ok, you have an DNS issue.

-4

You may improve speed by changing

 ::1 localhost

to

 127.0.0.1 c:\windows\system32\drivers\etc\hosts

As far as I know ::1 is device identifier, so it uses its IP address. Since loopback is almost fixed, you can safely change it.