Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 983 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 983 Bytes

Simple Whois Client for NodeJS

This is a simple whois library to fetch whois information of any domain name. All TLDs are supported, the module can find the whois server of any TLD by querying IANA.

How to install?

You can install the module with npm i simple-whois command.

Example code

const simpleWhois = require('simple-whois');

(async() => {
  let config =  {
    // tld: 'dev', // keep it empty to detect automatically
    // deepWhois: false // it's "true" by default. if you set to false, it won't query registrar whois server
    // whoisServer: 'whois.nic.google' // keep it empty to detect automatically
  };
  let domain = 'google.dev';
  let whoisData = await simpleWhois.getWhois(domain, config);
  console.log(whoisData);
})();

How does it find the whois server?

The library keeps used whois servers in cache. But if it's not used before, it sends a request to IANA Root DB to find the whois server.