Sunday, April 12, 2009

DNS for dynamic geo-location

Using DNS as a covert channel to do lookups against non-existant A records, which are in fact your latitude and longitude coordinates!

E.g. my device registers via dynamic DNS to a domain (mine or someones service) and enters its hostname, then subsequently does a lookup against my location+device+[sub]domain. DNS server intelligently sees query and does some stuff below:

So my device asks about a non-existant A record in my subdomain or hosted domain which now happens to contain my coords; such that the DNS server is originally told by my device where I am. The DNS server updates itself to contain a record that now reflects what I asked. Others can now query my location through a DNS resource record. Quick, single packet UDP geo-location.

Now other entities on the internet can a) ask for the IP for my host's A record b) ask for the PTR for my device in that or other subdomain, and the response points to the new 'geo' location data A record.

My latitude and longitude
-037.881721,144.978032

My device called 'bob-001' with IP address 123.123.123.123

My device uses 'dynamic DNS' and registers in a domain with:
bob-001.assets.nodecity.com 123.123.123.123

My DNS server creates the A record and also a sub-domain(no PTR record yet!):
bob-001.assets.nodecity.com 123.123.123.123
.bob-001.geo.assets.nodecity.com


My device asks about the A record:
037881721144978032.bob-001.geo.assets.nodecity.com

My DNS server now knows where I am and also inserts a PTR record for
123.123.123.123.IN.ADDR.PTR. 037881721144978032.bob-001.geo.assets.nodecity.com

Hmmmm.. can also use TXT records and/or oher DNSSEC stuff. PTR idea may not work against RFC1918 address space or devices behind NAT. Maybe just use AXFR for subdomain which could also contain the last X locations for the device....

No comments: