Get your Multilple Domain Namesevers Using PHP
In certain cases,we have to identify the domain nameservers where we have hosted.Users may submit various sites and we might confirm their name servers for proper coding.If name server is already know,better option is directly comparing with the result
$domaincheck = checkdnsrr($HTTP_POST_VARS[domain],"ns");
But in most of the cases,dns_get_recordbecomes more useful.
<?php
$result = dns_get_record("TECHTIPSMASTER.COM", DNS_ANY, $authns, $addtl);
$count = sizeof($result);
$i=0;
$nameserver = array();
while($i < $count) {
$temp_array = $result[$i];
if($temp_array['type'] == "NS") { array_push($nameserver, $temp_array ['target']); }
$i++;
}
$count = sizeof($nameserver);
$i=0;
while($i < $count) {
//This is just to show the contents of the nameserver array.
print "nameserver[$i]: $nameserver[$i]<br>";
$i++;
}
?>
this code puts the multiple name severs into array and then compares it with your NS.





