From 0927c8161cca13fb454701fdb07cf86461a2e2bc Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 8 Feb 2018 14:10:53 -0800 Subject: [PATCH] Add note on return value of dns.resolve --- src/native-dns.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/native-dns.js b/src/native-dns.js index 28ac540dd..d65c7e203 100644 --- a/src/native-dns.js +++ b/src/native-dns.js @@ -27,6 +27,9 @@ function resolve(hostname, rrtype, options, callback) { resolver.resolve(hostname, rrtype, function (error, result) { clearTimeout(timerId); + // result is an empty array if there was no error but there is no record. when you query a random + // domain, it errors with ENOTFOUND. But if you query an existing domain (A record) but with different + // type (CNAME) it is not an error and empty array callback(error, result); }); }