[net-dns-users] Bug with large txt RR ?

Felipe Gasper felipe at felipegasper.com
Wed Oct 7 20:54:07 UTC 2026



> On Oct 7, 2026, at 2:08 PM, Håkon Alstadheim <hakon at alstadheim.priv.no> wrote:
> 
> 
> Den 07.10.2026 19:32, skrev Felipe Gasper:
>>> On Oct 7, 2026, at 12:17 PM, Håkon Alstadheim via net-dns-users <net-dns-users at lists.nlnetlabs.nl> wrote:
>>> 
>>> 
>>> Den 07.10.2026 18:07, skrev Håkon Alstadheim:
>>>> Den 07.10.2026 01:38, skrev Doug Barton via net-dns-users:
>>>>> But that's not what you said. Now you're taking dig's output, then post-processing by hand. If that's your standard, then apply it to the Net::DNS output as well.
>>>>> 
>>>> Sorry I'm having such a hard time getting this across, my presentation was probably confusing because I've tried many of the various ways to get at the txt contents.
>>>> 
>>> Looks like I mixed my examples again. First example, with quotes on *some* for the chunks and others naked, is from using rdstring, txtdata gives just extra spaces.
>> Every TXT record is a *list* of strings, each capped at 255 bytes.
>> 
> I know this.
>> Any application that models TXT record as a single string must define logic for splitting & joining across the TXT record’s individual pieces.
>> DKIM, for example, (IIRC) simply joins the segments end-to-end.
>> 
>> Scalar-context Net::DNS::RR::TXT::txtdata(), on the other hand, joins the segments with a space.
> 
> Fine, so I should work with rdstring, which *should* return the segments in "quotes", except that *one* segment gets printed unquoted! So programmatically glueing it together becomes rather random.
> 
> "v=spf1 [...totally fine string...]ip4"   ":160 [...totally fine string...]include:478860"    1.spf03.hu "bspotemai[...totally fine string...]p.com -all"
> 
> What is 1.spf03.hu doing unquoted?

Going by the documentation, rdstring() is defined (on the base class, not on ::TXT) as just “a string representation of the RR-specific data”. It doesn’t seem to define a quoting mechanism, or even guarantee that the returned string is round-trippable.

Are you able to do the quoting yourself? That might solve the issue.

Alternatively, LDNS might be closer to what you want.

-FG


More information about the net-dns-users mailing list