1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>WHOIS - Pour savoir à qui appartient un nom de domaine</title>
<style type="text/css">
<!--
body {
color: black;
}
#conteneur {
text-align: center;
}
#search {
margin-left: auto;
margin-right: auto;
text-align: center;
background-color:#CCCCCC;
border:1px solid black;
padding:15px 5px 5px 5px;
width:400px;
}
-->
</style></head>
<body>
<div id="conteneur">
<h2>WHOIS</h2>
<div id="search">
<form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF; ?>">
www.<input name="domaine" type="text" size="30" />
<input type="submit" name="Submit" value="Soumettre" />
</form>
</div>
</div>
<?php
/********************************************************/
/* +--------------------------------------+ */
/* | Script WHOIS | */
/* | par Sven CAILTEUX | */
/* | http://www.dimension-internet.com/ | */
/* | info@dimension-internet.com | */
/* +--------------------------------------+ */
/********************************************************/
if($_POST['domaine']){
$whois_serveurs = array(
"ac"=>"whois.nic.ac",
"al"=>"whois.ripe.net",
"am"=>"whois.amnic.net",
"as"=>"whois.nic.as",
"at"=>"whois.ripe.net",
"au"=>"whois.aunic.net",
"az"=>"whois.ripe.net",
"ba"=>"whois.ripe.net",
"be"=>"whois.dns.be",
"bg"=>"whois.ripe.net",
"biz"=>"whois.pacificroot.com",
"br"=>"whois.registro.br",
"by"=>"whois.ripe.net",
"ca"=>"whois.cira.ca",
"cc"=>"whois.nic.cc",
"ch"=>"whois.nic.ch",
"ck"=>"whois.ck-nic.org.ck",
"cn"=>"whois.cnnic.net.cn",
"com"=>"rs.internic.net",
"cx"=>"whois.nic.cx",
"cy"=>"whois.ripe.net",
"cz"=>"whois.nic.cz",
"de"=>"whois.denic.de",
"dk"=>"whois.dk-hostmaster.dk",
"dz"=>"whois.ripe.net",
"edu"=>"rs.internic.net",
"ee"=>"whois.ripe.net",
"eg"=>"whois.ripe.net",
"es"=>"whois.ripe.net",
"fi"=>"whois.ripe.net",
"fj"=>"whois.usp.ac.fj",
"fo"=>"whois.ripe.net",
"fr"=>"whois.nic.fr",
"gb"=>"whois.ripe.net",
"ge"=>"whois.ripe.net",
"gov"=>"whois.nic.gov",
"gr"=>"whois.ripe.net",
"gs"=>"whois.adamsnames.tc",
"hk"=>"whois.hknic.net.hk",
"hm"=>"whois.registry.hm",
"hr"=>"whois.ripe.net",
"hu"=>"whois.ripe.net",
"id"=>"whois.idnic.net.id",
"ie"=>"whois.domainregistry.ie",
"info"=>"whois.afilias.net",
"int"=>"whois.isi.edu",
"il"=>"whois.ripe.net",
"is"=>"whois.isnet.is",
"it"=>"whois.nic.it",
"jp"=>"whois.nic.ad.jp",
"ke"=>"whois.rg.net",
"kg"=>"whois.domain.kg",
"kr"=>"whois.nic.or.kr",
"kz"=>"whois.domain.kz",
"li"=>"whois.nic.li",
"lk"=>"whois.nic.lk",
"lt"=>"whois.ripe.net",
"lu"=>"whois.ripe.net",
"lv"=>"whois.ripe.net",
"ma"=>"whois.ripe.net",
"md"=>"whois.ripe.net",
"mil"=>"whois.nic.mil",
"mk"=>"whois.ripe.net",
"mm"=>"whois.nic.mm",
"ms"=>"whois.adamsnames.tc",
"mt"=>"whois.ripe.net",
"mx"=>"whois.nic.mx",
"net"=>"rs.internic.net",
"nl"=>"whois.domain-registry.nl",
"no"=>"whois.norid.no",
"nu"=>"whois.nic.nu",
"nz"=>"whois.domainz.net.nz",
"org"=>"rs.internic.net",
"pl"=>"whois.ripe.net",
"pk"=>"whois.pknic.net.pk",
"pt"=>"whois.ripe.net",
"ro"=>"whois.ripe.net",
"ru"=>"whois.ripn.ru",
"se"=>"whois.nic-se.se",
"sg"=>"whois.nic.net.sg",
"si"=>"whois.ripe.net",
"sh"=>"whois.nic.sh",
"sk"=>"whois.ripe.net",
"sm"=>"whois.ripe.net",
"st"=>"whois.nic.st",
"su"=>"whois.ripe.net",
"tc"=>"whois.adamsnames.tc",
"tf"=>"whois.adamsnames.tc",
"tj"=>"whois.nic.tj",
"th"=>"whois.thnic.net",
"tm"=>"whois.nic.tm",
"tn"=>"whois.ripe.net",
"to"=>"whois.tonic.to",
"tr"=>"whois.ripe.net",
"tw"=>"whois.twnic.net",
"ua"=>"whois.ripe.net",
"uk"=>"whois.nic.uk",
"us"=>"whois.isi.edu",
"va"=>"whois.ripe.net",
"vg"=>"whois.adamsnames.tc",
"ws"=>"whois.nic.ws",
"yu"=>"whois.ripe.net",
"za"=>"whois.frd.ac.za"
);
$parseur = explode(".", $_POST['domaine']);
$hote = $whois_serveurs[strtolower($parseur[count($parseur) - 1])];
echo "<strong>Serveur de nom =></strong> ".$hote;
if (empty($hote)) {
echo "<strong>L'extension du domaine <font color=\"red\">" .$_POST['domaine']."</font> est invalide.</strong>";
}
else{
$fp = fsockopen($hote, 43, $errno, $errstr, 10);
fputs($fp, $_POST['domaine']."\r\n");
while(!feof($fp)){
$row = fgets($fp,128);
$buffer .= $row;
if(eregi("Whois Server:", $row))$server = trim(str_replace("Whois Server:", "", $row));
}
fclose($fp);
if(ereg("No match for", $buffer)|| ereg("NOT FOUND", $buffer)){
echo "<p><strong>Le nom de domaine <font color=\"darkgreen\">".$_POST['domaine']."</font> semble libre.</strong><p>";
}
else{
echo "<p><strong>Le nom de domaine <font color=\"red\">".$_POST['domaine']."</font> est déjà pris.</strong></p>";
if($server){
echo "<p><strong><font color=\"red\">".$_POST['domaine']."</font> est enregistré chez $server :</strong></p>";
echo "<pre>";
$fp = fsockopen($server, 43, $errno, $errstr, 10);
fputs($fp, $_POST['domaine']."\r\n");
while(!feof($fp))print fgets($fp,128);
fclose($fp);
echo "</pre>";
}
else{
echo "<pre>$buffer</pre>";
}
}
}
}
?>
</body>
</html> |
Partager