Skip to content

Commit 80468cc

Browse files
bzozgibfahn
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 <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent d3d0aaf commit 80468cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/net.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,10 @@ function lookupAndConnect(self, options) {
10881088
hints: options.hints || 0
10891089
};
10901090

1091-
if (dnsopts.family !== 4 && dnsopts.family !== 6 && dnsopts.hints === 0) {
1091+
if (process.platform !== 'win32' &&
1092+
dnsopts.family !== 4 &&
1093+
dnsopts.family !== 6 &&
1094+
dnsopts.hints === 0) {
10921095
dnsopts.hints = dns.ADDRCONFIG;
10931096
}
10941097

0 commit comments

Comments
 (0)