Max TXT Size Entry in DNS

Jim Reid jim at rfc1035.com
Wed Feb 2 19:10:11 UTC 2000


>>>>> "Tristan" == Tristan Austin <tristan.austin at authentic8.com> writes:

    Tristan> Is there a maximum size a TXT entry can be in DNS (using
    Tristan> bind). I'm attempting to read back a large piece of
    Tristan> information and it's begin truncated.

    Tristan> If there is a maximum size, is it configurable?

The maxiumum length of a string in a  TXT record appears to be 255
characters. From db_defs.h:

        /* max length of data in a TXT RR segment */
	#define MAXCHARSTRING 255

However there's an #ifdef in db_load.c (ALLOW_LONG_TXT_RDATA) which is
switched on in 8.2.2P5. This allows for TXT records of up to MAXDATA -
approx. 2Kbytes - to be loaded, though these have to be composed of
several strings, none of which is more than 255 characters long.

If TXT records are that big, the DNS answers will be truncated because
the default payload in a UDP datagram is 512 bytes. [EDNS allows for
bigger payloads in UDP replies.] When a resolver gets a truncated
response like this, it should make a TCP connection to the name server
and repeat the query to get the full response. Maybe something's not
handling truncated responses from the name server?

BTW if one of your TXT records is too big, you should see complaints
like "total RDATA too long" or "RDATA field too long" in the name
server logs.



More information about the bind-users mailing list