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 peter.rukavina.net 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 rukavina.net zone file. It turns out it’s really quite simple, and exactly as described in the RFC; my issue was that I had peter.rukavina.net 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 zone rukavina.net update delete peter.rukavina.net. LOC update add peter.rukavina.net. 1800 LOC 46 14 9.103 N 63 7 26.951 W 0m 10m 10m 50m show send
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.