@cleandns/whois-rdap 1.0.28 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -0
- package/dist/port43.js +1 -1
- package/package.json +1 -1
- package/src/port43.ts +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# CleanDNS Tools: WHOIS/RDAP lookup
|
|
2
|
+
|
|
3
|
+
WHOIS/RDAP lookups for domain names.
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
### `whois(target: string, options?: WhoisParameters): Promise<WhoisResponse>`
|
|
8
|
+
|
|
9
|
+
Performs an RDAP or port 43 WHOIS lookup for a given domain name, and attempts to normalize the response.
|
|
10
|
+
|
|
11
|
+
### Parameters
|
|
12
|
+
|
|
13
|
+
- `target` (string): The domain name to look up.
|
|
14
|
+
- `options` (WhoisParameters): Optional parameters for WHOIS/RDAP resolution.
|
|
15
|
+
- `fetch` (fetch): A drop-in replacement for Node's built-in `fetch`, useful for proxying RDAP lookups.
|
|
16
|
+
- `thinOnly` (boolean): Whether to only fetch a registry-level ("thin") RDAP response, instead of attempting a registrar-level ("thick") response.
|
|
17
|
+
|
|
18
|
+
### Returns
|
|
19
|
+
|
|
20
|
+
- `Promise<WhoisResponse>`: A promise that resolves to a `WhoisResponse` object containing the RDAP or WHOIS information for the domain.
|
|
21
|
+
|
|
22
|
+
### WhoisResponse
|
|
23
|
+
|
|
24
|
+
An object containing the RDAP or WHOIS information for the domain.
|
|
25
|
+
|
|
26
|
+
- `found` (boolean): Whether the domain could be found via RDAP or port 43 lookup.
|
|
27
|
+
- `registrar` (object): The registrar information for the domain.
|
|
28
|
+
- `id` (string): The registrar's ID (IANA or otherwise).
|
|
29
|
+
- `name` (string): The registrar's name.
|
|
30
|
+
- `email` (string): The registrar's abuse email contact, if available.
|
|
31
|
+
- `reseller` (string): The name of the domain's reseller, if available.
|
|
32
|
+
- `status` (string[]): The EPP statuses for the domain.
|
|
33
|
+
- `statusDelta` (object[]): Any discrepancies in EPP status between the registry response and the registrar response.
|
|
34
|
+
- `status` (string): An EPP status.
|
|
35
|
+
- `thin` (boolean): Whether this EPP status was only found in the registry (thin) response.
|
|
36
|
+
- `thick` (boolean): Whether this EPP status was only found in the registrar (thick) response.
|
|
37
|
+
- `nameservers` (string[]): The nameservers for the domain.
|
|
38
|
+
- `ts` (object): The timestamps associated with the domain, if available.
|
|
39
|
+
- `created` (Date): The registration or creation date for the domain.
|
|
40
|
+
- `updated` (Date): The last update date for the domain.
|
|
41
|
+
- `expires` (Date): The expiration date for the domain.
|
|
42
|
+
|
|
43
|
+
### Example
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { whois } from '@cleandns/whois-rdap';
|
|
47
|
+
|
|
48
|
+
whois('example.com')
|
|
49
|
+
.then((response) => {
|
|
50
|
+
console.log(response);
|
|
51
|
+
})
|
|
52
|
+
.catch((error) => {
|
|
53
|
+
console.error(error);
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
npm install @cleandns/whois
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Caveats / limitations
|
|
64
|
+
|
|
65
|
+
- This package is currently intended for **domain name** lookups only. IPv4/IPv6 address support is not guaranteed.
|
|
66
|
+
|
|
67
|
+
- Parsing of port 43 WHOIS responses is a work in progress.
|
package/dist/port43.js
CHANGED
|
@@ -68,7 +68,7 @@ export async function port43(actor) {
|
|
|
68
68
|
if (!response.found) {
|
|
69
69
|
return response;
|
|
70
70
|
}
|
|
71
|
-
console.log(port43response);
|
|
71
|
+
// console.log(port43response);
|
|
72
72
|
if (port43response.match(/^%*\s+(NOT FOUND|No match|NO OBJECT FOUND|No entries found|No Data Found|Domain is available for registration|No information available|Status: free)\b/im)) {
|
|
73
73
|
response.found = false;
|
|
74
74
|
return response;
|
package/package.json
CHANGED