PHP get DNS script

ogah

New member
sometime we want to know what the NS that used by the domain.
you can make your own NS lookup tool with this script
PHP:
<?php
echo 'Enter domain name (without http://) <form method="get" action=""><input type="text" name="domain" value=""/><input type="submit" value="NS Look"/></form>';
if(isset($_GET['domain'])) {
	$domain = $_GET['domain'];
	$record = dns_get_record($domain);
	echo 'NS of domain '.$domain.' is:<br/>';
	foreach($record as $ns) {
		if($ns['type'] == 'NS') { echo $ns['target'].'<br/>'; }
	}
}
?>