Skip to content

Instantly share code, notes, and snippets.

@cponeill
Created March 1, 2016 17:52
Show Gist options
  • Save cponeill/f68c0dd18ba1491f5639 to your computer and use it in GitHub Desktop.
Save cponeill/f68c0dd18ba1491f5639 to your computer and use it in GitHub Desktop.
var dns = require('dns');
function reverseLookup(ip) {
dns.reverse(ip,function(err,domains){
if(err!=null) callback(err);
domains.forEach(function(domain){
dns.lookup(domain,function(err, address, family){
console.log(domain,'[',address,']');
console.log('reverse:',ip==address);
});
});
});
}
reverseLookup('111.11.111.111');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment