TXT entry: line length/size limitation

Joseph S D Yao jsdy at center.osis.gov
Wed Aug 3 01:21:53 UTC 2005


On Tue, Aug 02, 2005 at 04:44:26PM -0700, pbeckhelm at gmail.com wrote:
> Greetings,
> 
> I'm trying to find the most recent information on zone file line length
> limitations for BIND 9.  I recently tried to add a TXT entry (for SPF)
> and when I restarted named I got the following error in my debug log:
> 
> dns_rdata_fromtext: databases/db.foo.com:61: ran out of space
> zone foo.com/IN/external-in: loading master file databases/db.foo.com:
> ran out of space
> 
> So, I found that there's a 255 character limitation for a TXT record:
...
> However, I'm having some trouble figuring out the syntax of splitting
> the TXT record into multiple <255 char lines.
> 
> I've been googling like crazy and can't seem to find anything thus far.

Try the syntax in "DNS and BIND" 4e, p. 154, "General Text Information".

label	IN  TXT	"first string" "second string" "third string"

This section also notes that strings must be < 256 chars, and that there
is an overall 2Kb limit.

BUT - why do you need a line >= 256 chars?

Ah - note that the SPF draft RFC
<http://www.ietf.org/internet-drafts/draft-schlitt-spf-classic-02.txt>
says the same thing:

"3.1.3.  Multiple Strings in a Single DNS record

   As defined in [RFC1035] sections 3.3.14 and 3.3, a single text DNS
   record (either TXT and SPF RR types) can be composed of more than one
   string.  If a published record contains multiple strings, then the
   record MUST be treated as if those strings are concatenated together
   without adding spaces.  For example:

      IN TXT "v=spf1 .... first" "second string..."

   MUST be treated as equivalent to

      IN TXT "v=spf1 .... firstsecond string..."

   SPF or TXT records containing multiple strings are useful in order to
   construct records which would exceed the 255 byte maximum length of a
   string within a single TXT or SPF RR record.

3.1.4.  Record Size

   The published SPF record for a given domain name SHOULD remain small
   enough that the results of a query for it will fit within 512 octets.
   ..."

-- 
Joe Yao
-----------------------------------------------------------------------
   This message is not an official statement of OSIS Center policies.



More information about the bind-users mailing list