欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php写的域名查询系统whois_PHP教程

程序员文章站 2024-02-20 09:05:34
...
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 "
"; 
$fp = fsockopen($server, 43, &$errno, &$errstr, 10);
if(!$fp)
{
echo "Could not open connection to $server on port 43.n";
echo "$errstr ($errno)
n";
}
else
{
fputs($fp, "$domainrn");
while(!feof($fp))
{
echo fgets($fp,128);
}
fclose($fp);
}
}
else {
echo( "$domain does not appear to be registered.
");
}
echo ( "

");
}

}
?>

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

主机名:



www.bkjia.comtruehttp://www.bkjia.com/PHPjc/532510.htmlTechArticle?PHP if ($domain) { if ($domain) { $fp = fsockopen( "rs.internic.net", 43, $errno, $errstr, 10); if (!$fp) { echo "$errstr ($errno)brn"; } else { fputs($fp, "$domainrn"); while(!fe...