All pastes #461848 Raw Edit

Stuff

public text v1 · immutable
#461848 ·published 2007-04-27 22:12 UTC
rendered paste body
function checkNS($domain)
{
	global $nsnames;
	$nscount = count($nsnames);

	exec("nslookup -query=ns $domain", $dns);

	$temp = implode(" ", $dns);
	$count = substr_count($temp[0], "nameserver =");

	echo $temp.'<br><br>';
	for ($x = 0; $x < $count;$x++)
	{
		$temp = substr($temp, strpos($temp, 'nameserver =') +12);
		$ns[$x] = substr($temp, 1, strpos($temp, '. ') -1);
		echo 'Nameserver '.$x.' is: '.$ns[$x].'<br>';
	}

	// REMOVE LINE AFTER SITE GOES LIVE
	// return true;

	for ($y = 0; $y < $count; $y++)
	{
		$good =0;
		for ($z = 0; $z < $nscount; $z++)
		{
			if ($ns[$y] == $nsnames[$z])
			{
				$good =1;
			}
		}
		if (!$good)
		{
			return false;
		}
	}

	return true;
}