node
node copied to clipboard
Subdomains on localhost return ENOTFOUND on some OS.
Version
Tested on v21.2.0, v20.9.0, v18.18.2
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
No response
What steps will reproduce the bug?
- run
fetch("http://test.localhost/")
How often does it reproduce? Is there a required condition?
Happens on windows every time
What is the expected behavior? Why is that the expected behavior?
Expected behaviour is ECONNREFUSED or content of what the webpage contains equally to how a node on Linux, cURL or a browser would handle it
What do you see instead?
Uncaught [TypeError: fetch failed] {
cause: Error: getaddrinfo ENOTFOUND test.localhost
at GetAddrInfoReqWrap.onlookupall [as complete] (node:dns:118:26)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'test.localhost'
}
}
Additional information
Recreated locally in a VM but also on an actual Windows device