diff --git a/lib/dns.js b/lib/dns.js index 15ee6a4362..dcf2128e28 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -184,9 +184,11 @@ exports.resolve = function(domain, type_, callback_) { if (typeof type_ == 'string') { resolver = resolveMap[type_]; callback = callback_; - } else { + } else if (util.isFunction(type_)) { resolver = exports.resolve4; callback = type_; + } else { + throw new Error('Type must be a string') } if (typeof resolver === 'function') {