<?php
// Name this script dns.php
/* Requires the NET PEAR package, install it in your cpanel */
include("Net/DNS.php");
$ndr = new Net_DNS_Resolver();
$ip = $ndr->search("$_GET['sd']", "A");
if ($ip) {
echo("Exists")
}
else {
echo("Domain is available")
}
?>
<form method="GET" action="dns.php">
Enter a subdomain to test: <input name="sd" type="text">
</form>