Skip to content

Instantly share code, notes, and snippets.

@eugenehp
Created July 8, 2012 14:58
Show Gist options
  • Save eugenehp/3071295 to your computer and use it in GitHub Desktop.
Save eugenehp/3071295 to your computer and use it in GitHub Desktop.
node.js IP reverse lookup
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
@ChristianRich
Copy link

Works like a charm!

@jkresner
Copy link

Thank you sir.

@BirkhoffLee
Copy link

Thanks

@Sunil178
Copy link

Sunil178 commented Mar 4, 2021

Thank you so much!!!!
Works very much fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment