How to perform WHOIS queries with SOCKS proxies using NodeJS

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.

Proxyrack offers a multiple options to suit most use cases, if you are unsure our 3 Day Trial allows you to test them all.

Security

Residential proxies

Never get blocked, choose your location

View all option available
Vault

Datacenter proxies

Super fast and reliable

View all option available
Try

3 Day Trial

Test all products to find the best fit

View all option available
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.

Proxyrack offers a multiple options to suit most use cases, if you are unsure our 3 Day Trial allows you to test them all.

Security

Residential proxies

Never get blocked, choose your location

View all option available
Vault

Datacenter proxies

Super fast and reliable

View all option available
Try

3 Day Trial

Test all products to find the best fit

View all option available

Daniel - May 9, 2022

How To Create A Custom SEO Tool

Tutorials
Read Article

Daniel - May 9, 2022

Best Proxies For Enterprises

Tutorials
Read Article

Daniel - April 7, 2022

What Is Autofill Magic?

Tutorials
Read Article

Daniel - April 1, 2022

What Is AdsPower Browser?

Tutorials
Read Article

Get Started by signing up for a Proxy Product

View Plans