Sam - February 28, 2018

How to perform WHOIS queries with SOCKS proxies using NodeJS

Tutorials

Introduction

If you’re wanting to scale whois queries you’ll quickly find out that some of the servers hosting these databases impose limits on the amount of times you can query them per day or even per hour.

Countries like Australia & New Zealand impose much heavier limitations on performing queries and using a SOCKS proxy we are able to bypass these limits and continue mining data.

Preresequites

NodeJS installed (we’re using 8.9.3 in this example)

How to perform WHOIS query behind a SOCKS proxy

Step 1: Install whois npm

npm install -g whois

/usr/bin/whois -> /usr/lib/node_modules/whois/index.js
+ whois@2.5.9
added 8 packages in 1.165s

Step 2: Create “example.js” script with the following content

Using your favourite text editor such as vim, nano or emacs:

Find the perfect Proxy Product.

var whois = require('whois')
whois.lookup('proxyrack.com', {"proxy": {"ipaddress": "162.210.198.8", "port": 1200, "type": 5}}, function(err, data) {
 console.log(data)
})

The parts you will want to edit:

‘proxyrack.com’ <— This is the domain you want to lookup

“ipaddress” <— Your proxy IP or hostname

“port” <— Port of your proxy

“type” <— 5 for SOCKS5 protocol or 4 for SOCKS4

If your proxy requires authentication you will need to whitelist it with your provider (this can be done in our panel).

Ready to run?

Simply execute

node example.js

Find the perfect Proxy Product.

Get Started by signing up for a Proxy Product