而不是仅仅使用验证码和垃圾邮件评论检查器来对抗垃圾邮件 - 根据 DNSBL 检查每个请求并在用户使用错误 IP 时阻止用户是否是个好主意?
$blacklists = array('web.sorbs.net', 'opm.tornevall.org');
$parts = explode('.', $_SERVER['REMOTE_ADDR']);
$ip = implode('.', array_reverse($parts)) . '.';
foreach($blacklists as $bl)
{
$check = $ip . $bl;
if ($check != gethostbyname($check))
{
error_log('PHP Security: [DNSBL] - ' . $_SERVER['REMOTE_ADDR'] . ' - ' . $bl);
die('Put a detailed error here so the client knows why they have been blocked');
}
}
似乎唯一的问题是 DNSBL 对优秀用户的过度热心 IP 阻止或对每个请求进行 DNS 查找的巨大成本。