dnsbl providing ip to country resolution

How To Use

November 11th, 2007 by admin

Georbl is simply a dnsbl that returns the two-letter country code for the given IP address as the TXT record of the DNS query. Georbl is mainly intended for use by MTA software as an easy way to find which country has been assigned a given IP address so that you can create mail handling logic based on country.

To perform a lookup manually using a tool like dig or nslookup, remember to reverse the IP address.

eg. To find the country code for IP address 83.30.191.54 you’d issue a command like:

$ dig -t txt 54.191.30.83.country.georbl.info

This should return a result like so:

; <<>> DiG 9.4.1-P1 <<>> -t txt 54.191.30.83.country.georbl.info
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30625
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;54.191.30.83.country.georbl.info. IN   TXT

;; ANSWER SECTION:
54.191.30.83.country.georbl.info. 1939 IN TXT   "PL"

;; AUTHORITY SECTION:
country.georbl.info.    226717  IN      NS      ns1.georbl.info.

;; ADDITIONAL SECTION:
ns1.georbl.info.        259200  IN      A       82.113.139.184

;; Query time: 0 msec
;; SERVER: 90.155.94.209#53(90.155.94.209)
;; WHEN: Sun Nov 11 01:59:54 2007
;; MSG SIZE  rcvd: 99

Alternatively, we can do a single-country lookup. Here we check if IP 89.16.162.33 is in the UK (GB):

$ dig 33.162.16.89.gb.country.georbl.info

The A record 127.0.0.2 indicates success - this IP is allocated to GB:

; <<>> DiG 9.4.1-P1 <<>> 33.162.16.89.gb.country.georbl.info
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1880
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;33.162.16.89.gb.country.georbl.info. IN        A

;; ANSWER SECTION:
33.162.16.89.gb.country.georbl.info. 2100 IN A  127.0.0.2

;; AUTHORITY SECTION:
country.georbl.info.    84683   IN      NS      ns1.georbl.info.

;; ADDITIONAL SECTION:
ns1.georbl.info.        259200  IN      A       82.113.139.184

;; Query time: 889 msec
;; SERVER: 90.155.94.209#53(90.155.94.209)
;; WHEN: Mon Nov 12 17:27:30 2007
;; MSG SIZE  rcvd: 103