Images over DNS
6 hours ago
- #Networking
- #TXT Records
- #DNS
- TXT records can contain multiple character-strings, each limited in length by a single byte for their length.
- The actual limit of a TXT record is constrained by the DNS payload size: around 1232 bytes for UDP and up to 64KB for TCP.
- Google Public DNS's JSON API can serve large TXT responses over TCP, though handling binary data requires custom JSON parsing.
- Binary data in TXT records avoids encoding overhead, allowing more data to be packed in.
- Demonstration includes querying via dig and processing with Perl to unescape and combine character sequences.
- Security consideration: tunneling large payloads over DNS to browsers is a potential new vector, leveraging Google Public DNS's certificate.
- The server is a custom Go DNS server, initially written by ChatGPT but corrected manually for accuracy.
- All code is available, with AI used only for the server component; the blog post and client HTML are original work.