Alan Adı Sorgulama

<?php
Class AlanAdi{
	var $content;
	var $bilgi;
	function kontrol($adres){
		if (!empty($adres)){
			$a= parse_url($adres);
			if(isset($a["host"])){
				$sunucu=$a["host"];
			}else{
				$sunucu=$adres;
			}
			$url="https://reports.internic.net/cgi/whois?whois_nic=".$sunucu."&type=domain";
			$ch= curl_init($url);
			curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
			curl_setopt($ch,CURLOPT_HEADER,false);
			curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
			curl_setopt($ch,CURLOPT_USERAGENT,"Googlebot/2.1 (+http://www.google.com/bot.html)");
			curl_setopt($ch,CURLOPT_HTTPHEADER,array('Referer: https://www.internic.net/whois.html'));
			$this->content=curl_exec($ch);
			curl_close($ch);
			if(strstr($this->content,"No match for adres")){
				return false;
			}else{
				return true;
			}
		}else{
			return false;
		}
	}
	function bilgi($adres){
			if($this->kontrol($adres)){
				preg_match("/pre>(.*?)</si",$this->content,$cikti);
				return explode("\n",$cikti[1]);
			}
			
		}
}
$w=new AlanAdi;
print_r($w->bilgi("ulusanyazilim.com"));
?>

Çıktısı

Array
(
    [0] => 
    [1] =>    Domain Name: ULUSANYAZILIM.COM
    [2] =>    Registry Domain ID: 1779058037_DOMAIN_COM-VRSN
    [3] =>    Registrar WHOIS Server: whois.ihs.com.tr
    [4] =>    Registrar URL: http://www.ihs.com.tr
    [5] =>    Updated Date: 2018-02-06T22:31:04Z
    [6] =>    Creation Date: 2013-02-08T01:19:52Z
    [7] =>    Registry Expiry Date: 2020-02-08T01:19:52Z
    [8] =>    Registrar: IHS Telekom, Inc.
    [9] =>    Registrar IANA ID: 1091
    [10] =>    Registrar Abuse Contact Email:
    [11] =>    Registrar Abuse Contact Phone:
    [12] =>    Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
    [13] =>    Name Server: NS1.IHSDNSX34.COM
    [14] =>    Name Server: NS2.IHSDNSX34.COM
    [15] =>    DNSSEC: unsigned
    [16] =>    URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
    [17] => >>> Last update of whois database: 2018-06-05T14:35:47Z 
)

 

Sizin Değerli Görüşlerinize İhtiyacımız Var.