Blog Posts per Tag

Assign IPs to geographical location

Assign IPs to geographical Location is quite interessting: if you know where visitors come from. you can redirect them to the web shop of their country, you can keep some countries away of your SSH daemon or showing special offers or events of this country. Of course this is not bullet proof. If your visitors using proxies located in a different country, anonymizer like TOR or accessing the internet by VPN so GeoIP won’t work as expected.

Read More →

Use DNS Blacklists in PHP

The following snippet is a quick and simple way to use dnsbl in PHP code (or for CLI use), if an IP is listed the code will return 1: <?php /* * Simple DNSBL check * Author: René Moser */ // Check this IP $ip = ''; // List of DNSBL DNS Servers $dns_black_lists = file('./dnsbl.txt', FILE_IGNORE_NEW_LINES); // Reverse the IP $rev_ip = implode(array_reverse(explode('.', $ip)), '.'); $response = array(); foreach ($dns_black_lists as $dns_black_list) { $response = (gethostbynamel($rev_ip .

Read More →