Get the ISP of an IP in node.js

Is there a way to perform a whois on an IP to get the ISP that provides that IP in a Node.js/Express server ?

I already got the IP, I'm not looking for a way to get the client's IP.

I've found ways with external request to paid services that sends back JSON, but I would like to find a native way.

Do you guys know anything that could help me ?

Edit: I'm not trying to build a whois server, I just need for the application I build to get the client's ISP name.

Answers


You can get ISP information by using node-whois module but in its response it quite complex to access value for a particular key. So there is another way is you can use satellite module, This module can give quick response and response is available in json format so you can access any key values easily. Here is the code.

var satelize = require('satelize');
var ExternalIP = "173.194.70.100"; // I asume that, you already have external(public)IP
satelize.satelize({ip: ExtenalIP}, function(err, geoData) 
{

     if(err){
        console.log(" Error in retriving ISP Information");  
     }
     else
     {
        console.log("ISP Information for "+ ExternalIP+" :"+geoData );
     }
});

This is a Node.js module implementing a whois client.

As correctly pointed out by @robertklep, the above module does not work with IP addresses. Still, node-whois does (I personally tested the code this time):

"use strict";

var whois = require('node-whois');

whois.lookup('173.194.70.100', function(err, data) {
  console.log(err, data);
});

The only issue is that the output is not very nice.


https://github.com/xreader/whois has nice JSON output. Hope this helps somebody.


Need Your Help

Flex mouse wheel event not triggered on VBox

flex flex3

I'm having a problem with mouse wheel scrolling of a VBox. When the mouse if over any of the components in the VBox or the vertical scrollbar it works fine, but no scrolling occurs when the mouse i...

Verilog Event control statements

verilog fpga hdl

I currently have this code(below) for a debouncer for a button on an fpga, however I am getting an error that says "Multiple event control statements in one always/initial process block are not sup...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.