Skip to content

Instantly share code, notes, and snippets.

@blHdIjbJ
blHdIjbJ / massrbl.php
Created January 28, 2012 21:24
simple mass RBL check
<?php
function rblcheck($host) { // Note: I have no idea how well suited CBL is for this purpose. If it gets annoying we can remove it ~ Aurora
$rbls = array('sbl-xbl.spamhaus.org', 'rbl.efnet.org', 'cbl.abuseat.org', 'dnsbl.dronebl.org');
foreach($rbls as $rbl) {
$lookup = implode('.', array_reverse(explode('.', $host))) . '.' . $rbl;
if (strstr(gethostbyname($lookup), "127.0.0")) {
return $rbl;
}
}
return 0;