Free WHOIS Node.js Client

1.3.8 · active · verified Wed Apr 22

freewhois is a Node.js client designed for retrieving WHOIS information by querying the IANA RDAP DNS database. It provides a free and programmatic way to perform domain lookups. The current stable version is 1.3.8. While a specific release cadence isn't detailed, the TLD list is noted as being updated regularly (last on 11/2/2025), suggesting ongoing maintenance. Its key differentiator is leveraging the IANA RDAP database directly, offering a straightforward, free API for WHOIS queries without relying on external, potentially rate-limited, third-party services. It supports both programmatic use in JavaScript/TypeScript projects and includes a command-line interface for quick lookups, making it versatile for both developers and system administrators.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to perform a WHOIS lookup for a domain and handle potential errors using the async/await pattern.

const whois = require('freewhois');

async function performWhoisLookup(domain) {
    try {
        console.log(`
Looking up WHOIS for: ${domain}`);
        const data = await whois(domain);
        console.log(`WHOIS data for ${domain}:`);
        console.log(JSON.stringify(data, null, 2));
    } catch (error) {
        console.error(`Error looking up WHOIS for ${domain}:`, error.message);
        if (error.response && error.response.status) {
            console.error(`HTTP Status: ${error.response.status}`);
        }
    }
}

// Example usage for a well-known domain
performWhoisLookup('google.com');

// Example for a common TLD
performWhoisLookup('example.com');

// Example for a domain that likely does not exist, to demonstrate error handling
performWhoisLookup('nonexistent-domain-1234567890.xyz');

view raw JSON →