Understanding DNS TXT Record Size Limits: UDP vs TCP Protocol Differences
By
dgl
Hand-rolled, kettle-boiled, baked to perfection. Worth every minute at the bakery.
Summary
This technical article explores the practical limits of DNS TXT records, explaining that while many sources incorrectly state a 255-byte limit, the actual constraint depends on the DNS protocol used. With UDP, the limit is around 1232 bytes due to DNS payload size, but using TCP allows for up to 64KB of data in TXT records. The author appears to be investigating how to leverage these extended limits for practical applications like serving images over DNS.
Key quotes
· 3 pulledWithin a TXT record there are multiple character-strings 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.
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.
You might also wanna read
DNS Resolution Failure: How a 1.1.1.1 Update Accidentally Broke CNAME Record Ordering
A technical incident analysis where a routine update to Cloudflare's 1.1.1.1 DNS resolver on January 8, 2026, accidentally altered the order
Understanding DNS LOC Records: A Rarely Used DNS Feature for Specifying Physical Locations
The article discusses DNS LOC (location) records, a little-used type of DNS record that allows specifying physical locations. It explains th
Technical Guide to .arpa Zone Delegation and ICMP Protocol Hacks
The article details the author's experience obtaining delegated control over their own ip6.arpa zone for their IPv6 range, which is typicall
BGP Lab Project Expanded to Include Full IPv6 Feed
The author extends their BGP lab project to support full IPv6 feeds, following requests from readers who previously received IPv4 BGP feeds.
Whosthere: A Go-based LAN discovery tool with interactive TUI for unprivileged network scanning
Whosthere is a Go-based Local Area Network (LAN) discovery tool with an interactive Terminal User Interface (TUI). It performs unprivileged,
Investigating Intermittent ECONNRESET Errors in Local TCP Connections (Part 1)
A technical blog post investigating mysterious ECONNRESET errors occurring between two services communicating over TCP on the same machine.
