Andreas Plesner Jacobsen maintains an IPv4 DNS block-list called countries.nerd.dk. Being a DNS BL it is accessible via the DNS, but you can also obtain a copy of his files via the rsync protocol from

rsync://countries-ns.mdc.dk/zone

(Files are either in a format suitable for hosting by Michael Tokarev's rbldnsd or by a BIND-compatible name server.)

The countries.nerd.dk zone contains two-letter ISO 3166 country-code subdomains you can use to determine whether an IP is from that particular country. So, for example, if you wish to filter on IP addresses from China, you would invert the IPv4 address you're looking up, add the cn.countries.nerd.dk domain and perform an address (A) query for that. A successful lookup means the IP is Chinese. If you are curious as to which country any IP address is from, you might as well query the zz.countries.nerd.dk zone which returns either a country code encoded into the IPv4 address of the A record returned, or alternatively, a TXT resource record with the lowercased ISO 3166 country-code in it.

What you do with this data is left to your imagination; you could block e-mail from particular countries, or you could use the country code on a Web page to welcome a user in her language. In any case, use of the DNSBL is solely your responsability: there is no need to complain to Andreas, because he clearly states that countries.nerd.dk is NOT a list of spammers, it is an IP-to- country DNS mapping service.

Where are't thou from?

This is the result of your current IP address:

Credits

The countries.nerd.dk zone is maintained by Andreas Plesner Jacobsen, and the flags are are copyrighted by the author, Philippe Verdy.

Comments

blog comments powered by Disqus