My Chrome browser seems to be slow to resolve localhost:3000
I am in a Windows 10 machine and I SSH into my development laptop via VS Code Remote SSH
So far here is what I have been able to narrow down.
- 127.0.0.1:3000 resolution works perfectly fine
- Firefox localhost:3000 resolution works perfectly fine
- localhost:3000 on the local laptop that's running the server works fine
- Added a prefix policy to prefer IPv4 over IPv6 via
netsh
no effect - /etc/hosts has
127.0.0.1 localhost
setup - If I setup
127.0.0.1 local
in /etc/hosts than local:3000 also works fine - Going to
chrome://net-internals/#dns
and checking localhost returns"localhost": ["::1","127.0.0.1"]
and seems to ignore the /etc/hosts.
I feel like this is an IPv6 lookup issue but I can't seem to make Chrome not perform a ::1 lookup for localhost.
Resolution of localhost vs 127.0.0.1 is almost 10 times slower.
Open to any suggestions or further debugging recommendations. Thanks in advance!
Edit: Not sure the reasons for the question downvotes. I can happily revise the question with some direction.
My Chrome browser seems to be slow to resolve localhost:3000
I am in a Windows 10 machine and I SSH into my development laptop via VS Code Remote SSH
So far here is what I have been able to narrow down.
- 127.0.0.1:3000 resolution works perfectly fine
- Firefox localhost:3000 resolution works perfectly fine
- localhost:3000 on the local laptop that's running the server works fine
- Added a prefix policy to prefer IPv4 over IPv6 via
netsh
no effect - /etc/hosts has
127.0.0.1 localhost
setup - If I setup
127.0.0.1 local
in /etc/hosts than local:3000 also works fine - Going to
chrome://net-internals/#dns
and checking localhost returns"localhost": ["::1","127.0.0.1"]
and seems to ignore the /etc/hosts.
I feel like this is an IPv6 lookup issue but I can't seem to make Chrome not perform a ::1 lookup for localhost.
Resolution of localhost vs 127.0.0.1 is almost 10 times slower.
Open to any suggestions or further debugging recommendations. Thanks in advance!
Edit: Not sure the reasons for the question downvotes. I can happily revise the question with some direction.
Share Improve this question edited Feb 18 at 1:59 Dan asked Feb 17 at 21:37 DanDan 2,3132 gold badges21 silver badges43 bronze badges1 Answer
Reset to default 0If I remember correctly on Windows the name resolution of localhost to the actual ip address is slow because, when it tries to route to the correct ip there is a cooldown in which it awaits a response. I not sure though.
Most solutions just suggest that you change to the actual ip address.
You could try the solutions suggested here, I cannot confirm if it will work for you https://superuser/questions/436574/ipv4-vs-ipv6-priority-in-windows-7/436944#436944