note 61220 added to function.checkdnsrr
| From: | satmd at osu1 dot php dot net | Date: | Sat, 28 Jan 2006 16:29:35 +0000 |
| Subject: | note 61220 added to function.checkdnsrr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-102622@lists.php.net to get a copy of this message | ||
fox dot 69 at gmx dot net: I wonder where you got this code from. I have written this piece of code
half a year ago and released it WITH a copyright header that is missing now! Anyways... this code is
to be considered licenced "as-is", however it'd be nice to keep the authors note
(This is something about reputation, you see?). Thanks.
(Much) more recent version of it:
<?php
function is_blacklisted($ip) {
// written by satmd, do what you want with it, but keep the author please
$result=Array();
$dnsbl_check=array("bl.spamcop.net",
"list.dsbl.org",
"sbl.spamhaus.org");
if ($ip) {
$quads=explode(".",$ip);
$rip=$quads[3].".".$quads[2].".".$quads[1].".".$quads[0];
for ($i=0; $i<count($dnsbl_check); $i++) {
if (checkdnsrr($rip.".".$dnsbl_check[$i].".","A")) {
$result[]=Array($dnsbl_check[$i],$rip.".".$dnsbl_check[$i]);
}
}
return $result;
}
}
?>
Beware that this code's signature differs from the original! I also removed osirusoft as its
results are not useful anyways (false positives!). Please make sure that you have nscd or a caching
dns server running as this code is prone to (d)dos! Only use it in places where it is necessary
(when data is to be modified), e.g. the script processing uploads/posts/replies in a blog.
----
Server IP: 64.246.30.37
Probable Submitter: 84.165.243.25
----
Manual Page -- http://www.php.net/manual/en/function.checkdnsrr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61220
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61220&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61220&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61220&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61220&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61220&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61220&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61220&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61220&report=yes
Search -- http://master.php.net/manage/user-notes.php