bind9 has a limit on the number of characters in a single line TXT record. I was unable to provision the DKIM TXT record using propellor due to this limit.
I added a new MTXT record type to Propellor.Types.DNS.Record
(patch).
MTXT creates a multiline TXT record. It splits the record's text (say
"long string...\n...xyz") at '\n'
and creates a TXT record of the
form:
domain IN TXT ( "long string..."
"...xyz" )
I'm currently using this recipe to provision the DKIM TXT record.
I want to know if there is a better way to do this without having to add the MTXT record type?
It seems that the limit is 255 characters, and this limit applies to any string in a bind zone file, rather than being a maximim line length. A single line can contain multiple such strings, although there's probably a maximum line length somewhere too, so using parens to extend across multiple lines is wise.
The values inside the parens are concacenated together, no newline is added to the string that bind builds up from them AFAICS.
So it seems your code is stripping out the newlines from the TXT value. Which probably doesn't matter for DKIM public key material, and I don't think that bind zone files support multiline strings anyway. But a single line could be too long and splitting on newlines would not help then.
So, I think the thing to do would be to make
rValue
break TXT strings into substrings no longer than 255 characters. Then you don't need a new constructor, and long SSHFP etc records could also be handled that way.joeyh, Thanks for the feedback.
I updated the definition of
TXT
'srValue
according to your suggestion and removed theMTXT
record -- patch.I would like to get the patch merged into upstream, let me know if I've to refactor it.