checkdnsrr() 返回错误信息

2022-01-04 00:00:00 php dns
$dname = "accurst.com";
$recordexists = checkdnsrr($dname, "ANY");

if ($recordexists) 
  echo $dname." is taken. Sorry!<br>";
else 
  echo $dname." is available!<br>";

这是一个返回错误信息的示例域.它说它可用但是该域名是 2800 美元的优质域名有什么方法可以表明它不可用,因为它没有与任何人解除绑定?换句话说,如果我查找:accurstttt.com 现在可用accurst.com 应该说:不可用我尝试了其他不同的域名,但它一直显示它们可用,而它们是优质的.任何输入都会非常有帮助,谢谢

this is an example domain that returns the wrong info. It says its available but the domain is a premium domain name of 2800 dollars is there any way for it to show that it's not available since it is not untied to anyone? in other words if I look up: accurstttt.com now that's available and accurst.com should say : not available i tried different other domain names and it keeps showing they are available while they are premium. any input would be very helpful thank you

推荐答案

<?php

function checkDomainAvailability($domain_name){

$server = 'whois.crsnic.net';

// Open a socket connection to the whois server
$connection = fsockopen($server, 43);
if (!$connection) return false;

// Send the requested doman name
fputs($connection, $domain_name."
");

// Read and store the server response
$response_text = ' :';
while(!feof($connection)) {
$response_text .= fgets($connection,128);
}

// Close the connection
fclose($connection);

// Check the response stream whether the domain is available
if (strpos($response_text, 'No match for')) return true;
else return false;
}


$domainname = 'accurst.com';

if(checkDomainAvailability($domainname)) echo 'Domain : '.$domainname.' is Available';
else echo 'Domain : '.$domainname.' is Already Taken';

?>

相关文章