Jump to content

how do i Check IPs against DNS Blackhole Lists?


darkcarnival

Recommended Posts

If I'm understanding your question correctly, here is my initial thoughts on the matter: set up a table that simply holds blacklisted IP addresses. Then, when someone logs in, run a simple, quick query to check them against the blacklist before you let them in:
[code]
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$sql = mysql_query("SELECT * FROM blacklist WHERE ip = '$ip'");
if (mysql_num_rows($sql) > 0) {
  // blacklisted IP, don't let them in
} else {
  // valid, let them in
}
?>
[/code]

Is this the idea of what you're after?
Link to comment
Share on other sites

no but thanks for the try.

on phpbb3 is a way to cehck ips from databases from spamcop

heres the entrie quote from phpbb's cp:

[quote]Check IP against DNS Blackhole List:
If enabled the IP is checked against the following DNSBL services on registration and posting: spamcop.net, dsbl.org and spamhaus.org. This lookup may take a bit, depending on the servers configuration. If slowdowns are experienced or too much false positives reported it is recommended to disable this check.[/quote]

now i wish to do the same but since phpbb has an odd way of coding, i dont understand how do it.
Link to comment
Share on other sites

[quote author=darkcarnival link=topic=116746.msg475911#msg475911 date=1164836573]
no but thanks for the try.
...
now i wish to do the same but since phpbb has an odd way of coding, i dont understand how do it.
[/quote]

I see what you're after. Well, each one of the Black Lists provided has their own way of checking. You need to actually do a little digging on those sites you wish to use and access their information directly. For instance, I spent about 3 minutes browsing the SpamCop site, and I came up with [url=http://www.spamcop.net/fom-serve/cache/351.html]this page[/url] that describes how you can check an IP address against their black list. It's a very similar function to use DSBL according to [url=http://dsbl.org/usage]this page of their site[/url], too. Using these tools they provided, you can configure your server to run those tests for you, and you should be set to go.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.