diff --git a/lib/dns.js b/lib/dns.js index 8a6c7456babbd0..df593a5255af87 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -63,11 +63,7 @@ function onlookup(err, addresses) { if (err) { return this.callback(dnsException(err, 'getaddrinfo', this.hostname)); } - if (this.family) { - this.callback(null, addresses[0], this.family); - } else { - this.callback(null, addresses[0], isIP(addresses[0])); - } + this.callback(null, addresses[0], this.family || isIP(addresses[0])); }