Created
February 25, 2014 12:43
-
-
Save julien51/9208115 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dns = require('dns'); | |
var domains = require('./domains.json'); | |
var times = []; | |
function solveOne(domains) { | |
var domain = domains.pop(); | |
if(!domain && domain !== '') { | |
console.log(times); | |
process.exit(); | |
} | |
else { | |
var start = new Date().getTime() | |
dns.resolve(domain, function (err, addresses) { | |
times.push(new Date().getTime() - start); | |
if (err) | |
console.error('ERROR WITH', domain) | |
solveOne(domains); | |
}); | |
} | |
} | |
solveOne(domains); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment