-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoconfig feature #37
Comments
Wow! Very good feature. |
Currently you can use workaround with:
|
Thanks for the response! The suggestion is based on the fact that sometimes php-whois picks up a wrong server for a particular TLD, and central management for TLDs is not very efficient. Then I ran across the answer in stackExchange on how to find a current whois server for a particular TLD. |
Your suggestion is OK.
What you mean? Do you create every time for query a new instance of Whois like this |
I am using a single property, as in my quoted example: What I mean is that config cannot be validated on every run, as it is too resource and time consuming. I suggest to have some sort of a config-cache, which can be updated or completely rebuilt anytime, leaving the TLD to server matching up to the end user, not maintaining it centrally any more. |
I see. OK Notes:
$tlds = TldHelper::loadTldList();
var_dump([
'tlds' => $tlds,
]);
$server = TldServer::fromData(['zone' => '_', 'host' => 'whois.iana.org']);
$parser = $server->getParser();
$mod = Whois::create()->getTldModule();
foreach ($tlds as $tld) {
$info = $parser->parseResponse($mod->loadResponse($server, $tld));
if ($info) {
var_dump([ $tld => $info->getWhoisServer() ]);
}
} |
I think it is better to use DNS_CNAME
|
Thanks!
Here some code used for testing: $tlds = TldHelper::loadTldList();
var_dump([
'tlds' => $tlds,
]);
$server = TldServer::fromData(['zone' => '_', 'host' => 'whois.iana.org']);
$parser = $server->getParser();
$mod = Whois::create()->getTldModule();
foreach ($tlds as $tld) {
$info = $parser->parseResponse($mod->loadResponse($server, $tld));
if ($info) {
var_dump([ $tld => $info->getWhoisServer() ]);
}
} |
amphp and reactphp have a lot of functions for async and child process. amphp/parallel I think the best way is a public github list with daily automatic push.
exclude is nice to "not update" certain tld's. |
very excited to see this feature added to the master branch since updating the list is time-consuming, would it make sense to keep a globally updated list somewhere that updates once a day so the rest of us can pull in through a simple get json request? |
Actually loading tld list can be done in current version with minor overhead: I don't like idea to host and update this custom server list in github, because it's needed to write some kind of bot and cron. Looks like reinventing the wheel because I've seen many lists like that in other repositories (and some of these are dead or not updating anymore) and it's not guarantee this list are actual and valid. |
Description
php-whois configuration for TLDs is centrally distributed, changes in whois servers' config have to be reported as issues, then committed to the config file, then redistributed via git/composer.
However, to find out a whois server name for a particular TLD, one can use the following shell script:
Example
Implement a TldServer::getWhoisServer($tld) method that returns a server name using this command (use php system call for that)
Implement a TldServer::getTldList method to get the TLD list from the official site http://data.iana.org/TLD/tlds-alpha-by-domain.txt
Implement a updateConfig($tld) method (not sure which class it belongs to), that allows to query the server for an individual tld, or the whole list.
Make config file non-distributable, keep only sample file and possible parser-to-tld configuration
The text was updated successfully, but these errors were encountered: