regru / Net-Whois-Raw

Get Whois information for domains
Other
11 stars 14 forks source link

The registrar whois server can be given with protocol #27

Closed thibault-deriv closed 6 months ago

thibault-deriv commented 6 months ago

Current addressed issue

The code as of today does not well recognize the URl string of the registrar whois server when it is presented with http://:

$ pwhois domains.org -d
recurse to http
Use of uninitialized value $IO::Socket::errstr in concatenation (.) or string at /usr/local/share/perl/5.30.0/Net/Whois/Raw.pm line 310.
recursive query failed
[whois.pir.org]
Domain Name: domains.org
[...]

It fails because it tries to recurse to simply http

If we look at "first" response and value of Registrar WHOIS server: we see the URL has protocol (http://whois.enom.com):

$ pwhois domains.org -F
[whois.pir.org]
Domain Name: domains.org
Registry Domain ID: b970e91c2e8642be8a691bda682eb666-LROR
Registrar WHOIS Server: http://whois.enom.com
[...]

With this change

$ perl -Ilib bin/pwhois domains.org -d
recurse to whois.enom.com
[whois.enom.com]

Domain Name: domains.org
[...]

It should not impact the case where the protocol is not given, for instance:

$ perl -Ilib bin/pwhois domains.me -d
recurse to whois.identitydigital.services
[whois.identitydigital.services]
Domain Name: domains.me
[...]

Where the URL is provided without protocol:

$ pwhois domains.me -F
[whois.nic.me]
Domain Name: domains.me
Registry Domain ID: aa3f133e72ec440b8760ee14a0ec49a7-DONUTS
Registrar WHOIS Server: whois.identitydigital.services
[...]

Please double check my regex update :smiley:

nalobin commented 6 months ago

Hello! "Registrar WHOIS Server: http://whois.enom.com" of course is incorrect value approved by registry operator from registrar.

LGTM