From f07c3ce9ac4b65319373db88f1fd8c8674adf38b 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 --- lib/net.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index f962a848fad662..bcad28b22c24cd 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1091,7 +1091,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; }