LayeredStudio / whoiser

🌍 Easy to use WHOIS info for domains, TLDs and IPs
MIT License
215 stars 32 forks source link

Support for TLDs .dj, .gr, .np, .pa, and .vn #89

Open jonathansampson opened 1 year ago

jonathansampson commented 1 year ago

Version(s) affected: 1.14.0

Description

Error: TLD <domain with one of the aforementioned TLDs> not found
    at whoisTld (whoiser.js:118:9)
    at async whoisDomain (whoiser.js:137:15)

Side Note: Phenomenal work on this utility. I reviewed a few similar options on npm, and your dedication to quality made whoiser the clear winner.

AndreiIgna commented 1 year ago

this is not kinda fixed by #86

To query WHOIS for a domain, the library needs to know the WHOIS server for that TLD. It finds it in this order: 1) cached/hard-coded whois server https://github.com/LayeredStudio/whoiser/blob/master/src/whoiser.js#L9 2) query whois.iana.org for TLD info 3) when no tld.whois is found, query alternate TLD sources #80

The error was returned because tld.whois was empty. Now the library doesn't throw an error, but it returns the TLD info without whois. Example for .vn:

Screenshot 2023-02-04 at 12 38 59

For cases like these, the TLD whois server needs to be found and added in the whoiser.js -> cacheTldWhoisServer variable