Saved,由于原有whoisAPI失效,改用WHOIS命令查询,速度更快,但是需要安装whois命令,RHEL下yum install whois即可
This commit is contained in:
@@ -7,6 +7,29 @@ use yzh52521\EasyHttp\Http;
|
||||
use yzh52521\EasyHttp\RequestException;
|
||||
use GeoIp2\Database\Reader;
|
||||
|
||||
$whois = Http::get('https://api.devopsclub.cn/api/whoisquery?type=json&standard=true', ['domain' => "laysense.com"])->body();
|
||||
print_r(json_decode($whois));
|
||||
declare(ticks = 1);
|
||||
function whoislookup($domain){
|
||||
$whois = new Whois();
|
||||
$query = $domain;
|
||||
$result = $whois->Lookup($query,false);
|
||||
echo '<pre>';
|
||||
print_r($result);
|
||||
echo '</pre>';
|
||||
}
|
||||
function sig()
|
||||
{
|
||||
throw new Exception;
|
||||
}
|
||||
try
|
||||
{
|
||||
pcntl_alarm(5);
|
||||
pcntl_signal(SIGALRM, "sig");
|
||||
whoislookup('layso.de');
|
||||
pcntl_alarm(0);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "timeout\n";
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user