Always want to find a free unlimited frequency domain name query interface, online find for a long time did not find, finally simply write a domain name lookup interface, the principle is directly with PHP to find the domain name whois information, but directly find whois too slow, you want to first find the domain name of the NS record, If there is an NS record, this domain name is already registered, so theoretically should be faster, this idea is right?
Now I use PHP dns_get_record query DNS information domain name, but this speed really dare not compliment ha, tried a lot of domain names, basically average query time in more than a minute! Several times have been hung off, completely unlike the online domain registrar as fast, no U.S. host, want to ask, if the U.S. host running Dns_get_record will be faster?
Reply content:
Always want to find a free unlimited frequency domain name query interface, online find for a long time did not find, finally simply write a domain name lookup interface, the principle is directly with PHP to find the domain name whois information, but directly find whois too slow, you want to first find the domain name of the NS record, If there is an NS record, this domain name is already registered, so theoretically should be faster, this idea is right?
Now I use PHP dns_get_record query DNS information domain name, but this speed really dare not compliment ha, tried a lot of domain names, basically average query time in more than a minute! Several times have been hung off, completely unlike the online domain registrar as fast, no U.S. host, want to ask, if the U.S. host running Dns_get_record will be faster?
Just tested the Alexa top 500 domain name, the maximum time consuming 12.2S, minimum less than 0.001S.
At the same time I emptied the DNS cache of this machine beforehand.
This can be done because each domain name contains at least one NS record.
Slow is the reason for your machine, I test up to 3S in this machine.
Get a post in a period of time there will be a cache, I think you can modify the DNS server to see if there is any improvement
$start=microtime(true);$domain='segmentfault.com';$rs=dns_get_record(strtolower($domain),DNS_NS);print_r($rs);$end=microtime(true);echo $end-$start;