Images over DNS

Images over DNS What’s the limit of what can be in a TXT record? Some places say 255 bytes. They are wrong. Within a TXT record there are multiple character-strings (RFC 1035 section 3.3.14) and those are limited in length (because a single byte is used for their length), however there can be many of them. The actual limit is limited by the size of the DNS payload, which for UDP is these days around 1232 bytes. That is obviously quite low. However if we use TCP, which doesn’t require anything special, other than the normal fallback to TCP that DNS does, then we can serve up to 64KB. I set out to demonstrate exactly that, by using Google Public DNS’s JSON API and then serving large TXT responses over TCP, from a custom server. This mostly just works, the main issue is not with the…

Read more on Hacker News