Miscellaneous
|
|
|
|
<?php function lookup($domain)
{
exec("host -t ns $domain",$hasil);
if (ereg("host not found.",strtolower(trim($hasil[0]))))
// It possible only 1 ns or not found
{
return false;
} else
{
$hasilstr="";
for ($i=0;$i<=count($hasil);$i++)
{
$hasilstr.=ereg_replace("$domain name server","<LI>",$hasil[$i])."<BR>";
}
return $hasilstr;
}
}
?>
|
|
|
Usage Example
|
<? if (lookup("stiawan.net"))
{
echo "stiawan.net already use";
} else
{
echo "stiawan.net is available";
} ?>
|
|
|
Rate This Script
|
|
|
|