From 54dd7c38e507b35ee0ffadc41a716f1782b0d32f Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 19 Apr 2016 09:09:57 -0400 Subject: [PATCH] net: set ADDRCONFIG DNS hint in connections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit b85a50b6da5bbd7e9c8902a13dfbe1a142fd786a removed the implicit setting of DNS hints when creating a connection. This caused some of the pi2 machines to become flaky. This commit restores the implicit dns.ADDRCONFIG hint, but not dns.V4MAPPED. Fixes: https://github.com/nodejs/node/issues/6133 PR-URL: https://github.com/nodejs/node/pull/6281 Reviewed-By: Ben Noordhuis Reviewed-By: Claudio Rodriguez Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen Reviewed-By: Santiago Gimeno Reviewed-By: Saúl Ibarra Corretgé --- lib/net.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/net.js b/lib/net.js index 61ff7327fb..e92ec369e5 100644 --- a/lib/net.js +++ b/lib/net.js @@ -949,6 +949,10 @@ function lookupAndConnect(self, options) { hints: options.hints || 0 }; + if (dnsopts.family !== 4 && dnsopts.family !== 6 && dnsopts.hints === 0) { + dnsopts.hints = dns.ADDRCONFIG; + } + debug('connect: find host ' + host); debug('connect: dns options', dnsopts); self._host = host;