Skip to content

Commit 74a5bba

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 dd14004 commit 74a5bba

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
@@ -1080,7 +1080,10 @@ function lookupAndConnect(self, options) {
10801080
hints: options.hints || 0
10811081
};
10821082

1083-
if (dnsopts.family !== 4 && dnsopts.family !== 6 && dnsopts.hints === 0) {
1083+
if (process.platform !== 'win32' &&
1084+
dnsopts.family !== 4 &&
1085+
dnsopts.family !== 6 &&
1086+
dnsopts.hints === 0) {
10841087
dnsopts.hints = dns.ADDRCONFIG;
10851088
}
10861089

0 commit comments

Comments
 (0)