diff --git a/lib/dns.js b/lib/dns.js index 3f27d7401abcae..6946380ae673ce 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -253,7 +253,7 @@ class Resolver { } function resolver(bindingName) { - return function query(name, /* options, */ callback) { + function query(name, /* options, */ callback) { var options; if (arguments.length > 2) { options = callback; @@ -275,7 +275,9 @@ function resolver(bindingName) { var err = this._handle[bindingName](req, name); if (err) throw errnoException(err, bindingName); return req; - }; + } + Object.defineProperty(query, 'name', { value: bindingName }); + return query; } var resolveMap = Object.create(null);