⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 whois.php

📁 网站综合信息查询工具SiteInfoChecker v1.0 飞狐源码站
💻 PHP
📖 第 1 页 / 共 4 页
字号:
$dtd[]=".ac.th,whois.thnic.net,no entries found";
$dtd[]=".co.th,whois.thnic.net,no entries found";
$dtd[]=".go.th,whois.thnic.net,no entries found";
$dtd[]=".in.th,whois.thnic.net,no entries found";
$dtd[]=".mi.th,whois.thnic.net,no entries found";
$dtd[]=".net.th,whois.thnic.net,no entries found";
$dtd[]=".or.th,whois.thnic.net,no entries found";
$dtd[]=".tj,whois.nic.tj,no match for";
$dtd[]=".tk,whois.dot.tk,not known";
$dtd[]=".tl,whois.nic.tl,!!!dom!!!!!!domt!!!\nstatus: not registered";
$dtd[]=".tm,whois.nic.tm,no match";
$dtd[]=".to,whois.tonic.to,no match";
$dtd[]=".tp,whois.nic.cx,!!!dom!!!!!!domt!!!\nstatus: not registered";
$dtd[]=".bbs.tr,whois.metu.edu.tr,no match";
$dtd[]=".com.tr,whois.metu.edu.tr,no match";
$dtd[]=".edu.tr,whois.metu.edu.tr,no match";
$dtd[]=".gen.tr,whois.metu.edu.tr,no match";
$dtd[]=".gov.tr,whois.metu.edu.tr,no match";
$dtd[]=".k12.tr,whois.metu.edu.tr,no match";
$dtd[]=".mil.tr,whois.metu.edu.tr,no match";
$dtd[]=".net.tr,whois.metu.edu.tr,no match";
$dtd[]=".nom.tr,whois.metu.edu.tr,no match";
$dtd[]=".org.tr,whois.metu.edu.tr,no match";
$dtd[]=".web.tr,whois.metu.edu.tr,no match";
$dtd[]=".tv,*tvwhois,is available";
$dtd[]=".com.tw,whois.twnic.net.tw,no such domain name";
$dtd[]=".idv.tw,whois.twnic.net.tw,no such domain name";
$dtd[]=".net.tw,whois.twnic.net.tw,no such domain name";
$dtd[]=".org.tw,whois.twnic.net.tw,no such domain name";
$dtd[]=".com.ua,whois.com.ua,no entries found";
$dtd[]=".edu.ua,whois.com.ua,no entries found";
$dtd[]=".gov.ua,whois.com.ua,no entries found";
$dtd[]=".org.ua,whois.com.ua,no entries found";
$dtd[]=".net.ua,whois.com.ua,no entries found";
$dtd[]=".ua,whois.com.ua,no entries found";
$dtd[]=".co.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".or.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ac.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".sc.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".go.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ne.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ac.uk,whois.ja.net,no entries were found";
$dtd[]=".co.uk,whois.nic.uk,no match";
$dtd[]=".gov.uk,whois.ja.net,no entries were found";
$dtd[]=".ltd.uk,whois.nic.uk,no match";
$dtd[]=".me.uk,whois.nic.uk,no match";
$dtd[]=".net.uk,whois.nic.uk,no match";
$dtd[]=".org.uk,whois.nic.uk,no match";
$dtd[]=".plc.uk,whois.nic.uk,no match";
$dtd[]=".sch.uk,whois.nic.uk,no match";
$dtd[]=".uk.co,whois.uk.co,no matches";
$dtd[]=".us,whois.nic.us,not found";
$dtd[]=".va,whois.ripe.net,no entries found";
$dtd[]=".vg,whois.adamsnames.tc,not registered";
$dtd[]=".com.ws,whois.worldsite.ws,no match";
$dtd[]=".edu.ws,whois.worldsite.ws,no match";
$dtd[]=".gov.ws,whois.worldsite.ws,no match";
$dtd[]=".net.ws,whois.worldsite.ws,no match";
$dtd[]=".org.ws,whois.worldsite.ws,no match";
$dtd[]=".ws,whois.worldsite.ws,no match";
$dtd[]=".co.za,*zawhois,no matches";
$dtd[]=".au.com,whois.au.com,no domains";
$dtd[]=".br.com,whois.centralnic.com,no match";
$dtd[]=".cn.com,whois.centralnic.com,no match";
$dtd[]=".de.com,whois.centralnic.com,no match";
$dtd[]=".eu.com,whois.centralnic.com,no match";
$dtd[]=".eu.org,whois.eu.org,no entries found";
$dtd[]=".gb.com,whois.centralnic.com,no match";
$dtd[]=".gb.net,whois.centralnic.com,no match";
$dtd[]=".hu.com,whois.centralnic.com,no match";
$dtd[]=".no.com,whois.centralnic.com,no match";
$dtd[]=".qc.com,whois.centralnic.com,no match";
$dtd[]=".ru.com,whois.centralnic.com,no match";
$dtd[]=".sa.com,whois.centralnic.com,no match";
$dtd[]=".se.com,whois.centralnic.com,no match";
$dtd[]=".se.net,whois.centralnic.com,no match";
$dtd[]=".uk.com,whois.centralnic.com,no match";
$dtd[]=".uk.net,whois.centralnic.com,no match";
$dtd[]=".us.com,whois.centralnic.com,no match";
$dtd[]=".uy.com,whois.centralnic.com,no match";
$dtd[]=".za.com,whois.centralnic.com,no match";
$dtd[]=".za.net,whois.za.net,no such domain";
$dtd[]=".za.org,whois.za.net,no such domain";
$dtd[]=".aero,whois.information.aero,is not registered";
$dtd[]=".com,whois.crsnic.net,no match";
$dtd[]=".net,whois.crsnic.net,no match";
$dtd[]=".org,whois.publicinterestregistry.net,not found";
$dtd[]=".info,whois.afilias.net,not found";
$dtd[]=".museum,whois.museum,is available";
$dtd[]=".name,whois.nic.name,no match";
$dtd[]=".biz,whois.neulevel.biz,not found";
$dtd[]=".cc,whois.nic.cc,no match";
$dtd[]=".edu,whois.educause.net,no match";
$dtd[]=".mil,whois.nic.mil,no match";
$dtd[]=".int,whois.iana.org,not found";
$dtd[]=".coop,whois.nic.coop,no objects found";

function cWhois($dom,$domt,&$RegDetails)
{
  global $dtd;
  $dom=trim($dom);
  $domt=trim($domt);
  // Check referer
  if (1!=CheckReferer())
  {
    return(4); // Referer is  not allowed
  }
  $dom=accentstrtolower($dom);
  $domt=strtolower($domt);
  // Remove http://www. or www. if user added this
  if (strcmp("http://www.",substr($dom,0,11))==0)
  {
    $dom=substr($dom,11,strlen($dom)-11);
  }
  if (strcmp("www.",substr($dom,0,4))==0)
  {
    $dom=substr($dom,4,strlen($dom)-4);
  }
  // If $domt is blank then try to get it
  $found=0;
  if ($domt=="")
  {
    // Treat .name slightly differently
    if (substr($dom,strlen($dom)-5,5)==".name")
    {
      $domt=".name";
      $dom=substr($dom,0,strlen($dom)-5);
      $found=1;
    }
    else
    {
      // Get domain extension by taking everything from first '.'
      $pos=strpos($dom,".");
      if (is_integer($pos))
      {
        $pdomt=substr($dom,$pos,strlen($dom)-$pos);
      }
      for ($index=0;$index<count($dtd);$index++)
      {
        $dt=strtok($dtd[$index],",");
        if (strcasecmp($dt,$pdomt)==0)
        {
          $domt=$pdomt;
          $dom=substr($dom,0,strlen($dom)-strlen($dt));
          $found=1;
          break;
        }
      }
    }
    if ($found==0)
    {
      return(2); // Domain extension not recognised
    }
  }
  if (1!=CheckValidDomain($dom,$domt))
  {
    return(3); // Not a valid domain name
  }
  $serv="";
  for ($index=0;$index<count($dtd);$index++)
  {
    if (strtok($dtd[$index],",")==$domt)
    {
      $serv=strtok(",");
      $no=strtok(",");
      break;
    }
  }
  if ($serv=="")
  {
    return(2); // Domain type not recognised
  }
  $available=0;
  // Add support for domains that have no whois server but use a script to perform lookup.
  // Whois server is actually a function name flagged with a * as the first character which we remove.
  if (substr($serv,0,1)!="*")
  {
	  $noserv2=0;
	  if ($RegDetails=="*")
	  {
	    $RegDetails="";
	    $noserv2=1;
	  }
    //exec("whois -h $serv $dom$domt",$RegDetails,$ReturnValue);
    //exec("fwhois $dom$domt@$serv",$RegDetails,$ReturnValue);
    $rsck=wh($serv,$dom,$domt,$RegDetails,$buf);
  }
  else
  {
    $func=substr($serv,1,strlen($serv)-1);
    return($func($dom,$domt,$RegDetails)); // Return direct from handling function
  }
  // If checking .com or .net then also try whois.internic.net instead if failed
  if (($domt==".com") || ($domt==".net"))
  {
	  if ((count($RegDetails)<=1) || ($rsck==0))
	  {
	      $rsck=wh("whois.internic.net",$dom,$domt,$RegDetails,$buf);
			  if ((count($RegDetails)<=1) || ($rsck==0))
          return(5); // No connection of blocked etc for .com or .net
	  }
  }
  if ((count($RegDetails)==0) || ($rsck==0))
  {
    return(5); // No connection to whois server made
  }
  $serv2="";
  for($index=0;$index<count($RegDetails);$index++)
  {
    $lne=strtolower($RegDetails[$index]);
    $pos=strpos($lne,"whois server:");
    if (is_integer($pos))
    {
      $serv2=substr($lne,$pos+13,strlen($RegDetails[$index])-13);
      $serv2=trim($serv2);
    }
  }
  // Normally we check for a phrase that exists when domain name is not found.
  // First check to see if we are doing the reverse
  $no=str_replace("!!!dom!!!",$dom,$no);
  $no=str_replace("!!!domt!!!",$domt,$no);
  if (substr($no,0,4)=="<!?>")
  {
    $no=substr($no,4,strlen($no)-4);
  	$available=1;
    $pos=strpos(strtolower($buf),$no);
    if (is_integer($pos))
    {
      $available=0;
    }
  }
  else
  {
  	$available=0;
    $pos=strpos(strtolower($buf),$no);
    if (is_integer($pos))
    {
      $available=1;
    }
	}
  if ($available==1)
  {
    return(0); // Domain is not registered
  }
  if ($noserv2==1)
    return(1); // Return now as full whois not required for the following extensions
  if (($domt==".com") || ($domt==".net") || ($domt==".org") || ($domt==".cc"))
  {
    if ($serv2!="")
    {
      // exec("whois -h $serv2 $dom$domt",$RegDetails,$ReturnValue);
      // exec("fwhois $dom$domt@$serv2",$RegDetails,$ReturnValue);
      $rsck=wh($serv2,$dom,$domt,$RegDetails2,$buf2);
			// if checking .com or .net and whois fails then try whois.networksolutions.com instead
      if ((count($RegDetails2)<=1) || ($rsck==0))
      {
		    if (($domt==".com") || ($domt==".net"))
        {
	  	    $rsck=wh("whois.networksolutions.com",$dom,$domt,$RegDetails2,$buf2);
        }
      }
      if ((count($RegDetails2)<=1) || ($rsck==0))
      {
        return(1); // No connection to second whois server made but return that domain is registered
      }
      $RegDetails=$RegDetails2;
      $buf=$buf2;
    }
  }
  return(1); // Domain is registered
}

function wh($serv,$dom,$domt,&$regdet,&$buf)
{
	$IDN = new idna_convert();
  $regdet="";
  $timeout=10.0;
  $stoptime=time()+$timeout;
  $connection=@fsockopen($serv,43,$errorno,$errordesc,$timeout);
  if ($connection)
  {
//		stream_set_timeout($connection, $timeout);
    // If necessary create punycode from domain name
    if (($domt==".no") || ($domt==".ch") || ($domt==".li") || ($domt==".at") || ($domt==".se") || ($domt==".com") || ($domt==".net"))
    {
	  	$idndom = $IDN->encode($dom.$domt);
    	fputs($connection,"$idndom\r\n");
    }
    else
    {
    	fputs($connection,"$dom$domt\r\n");
    }
    $timedout=0;
	  $buf="";
	  do
	  {
	   $buf1 = fread($connection, 100000);
	   if (strlen($buf1) == 0)
	   {
	       break;
	   }
	   $buf .= $buf1;
	  }
	  while (true);
    fclose($connection);
    $regdet=explode("\n",$buf);
  	return(1);
  }
  else
    return(0);
}

function CheckReferer()
{
  global $HTTP_REFERER,$allowed;
  if ($allowed=="")
  {
    return(1); // Don't care who called us
  }
  $ref=strtolower($HTTP_REFERER);
  $allowed=strtolower($allowed);
  $refall=split(",",$allowed,100);
  for ($index=0;$index<count($refall);$index++)
  {
    $pos=strpos($HTTP_REFERER,$refall[$index]);
    if (is_integer($pos))
    {
      if ($pos==0)
      {
        return(1); // Referer allowed access
      }
    }
  }
  return(0);
}

function CheckValidDomain($dom,$domt)
{
  $dom=accentstrtolower($dom);
  $domt=strtolower($domt);
  // Handle .name seperately
  if ($domt==".name")
  {
		if (is_integer(strpos($dom,".")))
		{
			$section=explode(".",$dom);
	    $first=$section[0];
	    $last=$section[1];
	    if (isset($section[2]))
	      return(0);
			if (ereg("^[-a-zA-Z0-9]{1,63}$",$first)!=True)
				return(0);
			if (($first[0]=="-") || ($first[strlen($first)-1]=="-"))
				return(0);
			if (ereg("^[-a-zA-Z0-9]{3,63}$",$last)!=True)
				return(0);
			if (($last[0]=="-") || ($last[strlen($last)-1]=="-"))
				return(0);
		}
		else
		{
	    if (ereg("^[-a-zA-Z0-9]{3,63}$",$dom)!=True)
		    return(0);
	    if (($dom[0]=="-") || ($dom[strlen($dom)-1]=="-"))
		    return(0);
		}
		return(1);
  }
  // .ac.uk, .gov.uk, .ltd.uk, .plc.uk and .sch.uk do not allow 1 character domain names
  if (($domt==".ac.uk") || ($domt==".gov.uk") || ($domt==".ltd.uk") || ($domt==".plc.uk") || ($domt==".sch.uk"))
  {
    if (strlen($dom)<=1)
      return(0);
  }
  // .co.uk, .me.uk, .org.uk and .net.uk do not allow 1 character domain names
  if (($domt==".co.uk") || ($domt==".me.uk") || ($domt==".org.uk") || ($domt==".net.uk"))
  {
    if (strlen($dom)<=2)
      return(0);
  }
  // .info and .biz dont allow 1 and 2 character domain names
  if (($domt==".info") || ($domt==".biz"))
  {
    if (strlen($dom)<=2)
      return(0);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -