diff --git a/lib/dns.js b/lib/dns.js index bd330ba92bc1d6..4243a05e179b88 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -65,11 +65,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])); }