Home >Backend Development >PHP Tutorial >php写的域名查询系统whois_PHP

php写的域名查询系统whois_PHP

WBOY
WBOYOriginal
2016-06-01 12:26:451039browse

WHOIS

if ($domain)
{
if ($domain)
{

$fp = fsockopen( "rs.internic.net", 43, &$errno, &$errstr, 10);
if (!$fp)
{
echo "$errstr ($errno)
n";
}
else
{
fputs($fp, "$domainrn");
while(!feof($fp))
{
$buf = fgets($fp,128);
if (ereg( "Whois Server:", $buf))
{
$server = str_replace( "Whois Server: ", "", $buf);
$server = trim($server);
}
}
fclose($fp);
}
if ($server)
{
echo "$domain is registered at $server:
";
echo "
"; <br>$fp = fsockopen($server, 43, &$errno, &$errstr, 10); <br>if(!$fp) <br>{ <br>echo "Could not open connection to $server on port 43.n"; <br>echo "$errstr ($errno)<br>n"; <br>} <br>else <br>{ <br>fputs($fp, "$domainrn"); <br>while(!feof($fp)) <br>{ <br>echo fgets($fp,128); <br>} <br>fclose($fp); <br>} <br>} <br>else { <br>echo( "<b>$domain does not appear to be registered.</b><br>"); <br>} <br>echo ( "

");
}

}
?>

查找 .com, .org, and .net 主机

主机名:


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:自动发布新闻的php代码_PHPNext article:php4的彩蛋_PHP