1

There is a very similar previous question and answer, but for windows 7 and/or earlier versions of Google Chrome, here:

That solution no longer seems to work on Windows 8 (x64) and Chrome (2013-03-19, v25.0.1364.172). I have modified the hosts file, restarted, and yet there is still a very noticeable delay when refreshing a localhost site using "localhost". There is no delay when using "127.0.0.1". There is no noticeable delay using either of these in firefox or IE.

There is also no noticeable delay when using the computer name. Only "localhost" incurs the delay.

Chrome's network internals page: "chrome://net-internals/dns#dns" indicates ipv6 is already disabled (and there is no button to enable).

1) What is so different about localhost handling in the network stack for Chrome/Windows?

2) Are there newer options for recent Chrome versions & Windows 8 to force chrome to use ipv4 instead of ipv6 when accessing the loopback interface?


EDIT: I uploaded a short video showing the differences here: http://youtu.be/UyS62gKk3Xw . In the video I first reload using localhost three times. I then switch to 127.0.0.1 and reload three times. Then switch back. When using localhost, the reloads consistently take ~1.4 seconds. When using 127.0.0.1, the reloads only take ~500 ms. The hosts file maps 127.0.0.1 to localhost and the ip6 mapping is commented out. It seems to make no difference if I hold shift key while reloading.

Relevant lines in hosts file:

#localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
#   ::1             localhost

Note that the first commented line is in the hosts file on Windows 8 by default. I don't remember it being there in previous versions, but maybe it was.

Kaliatech
  • 126
  • 6
  • Chrome might be doing some strange searching behavior; are you just typing in "localhost" to the omnibar or "http:/​/localhost/"? – Nick T Apr 20 '13 at 06:40
  • This is not a dupe even if it sounds similar. I have already modified hosts file per the commonly suggested previous fix for this. I edited the question with a short video showing the issue. I am guessing the issue is either due to newer versions of Chrome or the combination of Chrome and new network handling in Windows 8. @Nick T: It doesn't make difference if I prepend http or not, and Chrome seems to strip the protocol from the URL in the address bar regardless. – Kaliatech Apr 21 '13 at 14:38
  • Very late comment, but it [sounds like name server lookup headaches I’ve dealt with in the past](https://superuser.com/a/972962/167207). – Giacomo1968 Oct 29 '17 at 20:03

0 Answers0