Skip to content

Instantly share code, notes, and snippets.

@ianlintner-wf
Forked from eugenehp/reverse-ip-lookup.js
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianlintner-wf/2ec1196c4561e0043d59 to your computer and use it in GitHub Desktop.
Save ianlintner-wf/2ec1196c4561e0043d59 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('213.46.228.196');
#!/bin/sh
node reverse-ip-lookup.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment