Skip to content

Commit

Permalink
net: remove ADDRCONFIG DNS hint on Windows
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bzoz committed Dec 21, 2017
1 parent 439c185 commit a3497b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,10 @@ function lookupAndConnect(self, options) {
hints: options.hints || 0
};

if (dnsopts.family !== 4 && dnsopts.family !== 6 && dnsopts.hints === 0) {
if (process.platform !== 'win32' &&
dnsopts.family !== 4 &&
dnsopts.family !== 6 &&
dnsopts.hints === 0) {
dnsopts.hints = dns.ADDRCONFIG;
}

Expand Down

0 comments on commit a3497b3

Please sign in to comment.