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 authored and MylesBorins committed Feb 12, 2018
1 parent bb32161 commit 9ac7f30
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 9ac7f30

Please sign in to comment.