Root-servers check

This form queries all the nameservers for the root you've specified to find out what their records show for the NS of the domain in question. This is useful if you have submitted nameserver changes and you don't know whether they are yet in any or all roots. It returns a list of what each root (gtld, cctld etc) nameserver is serving as NS records. Repetitive, automated or abusive use of this page is strictly prohibited. If you want to run this yourself, download the source


"; flush(); /* Look up the root servers for this extension */ exec('host -v -t NS '.$ext.'.', $result, $retval); if ($retval != 0) { die("host returned $retval"); } $rootservers = getservers($result); /* Check each root and record its answers */ $nsanswers = array(); echo "Checking "; foreach ($rootservers as $root) { echo "$root...\n"; flush(); unset($result); exec('host -v -t NS '.$domain.'. '.$root, $result, $retval); if ($retval != 0) { die("host returned $retval"); } $nsanswers[$root] = getservers($result); } /* Now go through and determine how many answer groups there are */ /* An answer group is a group of nameservers that return the same result */ $groups = array(); $groupns = array(); foreach ($nsanswers as $root => $answer) { $done = false; foreach ($groups as $groupnum => $group) { if (!count(array_diff($group, $answer)) and !count(array_diff($answer, $group))) { $groupns[$groupnum][] = $root; $done = true; break; } } if (!$done) { $groups[] = $answer; $groupns[count($groups)-1] = array($root); } } echo "

Results

"; echo ""; foreach ($groups as $groupnum => $group) { echo ""; } echo ""; foreach ($groupns as $groupnum => $roots) { echo ""; } echo "
Nameserver list:"; foreach ($group as $authns) { echo $authns."
"; } echo "
Which roots are returning this:"; foreach ($roots as $root) { echo $root."
"; } echo "
"; } else { echo "Invalid domain name format"; } } function getservers($result) { $servers = array(); foreach ($result as $line) { if ($line[0] != ';') { $bits = split("\t+", trim($line)); if ($bits[2] == 'IN' && $bits[3] == 'NS') { $servers[] = strtolower($bits[4]); } } } sort($servers); return $servers; } ?>