Closed sirkokoenig closed 2 years ago
Most whois servers do not accept calls that are too close, often after a certain number of calls they block the IP for a few minutes.
This also happens when trying to quickly make many calls directly from the whois command via the shell.
Obviously not all whois servers have the same rules, but I have tested this on many, to solve I put a sleep between one call and the other when I do bulk checks.
I tried to make 5 calls to the whois.namesilo.com server from the shell, within 1 second of each other and my ip was blocked refusing further calls.
In that case list of proxies should be used (when lots of requests in short period of time needed) Or a custom Loader with proxy list support
CurlLoader supports proxy opts - https://github.com/io-developer/php-whois#proxy-with-socks5
PHP-Whois version: 4.1.6
PHP version: 8.0
Description
When I make over 8-10 request in a foreach loop to a specific whois server (in this case whois.namesilo.com) , I get a timeout error: fsockopen(): Unable to connect to whois.namesilo.com:43 (Connection timed out) Also it tries for a long time and then the script runs in php timeout.
How to reproduce
Make a foreach and choose minimum 8-10 domains from namesilo.
Possible Solution
Is it possible to set a shorter timeout on this request here, to avoid that the script runs in timeout? Or someone has an idea to avoid that I get the connection timeout at whois.namesilo.com? It seems that the server from then stop accepting connections for short time blocks, if request come too fast.
Additional context
/XXX/htdocs/XXXXXX/vendor/io-developer/php-whois/src/Iodev/Whois/Loaders/SocketLoader.php:57