Join the forums now, and start posting to receive access to our Scripts Vault!
function check_dnsbl( $ipaddress ) { // check if the IP address is in the blacklist $ret = ORM::factory('proxywhitelist') -> where ( array( 'ipaddress' => $ipaddress) ) -> count_all(); if ( $ret > 0 ) return false; if ( isset( $_SERVER['HTTP_VIA']) and isset( $_SERVER['HTTP_X_FORWARDED_FOR']) ) if($_SERVER['HTTP_VIA'] || $_SERVER['HTTP_X_FORWARDED_FOR']) { kohana::log('info', 'Attention! Ipaddress ' . $ipaddress . ' is a proxy! ' ); return true; } $dns_black_lists = file('./text/dnsbl.txt', FILE_IGNORE_NEW_LINES); //Reverse ip $rev_ipaddress = implode(array_reverse(explode('.', $ipaddress)), '.'); $response = array(); foreach ($dns_black_lists as $dns_black_list) { kohana::log('debug', '=> checking ' . $ipaddress . ' on ' . $dns_black_list . '...' ); $response = (gethostbynamel($rev_ipaddress . '.' . $dns_black_list)); if (!empty($response)) { kohana::log('info', 'Attention! Ipaddress ' . $ipaddress . ' is dns-blacklisted! ' ); return true; exit; } } return false; }
I would tend to agree with the above post. Any good proxy server would change IP's periodically to keep systems like this from working. What is the intended us? To prevent multi's from routing through a proxy?
If I'm not mistaken, DNSBL is just a list of reported spammers. And mainly used for anti-spam email purposes.(please correct me if I'm wrong)