Files
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

29 lines
425 B
JavaScript

/**
* Module dependencies.
*/
var dns = require('dns');
/**
* Module exports.
*/
module.exports = isResolvable;
isResolvable.async = true;
/**
* Tries to resolve the hostname. Returns true if succeeds.
*
* @param {String} host is the hostname from the URL.
* @return {Boolean}
*/
function isResolvable (host, fn) {
var family = 4;
dns.lookup(host, family, function (err, ip) {
fn(null, !err);
});
}