Skip to content

Commit

Permalink
net: set ADDRCONFIG DNS hint in connections
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Claudio Rodriguez <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Saúl Ibarra Corretgé <[email protected]>
  • Loading branch information
cjihrig authored and jasnell committed Apr 26, 2016
1 parent 54f2218 commit aa395b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aa395b7

Please sign in to comment.