| px | top | add code | search | signup | login | help |
<?php
/********************
Windows checkdnsrr 1.0
By Hamish Milne
int checkdnsrr ( string $host [, string $type ] )
$type can be: A, ANY, CNAME, MX, NS, PTR, SOA, SRV, etc. default is MX
A checkdnsrr function compatible with Windows.
Exactly the same as the linux version
See the PHP documentation for further info:
http://www.php.net/checkdnsrr
Requires:
nslookup - ie. Windows - with access to 4.2.2.3
PHP >= 4.0.3
shell_exec() enabled - ie. safe mode disabled
********************/
function checkdnsrr($host, $type='mx'){
$res=explode("\n",strstr(shell_exec('nslookup -type='.$type.' '.escapeshellarg($host).' 4.2.2.3'),"\n\n"));
if($res[2]){
return TRUE;
}else{
return FALSE;
}
}
function dns_check_record($host, $type='mx'){
return checkdnsrr($host, $type);
}
?>
Comments or questions?
PX is running PHP 5.2.11
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.