2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2025-02-05 13:38:26 +00:00

29 lines
425 B
JavaScript
Raw Normal View History

2017-07-31 15:51:51 +05:30
/**
* 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);
});
}