From 74a5bbaff4908dcf80958408f9b555bf896a245c Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Wed, 13 Dec 2017 21:10:38 +0100 Subject: [PATCH] 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: https://github.com/nodejs/node/issues/17641 PR-URL: https://github.com/nodejs/node/pull/17662 Reviewed-By: Ben Noordhuis Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum --- lib/net.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index d0d3b4d8f09..332e69219d5 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1080,7 +1080,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; }