node-dns
node-dns copied to clipboard
dns.resolveMx // undefined
Great module but see code bellow
var domain ='idonexist'; dns.resolveMx(domain, function (err, dnsresults) { if (err) { console.log(err);
} else {
console.log(dnsresults); //undefined
}
});
native-dns doesnt return err when domain does not exist , oob dns module does . It's would be nice to have it
update oob dns returns
{ [Error: queryMx ENODATA] code: 'ENODATA', errno: 'ENODATA', syscall: 'queryMx' }
Right, NX isn't neither undefined nor an error.
My suggestion shuld be ERROR
RFC says otherwise. Errors are reserved for the case that the resolver has an an internal error. But if it can't resolve the query, the supposed answer is NXDOMAIN for the example given. And of course it is different for the application if the resolver is broken or if it can't resolve the query.
ok :)