Results 1 to 3 of 3

Thread: IP Blacklist Check Script

  1. #1
    Senior Member
    Join Date
    Feb 2006
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IP Blacklist Check Script

    PHP Code:
    <html>
    <head>
    <title>DNSBL Lookup Tool - IP Blacklist Check Script</title>
    </head>
    <body>
    <form action="" method="get">
    <input type="text" value="" name="ip" />
    <input type="submit" value="LOOKUP" />
    </form>
    <?php
    /***************************************************************************************
    This is a simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once.

    You are free to use the script, modify it, and/or redistribute the files as you wish.

    Homepage: http://dnsbllookup.com
    ****************************************************************************************/
    function dnsbllookup($ip){
    $dnsbl_lookup=array("dnsbl-1.uceprotect.net","dnsbl-2.uceprotect.net","dnsbl-3.uceprotect.net","dnsbl.dronebl.org","dnsbl.sorbs.net","zen.spamhaus.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;
    }else{
    echo 
    '"A" record was not found';
    }
    }
    $ip=$_GET['ip'];
    if(isset(
    $_GET['ip']) && $_GET['ip']!=null){
    if(
    filter_var($ip,FILTER_VALIDATE_IP)){
    echo 
    dnsbllookup($ip);
    }else{
    echo 
    "Please enter a valid IP";
    }
    }
    ?> 
    </body>
    </html>

  2. #2
    NLC sander k's Avatar
    Join Date
    Jan 2008
    Location
    Netherlands
    Posts
    2,567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why in earth would you want something like this?

  3. #3
    FWS Addict Seraphim's Avatar
    Join Date
    Oct 2009
    Location
    Drawing Board
    Posts
    908
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sander k View Post
    Why in earth would you want something like this?
    Could be used for spam reduction. If something like this was set up to check DroneBL, you could make it reject signups from the IPs of known bots or proxies. It would help cut down on abuse rates, but at the same time it also would hammer on your server a bit because of the extra work involved in performing the lookups.

    Incidentally though, you should not use the spamhaus list if you are applying something like this to your signup system. Some ISPs have decided to actively blacklist their own IP ranges- for instance Time Warner Cable dynamic IPs cannot send email to Yahoo because the Time Warner IPs are listed in spamhaus. Trying to use that list on your site's signup service will mean that a lot of people won't be able to sign up.
    SeraphimLabs LLC, persistent hosting for your needs.
    Come what may we'll be there for you, keeping your dreams safe and growing.
    Chat with us, you don't have to be hosted by SeraphimLabs to get general tech help.

Similar Threads

  1. Check my script?
    By Schmarvin in forum Programming Help
    Replies: 12
    Last Post: November 26th, 2009, 16:11
  2. script / program to check for ad codes
    By Squad-Host.com in forum Free hosting discussions
    Replies: 7
    Last Post: March 23rd, 2009, 20:53
  3. Check siteup time script
    By T^2 in forum Programming Help
    Replies: 8
    Last Post: September 10th, 2006, 06:47
  4. script to check uptime
    By Albert in forum Programming Help
    Replies: 3
    Last Post: June 8th, 2004, 05:16

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •