Skip to content

Commit ffc1444

Browse files
bzozMylesBorins
authored andcommitted
net: remove ADDRCONFIG DNS hint on Windows
On Windows setting ADDRCONFIG causes localhost resolution to fail if there are no network connections. This removes that flag on Windows. Fixes: #17641 PR-URL: #17662 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent c377d22 commit ffc1444

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/net.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,10 @@ function lookupAndConnect(self, options) {
995995
hints: options.hints || 0
996996
};
997997

998-
if (dnsopts.family !== 4 && dnsopts.family !== 6 && dnsopts.hints === 0) {
998+
if (process.platform !== 'win32' &&
999+
dnsopts.family !== 4 &&
1000+
dnsopts.family !== 6 &&
1001+
dnsopts.hints === 0) {
9991002
dnsopts.hints = dns.ADDRCONFIG;
10001003
}
10011004

0 commit comments

Comments
 (0)