[Pdns-users] PowerDNS returns a malformed response when queried for a TXT record larger than 257 characters.

Julian Mehnle julian at mehnle.net
Thu Mar 25 01:20:53 UTC 2010


I wrote:

> The problem is that while a TXT record can contain multiple "strings"
> (the parts you have to enclose in double quotes in TXT records in both
> BIND and PowerDNS), each string can only be 256 bytes long at maximum
> by design -- one length octet plus 255 bytes of text (RFC 1035).  If
> you want to have a longer TXT record, you have to split it into several
> strings, like so:

Oh, and be aware that responses to DNS queries via UDP will also be UDP 
packets and, in the absence of EDNS0, will typically be limited 
(truncated) to 512 bytes.  Some resolver libs (and, by extension, SPF 
implementations) will notice the truncated (TC) bit and make another 
query via TCP to get the entire record, but some won't.  So it's best to 
keep an SPF record short enough to fit into a 512 bytes UDP packet:

  http://www.openspf.org/RFC_4408#rsize

If necessary you can have several SPF records for different DNS names, 
chained together using "include:".

-Julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20100325/73eb0ebf/attachment-0001.sig>


More information about the Pdns-users mailing list