3 ms·
You are right that it is wise to keep DNS response sizes less than 1280 bytes if you want to fit in UDP. But the DNS can support responses of up to 65535 bytes
by fanf2 6y ago
You are right that it is wise to keep DNS response sizes less than 1280 bytes if you want to fit in UDP. But the DNS can support responses of up to 65535 bytes over TCP, which servers are required to support. https://tools.ietf.org/html/rfc7766 https://tools.ietf.org/html/rfc7766
- reificator 6y ago> * But the DNS can support responses of up to 65535 bytes over TCP, which servers are required to support* Requirements are only as effective as their enforcement...
- elliottinvent 6y agoInterestingly, Google Cloud DNS has a fixed limit of 1012 characters per resource record (counting the quote marks that separate fixed length 255 char TXT strings). They claim you can have 10,000 resource records in a resource record set, so over 10mb of data.
- fanf2 6y agoGolly! Well, the minimum practical RR size is 2 bytes for the name (a compression pointer), 2x2 bytes for class and type, 4 bytes for TTL, 2 bytes for length, and some data, e.g. 4 bytes for an A record: total, 16 bytes. So you can't fit more than about 4k records in a DNS response. It is actually possible to have a zone with an RRset much bigger than that, and it will transfer successfully with AXFR or IXFR, and you can make the RRset bigger or smaller with UPDATE - but you won't be able to query for it... unless the server has some nonstandard shenanigans for returning partial data, as many of them do.