This is a simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once.

















<html>
<head>
<title>DNSBL Lookup Tool - IP Blacklist Check Script</title>
</head>
<body>
<form action="" method="POST">
<input type="text" value="" name="ip" />
<input type="submit" value="LOOKUP" />
</form>
<?php

if (isset($_POST['ip']) && $_POST['ip'] != null)
{

  $ip = $_POST['ip'];
    if (filter_var($ip, FILTER_VALIDATE_IP))
    {
        echo dnsbllookup($ip);
    } else
    {
        echo "<h2>Please enter a valid IP</h2>";
    }
}

function dnsbllookup($ip){
$listed;
$dnsbl_lookup=array("dnsbl-1.uceprotect.net","dnsbl-2.uceprotect.net","dnsbl-3.uceprotect.net","dnsbl.dronebl.org","dnsbl.sorbs.net","zen.spamhaus.org","cbl.abuseat.org","access.redhawk.org","b.barracudacentral.org"," bl.spamcop.net","blackholes.wirehub.net","block.dnsbl.sorbs.net","bogons.cymru.com","cbl.abuseat.org","dev.null.dk","dialups.mail-abuse.org","dnsbl.abuse.ch","dnsbl.tornevall.org"); // Add your preferred list of DNSBL's
if($ip){
$reverse_ip=implode(".",array_reverse(explode(".",$ip)));
foreach($dnsbl_lookup as $host){
if(checkdnsrr($reverse_ip.".".$host.".","A")){

$listed[]=$reverse_ip.'.'.$host.' <font color="red">Listed</font><br />';
}
}
}
if($listed){
echo $listed[1];
}
else{
echo '"A" record was not found';
}
}

Comments