checkdnsrr() returns wrong info(checkdnsrr() 返回错误信息)
问题描述
$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';
?>
这篇关于checkdnsrr() 返回错误信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:checkdnsrr() 返回错误信息
基础教程推荐
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- PHP 守护进程/worker 环境 2022-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 使用 PDO 转义列名 2021-01-01