Installations
npm install whoiser
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=15.0.0
Node Version
18.20.4
NPM Version
10.7.0
Score
86.8
Supply Chain
100
Quality
78.7
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
LayeredStudio
Download Statistics
Total Downloads
453,295
Last Day
564
Last Week
7,624
Last Month
30,690
Last Year
217,854
GitHub Statistics
222 Stars
259 Commits
33 Forks
7 Watching
2 Branches
15 Contributors
Package Meta Information
Latest Version
1.18.0
Package Id
whoiser@1.18.0
Unpacked Size
65.89 kB
Size
19.41 kB
File Count
25
NPM Version
10.7.0
Node Version
18.20.4
Publised On
04 Aug 2024
Total Downloads
Cumulative downloads
Total Downloads
453,295
Last day
46.5%
564
Compared to previous day
Last week
-8.5%
7,624
Compared to previous week
Last month
7.7%
30,690
Compared to previous month
Last year
65.4%
217,854
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
🌍 Whoiser
whoiser is a WHOIS client for Node.js that helps with querying WHOIS servers for TLDs, domain names, AS numbers and IPs.
Has support for auto-discovery WHOIS servers for TLDs and IPs allocators, making it easy to get WHOIS info with a single call like whoiser('google.com')
or whoiser('1.1.1.1')
.
Applies minimal parsing to results, returning same data format from different WHOIS servers.
Highlights
- Returns WHOIS info for any internet address
- Requires zero config, but configurable when needed
- Recognises queries and routes the request to correct server
- Minimal parsing to provide consistent results across WHOIS servers
- Uses WHOIS servers from IANA, if not provided
- Discover all available TLDs
→ See it in action here https://dmns.app
Getting Started
Installation
npm i whoiser
Usage
The library has a simple API.
Use whoiser(query)
with any query you would want OR use specific functions with options like whoiser.domain(domain, {options})
, whoiser.ip(ip, {options})
Example
1const whoiser = require('whoiser') 2 3const domainWhois = whoiser('google.com') 4const tldWhois = whoiser('.net') 5const ipWhois = whoiser('1.1.1.1')
Client API
whoiser(query, options)
- Get WHOIS data for any internet addresswhoiser.domain(domain, options)
- Get parsed WHOIS data for a domainwhoiser.tld(tld, options)
- Get WHOIS data for a TLDwhoiser.asn(asn, options)
- Get WHOIS data for an AS numberwhoiser.ip(ip, options)
- Get WHOIS data for a IPwhoiser.allTlds
- Returns a list of all TLDs, downloaded from IANAwhoiser.query(options)
- Query a WHOIS server for data
Domain whois
Get WHOIS info for domains.
whoiser.domain(domain, options): Promise<Object<whoisServer>>
domain
- Domain name, excluding any subdomain. Ex: 'google.com'options
- Object of options to use, all optional:host
- WHOIS server to query. Default: WHOIS server from IANAtimeout
- WHOIS server request timeout in ms. Default: 1500follow
- How many WHOIS server to query. 1 = registry server (faster), 2 = registry + registrar (more domain details). Default: 2raw
- Return the raw WHOIS result in response. Added to__raw
ignorePrivacy
- Show or hide the WHOIS protected data from response, accepts boolean. Default: true
1const whoiser = require('whoiser'); 2 3(async () => { 4 5 // WHOIS info from Registry (Verisign) AND Registrar (MarkMonitor) whois servers 6 let domainInfo = await whoiser('google.com') 7 8 // OR with options for whois server and how many WHOIS servers to query 9 let domainInfo2 = await whoiser.domain('blog.google', {host: 'whois.nic.google', follow: 1}) 10 11 console.log(domainInfo, domainInfo2) 12})();
Returns a promise which resolves with an Object
of WHOIS servers checked:
1{ 2 "whois.verisign-grs.com": { 3 "Domain Name": "GOOGLE.COM", 4 "Registrar WHOIS Server": "whois.markmonitor.com", 5 ... 6 }, 7 "whois.markmonitor.com": { 8 "Domain Name": "google.com", 9 "Creation Date": "1997-09-15T00:00:00-0700", 10 "Expiry Date": "2020-09-13T21:00:00-0700", 11 "Registrar": "MarkMonitor, Inc.", 12 "Domain Status": [ 13 "clientUpdateProhibited", 14 "clientTransferProhibited" 15 ], 16 ... 17 "Name Server": [ 18 "ns1.google.com", 19 "ns2.google.com" 20 ], 21 "text": [ 22 "For more information on WHOIS status codes, please visit:", 23 ... 24 ] 25 } 26}
IP whois
Get WHOIS info for IPs
whoiser.ip(ip, options): Promise<Object>
ip
- IP. Ex: '1.1.1.1'options
- Object of options to use, all optional:host
- WHOIS server to query. Default: WHOIS server from IANAtimeout
- WHOIS server request timeout in ms. Default: 1500raw
- Return the raw WHOIS result in response. Added to__raw
1const whoiser = require('whoiser'); 2 3(async () => { 4 5 // WHOIS info with auto-discovering for WHOIS server 6 let ipInfo = await whoiser('1.1.1.1') 7 8 // OR with options for whois server 9 let ipInfo2 = await whoiser.ip('8.8.8.8', {host: 'whois.arin.net'}) 10 11 console.log(ipInfo, ipInfo2) 12})();
Returns a promise which resolves with an Array
of WHOIS info lines:
1{ 2 range: '2606:4700:: - 2606:4700:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF', 3 route: '2606:4700::/32', 4 NetName: 'CLOUDFLARENET', 5 NetHandle: 'NET6-2606-4700-1', 6 Parent: 'NET6-2600 (NET6-2600-1)', 7 NetType: 'Direct Allocation', 8 asn: 'AS13335', 9 Organization: 'Cloudflare, Inc. (CLOUD14)', 10 RegDate: '2011-11-01', 11 Updated: '2017-02-17', 12 Comment: 'All Cloudflare abuse reporting can be done via https://www.cloudflare.com/abuse', 13}
AS Number whois
Get WHOIS info for an AS number
whoiser.asn(asn, options): Promise<Object>
asn
- ASN. Ex: 'AS15169' or15169
options
- Object of options to use, all optional:host
- WHOIS server to query. Default: WHOIS server from IANAtimeout
- WHOIS server request timeout in ms. Default: 1500raw
- Return the raw WHOIS result in response. Added to__raw
1const whoiser = require('whoiser'); 2 3(async () => { 4 5 // WHOIS info for ASN15169 6 let whois = await whoiser.asn(15169) 7 8 console.log(whois) 9})();
Returns a promise which resolves with an Object
of WHOIS info:
1{ 2 ASNumber: '15169', 3 ASName: 'GOOGLE', 4 ASHandle: 'AS15169', 5 RegDate: '2000-03-30', 6 Updated: '2012-02-24', 7 Ref: 'https://rdap.arin.net/registry/autnum/15169', 8}
Roadmap
Aiming to have these features:
- helper function to query WHOIS servers ->
whoiser.query()
- query whois for TLDs with parsed result ->
whoiser.tld()
- query whois for domains with parsed result ->
whoiser.domain()
- query whois for IPs and return parsed result ->
whoiser.ip()
- query whois for ASN with parsed result ->
whoiser.asn()
- Punycode support
- Normalize Domain WHOIS field names, removing inconsistencies between WHOIS servers
- Test more IPs and ASNs to deliver consistent WHOIS results
Unsupported TLDs
.ch
- WHOIS server for .ch doesn't return WHOIS info, works only in browser https://www.nic.ch/whois/. This library can be used only to check .ch domain availability, example here https://runkit.com/andreiigna/5efdeaa8e4f2d8001a00312d
More
Please report any issues here on GitHub. Any contributions are welcome
License
Copyright (c) Andrei Igna, Layered
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
- Info: security policy file detected: .github/SECURITY.md:1
- Warn: no linked content found
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/SECURITY.md:1
- Info: Found text in security policy: .github/SECURITY.md:1
Reason
Found 4/20 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-package.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/LayeredStudio/whoiser/publish-package.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-package.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/LayeredStudio/whoiser/publish-package.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/LayeredStudio/whoiser/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/LayeredStudio/whoiser/test.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/publish-package.yml:1
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 14 are checked with a SAST tool
Score
4.4
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More