
Distributing files via DNS - fcambus
http://www.cambus.net/distributing-files-via-dns
======
david-given
Way back when I saw a system for streaming audio via DNS: by using TXT records
with a TTL of a few seconds, and updating them in a ring buffer, and by
stuffing each record with a fragment of Speex encoded audio, you could get
quite viable 2kbps audio streaming. Plus, you ended up with totally automatic
and really effective edge-of-network caching.

This could have been Dan Kaminsky's DNS Radio idea, which he mentions here:
[http://dankaminsky.com/2004/08/01/50/](http://dankaminsky.com/2004/08/01/50/)

However, I haven't seen any actual code.

------
bluejekyll
There are some issues that seem difficult to overcome with DNS. DNS is
essentially a distributed cache where all records are cached throughout the
DNS graph of nodes which the client is using to communicate. One problem that
seems to present itself, is how do you update a file with any certainty
without reducing the TTL to near zero? Which makes the overall DNS cache
performance drop significantly?

There are also the problems of the Resource Record lengths, all DNS packets
should be less that 512 bytes. I'm a huge fan of using DNS for exchanging
small public data, e.g. public keys, but for large files there are much better
options out there.

~~~
jedisct1
Packets can be larger. That's the whole point of the EDNS0 mechanism. Most
public resolvers support 4k packets:
[http://mincore.c9x.org/PubDNS/](http://mincore.c9x.org/PubDNS/)

------
gwu78
There's nothing to stop anyone from creating new RR types in djbdns and put
anything in them they want.

I edited dnstxt.c many years ago to print new lines, etc. so I could store,
retrieve and cache small, _formatted_ ASCII files from a "zone file" as "TXT
records" via DNS. They print nicely on the terminal.

And, with dnscurve, you now also have a fast way to encrypt each DNS packet
("small, formatted ASCII file" or whatever you desire) individually in
transit.

DNS is just a database that happens to be used for a small set of purposes.
It's fast. And almost everyone connected to the internet uses it.

------
jamiesonbecker
Cool hack. There are probably more efficient ways of handling entire files,
but for small, public/cacheable lookups, DNS works great. I used to look up
base64'd usernames to userid's via TXT RR's. The only downside is potential
discoverability (even without axfr), but you could always run it privately.

DNS is awesome. Distributed caching, sharding via zones, and UDP protocol with
automatic upgrade to TCP for larger records, all at no additional cost.

------
tracker1
I remember seeing someone use DNS as a hack for SSH so it could be used
without signing into open wifi hotspots (when DNS worked, but HTTP/S was
intercepted) ...

------
jjuhl
Neat hack.

------
kjs3
I do traffic analysis of DNS traffic to spot things like this. IM/IRC, file
transfers, rouge-like games, malware C&C...pretty neat stuff all of it, just
don't think it all goes unnoticed.

