i am running a local python server on windows 10 and sending requests to it via the localhost
domain are significantly slower than using 127.0.0.1
. i have edited my hosts file and the problem occurs whether i have 127.0.0.1 localhost
commented out or not (including ipv6 entry). if i use any other domain with an entry in my hosts file pointing to 127.0.0.1
then the problem goes away which proves that the hosts file is working correctly for all custom entries. i have tried flushing dns and various other commands to clear out any DNS caching to no avail.
even though localhost
is defined in my functioning hosts file something is specifically hijacking the domain resolution and causing it to respond much slower than it should.
i realize there have been a number of posts about this issue but they all simply suggest using 127.0.0.1
instead which does not solve the problem or explain why it is happening.