Storing Geopresence in DNS

A little geopresence procrastinating tonight: using RFC 1876 as a guideline, I wired up my Plazes geolocation to a dynamic update of a DNS LOC resource record. This means that finding out where I am is, from the Unix command line, as simple as:

# dig +short LOC
46 14 9.103 N 63 7 26.951 W 0.00m 10m 10m 50m

It took a little while to figure out the proper way to represent the LOC record in my zone file. It turns out it’s really quite simple, and exactly as described in the RFC; my issue was that I had set up as a CNAME instead of an A record, and this caused issues. Changing it to an A record solved my problem.

I’m using a simple call to the Plazes API to grab my current location, and then using nsupdate (which is lovingly documented here) to do the dynamic update of my DNS server, feeding it a file that looks something like this:

server localhost
update delete LOC
update add 1800 LOC 46 14 9.103 N 63 7 26.951 W 0m 10m 10m 50m

I’ve been thinking about a vendor-independent decentralized way of storing geopresence information for a long time; while using DNS might be too infrastructure-dependent to be a useful solution for everyone, it seems, at least on the surface, to be quite a dreamy way of achieving this.


oliver's picture
oliver on February 10, 2009 - 23:44

I have a source who tells me this is really cool. Way to go, Peter!

Add new comment