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 <[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]>
  • Loading branch information
bzoz authored and MylesBorins committed Feb 11, 2018
1 parent 019c528 commit 9ab79e1
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 @@ -995,7 +995,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 9ab79e1

Please sign in to comment.