diff --git a/lib/DnsResolver.js b/lib/DnsResolver.js index 7cfdd22..33aa041 100644 --- a/lib/DnsResolver.js +++ b/lib/DnsResolver.js @@ -62,7 +62,15 @@ class DnsResolver { } this.logger.debug("Standard Resolve: " + host); - const {address,family} = await dnsLookupAsync(host); + const dnsResult = await dnsLookupAsync(host); + // For some reason, this sometimes returns a string address rather than an object. + // I haven't been able to reproduce, but it's been reported on the issue tracker. + let address; + if (typeof dnsResult === 'string') { + address = dnsResult; + } else { + address = dnsResult.address; + } this.logger.debug("Found address: " + address); return {address: address}; }