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?
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.
[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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.