Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@ChristianRich ChristianRich commented Aug 5, 2015

Works like a charm!

@jkresner

This comment has been minimized.

Copy link

@jkresner jkresner commented Oct 21, 2015

Thank you sir.

@BirkhoffLee

This comment has been minimized.

Copy link

@BirkhoffLee BirkhoffLee commented Jan 3, 2016

Thanks

@Sunil178

This comment has been minimized.

Copy link

@Sunil178 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