note 75158 added to function.checkdnsrr
| From: | developeratsyscodotch at osu1 dot php dot net | Date: | Tue, 15 May 2007 16:05:09 +0000 |
| Subject: | note 75158 added to function.checkdnsrr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126620@lists.php.net to get a copy of this message | ||
Here is a simple and fully compatible implementation of checkdnsrr() for Windows.
If you include these lines at the beginning of your code, you do not need to change anything else in
the code in order to work!
if(!function_exists('checkdnsrr'))
{
function checkdnsrr($hostName, $recType = '')
{
if(!empty($hostName)) {
if( $recType == '' ) $recType = "MX";
exec("nslookup -type=$recType $hostName", $result);
// check each line to find the one that starts with the host
// name. If it exists then the function succeeded.
foreach ($result as $line) {
if(eregi("^$hostName",$line)) {
return true;
}
}
// otherwise there was no mail handler for the domain
return false;
}
return false;
}
}
----
Server IP: 194.153.94.10
Probable Submitter: 212.74.141.29
----
Manual Page -- http://www.php.net/manual/en/function.checkdnsrr.php
Edit -- https://master.php.net/note/edit/75158
Del: integrated -- https://master.php.net/note/delete/75158/integrated
Del: useless -- https://master.php.net/note/delete/75158/useless
Del: bad code -- https://master.php.net/note/delete/75158/bad+code
Del: spam -- https://master.php.net/note/delete/75158/spam
Del: non-english -- https://master.php.net/note/delete/75158/non-english
Del: in docs -- https://master.php.net/note/delete/75158/in+docs
Del: other reasons-- https://master.php.net/note/delete/75158
Reject -- https://master.php.net/note/reject/75158
Search -- https://master.php.net/manage/user-notes.php