Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Subdomains on localhost return ENOTFOUND on some OS. | GoodFirstPicks

Subdomains on localhost return ENOTFOUND on some OS.

nodejs/node 14 comments 8d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNode.jsJavaScript

Why this is a good first issue

DNS resolution issue specific to Windows/Mac environments with localhost subdomains.

AI Summary

The issue involves inconsistent DNS resolution behavior for localhost subdomains on Windows/Mac compared to Linux. While workarounds exist, the core DNS resolution behavior in Node.js needs investigation. The challenge lies in platform-specific network stack behaviors.

Issue Description

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?

  1. 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

GitHub Labels

dns

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • DNS resolution behavior
  • cross-platform differences
  • network stack
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno