Skip to content

Commit aa395b7

Browse files
cjihrigjasnell
authored andcommitted
net: set ADDRCONFIG DNS hint in connections
b85a50b 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: #6133 PR-URL: #6281 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
1 parent 54f2218 commit aa395b7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/net.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,10 @@ function lookupAndConnect(self, options) {
949949
hints: options.hints || 0
950950
};
951951

952+
if (dnsopts.family !== 4 && dnsopts.family !== 6 && dnsopts.hints === 0) {
953+
dnsopts.hints = dns.ADDRCONFIG;
954+
}
955+
952956
debug('connect: find host ' + host);
953957
debug('connect: dns options', dnsopts);
954958
self._host = host;

0 commit comments

Comments
 (0)