欢迎使用我们的免费域名可用性搜索器!在这里,您可以即刻查询您理想的域名是否可用。我们支持所有顶级域名 (TLD),包括:
.com
.net
.org
.info
.biz
以及更多
无效域名。请使用有效的格式。";} else {// 检查域名可用性$result = check_domain_availability($domain);// 显示结果if ($result['available']) {echo "
恭喜,域名 $domain 可用!
";} else {echo "
遗憾,域名 $domain 已被注册。
";}}}function check_domain_availability($domain) {// 使用 WHOIS 服务查询域名可用性$whois_server = 'whois.verisign-grs.com';$port = 43;$timeout = 10;// 创建 WHOIS 查询$query = "$domain\r\n";// 建立套接字连接$fp = fsockopen($whois_server, $port, $errno, $errstr, $timeout);if (!$fp) {return array('available' => false, 'error' => "无法连接到 WHOIS 服务器:$errstr");}// 发送查询fwrite($fp, $query);// 读取响应$response = '';while (!feof($fp)) {$response .= fgets($fp, 128);}fclose($fp);// 解析响应$available = false;if (stripos($response, 'No match for') !== false) {$available = true;}return array('available' => $available, 'error' => null);}?>
评论列表 (0条)