Max TXT Size Entry in DNS

Tristan Austin tristan.austin at authentic8.com
Wed Feb 2 23:25:58 UTC 2000


I'm writing the code on NT with Bind source version 4.9.7, is this flag for
8.2.2P5 on the server or the client. (I'm assuming server). Either way, I've
been getting larger responses back than 255.

In the header of the "answer", I've found that when the data exceeds 255, a
flag is set and two u_chars are added together to indicate the end of the
data:

eg.
flag  endData    endBlock    startdata
0     138        137            d........
1     25         255            d........

In the first instance the end of the data is at 137 from the start of the
data, the second it is at 280 (25 + 255) from the start of the data. As you
said though, this means you can either have one string of max length 500, or
more with max length 255 (and only going up to 255 from the start of the
first data). Even with this it's still not enough though.


I've stepped through the code as it's making the request and I'm pretty sure
it's going via TCP.

I'm about to upgrade to v8.2.5P5 on the server to see if that's any better.
Thanks for your help.

As a last resort we'll have to split it over a number of RRs.



> -----Original Message-----
> From: Jim Reid [mailto:jim at rfc1035.com]
> Sent: Thursday, 3 February 2000 6:10
> To: Tristan Austin
> Cc: comp-protocols-dns-bind at moderators.isc.org
> Subject: Re: Max TXT Size Entry in DNS
>
>
> >>>>> "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