The Wayback Machine - https://web.archive.org/web/20090125023649/http://www.netop.org:80/services/ip-geolocation

The NetOp Organization

IP geolocation

Introduction

Existing approaches to IP geolocation chose to invent their own non-standard APIs. We feel that is not necessary. DNS is a highly efficient way to export IP-to-<something> datasets. A de facto standard for such dataset lookups already exists. Serving data via DNS, rather than a flat file, guarantees that answers to queries remain fresh.

With the country.netop.org service, NetOp demonstrates here that no special APIs are needed. All you need is a standard DNS resolver API.

Using the service

NetOp runs a service that allows the public Internet to make DNSBL-style queries for a given IPv4 address's ISO 3166 country code, as stored in a TXT RR. The domain to query is country.netop.org, for example 1.0.0.127.country.netop.org.

The server will return a TXT RR containing the two-letter ISO 3166 country code. As Webnet77 data notes, there are some variances in the country code:

  • AP - non-specific Asia-Pacific location
  • CS - (Formerly Czechoslovakia) Czech Republic and Slovakia
  • YU - (Formerly Yugoslavia) Serbia, Montenegro, etc.
  • EU - non-specific European Union location
  • FX - France, Metropolitan
  • PS - Palestinian Territory, Occupied
  • UK - United Kingdom (standard says GB)
  • ZZ - IETF RESERVED address space.

You may also query the service via a simple web form.

Application developers

This service is being provisioned such that it will exist in the long term. I encourage application developers to use the country.netop.org sub-domain in their geolocation applications. Although there are no explicit traffic limits, heavy users should run good DNS cache servers of their own or mirror the data themselves.

Nigel Gourlay created IP::Country::DNSBL, a Perl module available via CPAN.

Status

Public beta. It works, but with only one server, won't survive being slashdotted, etc. See 'Future directions' below for more.

Words of caution

Returning address/prefix (CIDR), and caching the address block, is far preferable to dealing with each individual IPv4 address. Although mitigated, this issue affects scaling, and will only become more acute as IPv6 support is added. Anybody know a good way to encode (address)->(country code,netblock) in a DNS request, such that, a request for another address in the same netblock will return a cached answer? Such an improvement would reduce service queries exponentially.

Back end

We use rbldnsd to serve the geolocation data. (not to be confused with djb's daemon of a similar name) rbldnsd provides very user-friendly alternate zone formats, and makes it easy to split a dataset across multiple files. Webnet77 provides the geolocation data, and OSUOSL provides the server colocation.

Future directions

IPv6 support needs doing. We are seeking slave servers for the country.netop.org sub-domain. Must be a stable node, on a stable IP, in a datacenter with backup power. Root access to a Virtual or dedicated server running Linux strongly preferred. DNS data will be updated nightly via HTTP or similar; That hasn't been worked out yet. Visit the sponsors and donations page if you would like to donate a server.

  Sign in   Home   Sitemap   Terms   Report Abuse   Print  |  Powered by Google Sites