[Pdns-users] PowerDNS returns a malformed response when queried for a TXT record larger than 257 characters.
julian at mehnle.net
Thu Mar 25 01:14:57 UTC 2010
Augie Schwer wrote:
> PowerDNS returns a malformed response when queried for a TXT record
> larger than 257 characters.
> PowerDNS returns NOERROR and returns as much data as it can which ends
> up creating the corrupt packet.
> Admittedly one shouldn't put bad data in (the above record is not RFC
> compliant); I was hoping PowerDNS would handle the response better --
> any of the response codes could fit and certainly not return a
> malformed packet; I'd rather see an empty packet or maybe a truncated
> RDATA and a NOERROR return code.
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
"v=spf1 ip4:18.104.22.168 a mx mx:gordonmedical.com,
mx:e.mx.sonic.net mx:a.mx.sonic.net, mx:c.mx.sonic.net,
mx:d.mx.sonic.net, mx:h.mx.sonic.net, mx:f.mx.sonic.net, mx:and "
leaving a space between strings like so: "string1" "string2". The SPF
spec states that multiple strings will be concatenated seamlessly, so
you'd probably have to include another space *in* the strings, either at
the end of "string1 " or at the start of " string2".
Note that this is different from splitting the record into several
*records* (opposed to several strings in a single record). This doesn't
work with SPF since ordering among records is undefined by DNS and SPF
wouldn't know how to concatenate them correctly.
Of course you could just remove the erroneous commas and fix up the SPF
record to get below the 256 characters limit in this particular case.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: This is a digitally signed message part.
More information about the Pdns-users