php-whois
php-whois copied to clipboard
Restricted domains resulting as 'available'
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.
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:
- "Error: too many requests - limit reached" or
- whois.domain-registry.nl: maximum number of requests per second exceeded
It cannot handle this response correctly which always results in a isDomainAvailable => TRUE.
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