Last active
August 29, 2015 13:56
-
-
Save shardulmohite/f2956009a53d573f1e14 to your computer and use it in GitHub Desktop.
DNS look up , example of Non-Blocking function of JS .
This file contains 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 SiteArray = ['google.com','webonise.com','facebook.com','techcrunch.com','indiatimes.com']; | |
var dns = require('dns'); | |
for(var i = 0 ; i < SiteArray.length ; i++){ | |
dns.lookup(SiteArray[i],function(err,ip){ | |
if (err) return handleError(err); | |
console.log( " %s resolved to %s ", SiteArray[i],ip ); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍