I'm using phpwhois to fetch information on a list of .org domains.
Everything begins fine. However, after the script sorts through about 5 of these, the WHOIS server for .org stops giving me results.
I can sort through many, many .com's and .net's without running into this issue.
Is there any way to choose a different WHOIS sever to query .org domains in or, better yet, stop this from hap开发者_Python百科pening completely?
From what I can tell by reading the code it looks like the server responsible for handling whois requests for the "org" top level domain puts a limit on how many requests you can do within a certain amount of time.
The server used by phpWhoIs for .org domains is org.whois-servers.net. I've also tried whois.pir.org and it has the same limitation.
If you can find a whois server that can handle .org domains with no limit, you can edit the whois.servers.php file to get phpWhoIs to use it. When phpWhoIs is trying to figure out what server to use for a domain it looks in the array $this->WHOIS_SPECIAL to see if it's listed there. If so, it will use whatever server is specified. Just add an entry like this:
'org' => 'reallycool.whois.org',
Where reallycool.whois.org is the whois server you want to use.
Alternatively, you might figure out how long you have to wait after you've hit your request limit and just put a sleep in your script if that's practical for your application.
精彩评论