io-developer / php-whois

PHP WHOIS provides parsed and raw whois lookup of domains and ASN routes. PHP 8.0 compatible (5.4+ old versions)
MIT License
442 stars 118 forks source link

Restricted domains resulting as 'available' #132

Open ramonschriks opened 4 years ago

ramonschriks commented 4 years ago

PHP-Whois version: 4.0.0

PHP version: 7.2

Description
Some whois servers can return a response containing info about the queried domain name that it is restricted. Example:

$ whois -h whois.donuts.co google.kitchen

The registration of this domain is restricted, as it is protected by the Donuts DPML Brand Protection policy. Additional information can be found at https://donuts.domains/what-we-do/brand-protection.

Terms of Use: Donuts Inc. ........

When using the whois service within this library, using the isDomainAvailable call, the response will be TRUE while the domain is in fact not available.

How to reproduce
Factory::get()->createWhois()->isDomainAvailable('google.kitchen'); will return TRUE

Possible Solution
The whois response is very clear: The registration of this domain is restricted. So it might be the best to parse this correctly.

ramonschriks commented 4 years ago

I've found a similar problem to the above. When firing multiple request in a short matter of time for certain whois-servers (in this case i've used a .nl domain), the whois server is responding with:

It cannot handle this response correctly which always results in a isDomainAvailable => TRUE.

bessone commented 4 years ago

I've found similar problems few months ago, for example several TLDs return a "reserved" message google.xin, galbani.name, singapore.xn--yfro4i67o (different messages but the meaning is the same)

Also the whois.nic.sg server sometimes returns "Service is not available." and whois.dot.ga returns "WHOIS lookup for DOMAIN.GA can temporarily not be answered. Please try again."

You have to manage various messages for different TLDs, but in recent months I have never had time to get my hands on them