Importing TXT records adds quotes, breaking records

An example record I have:
cm._domainkey IN TXT k=rsa;p=XXX ; Campaign Monitor

If I import this through Cloudflare, it added quotes around the value which breaks/invalidates the record value.

This has been reported in several other threads over the years with no fix. Are there any plan to fix this?

TXT Record with quotes - Website, Application, Performance / DNS & Network - Cloudflare Community
Export and Import of TXT records not handling quotes in the same way - Website, Application, Performance / DNS & Network - Cloudflare Community
Cloudflare reformats DKIM which then won’t authenticate - Website, Application, Performance / DNS & Network - Cloudflare Community

Quotes around the content of TXT records are correct, though they shouldn’t be shown in the dashboard.

Can you share the full record name?

Hi! TXT record contents always consist of a set of “strings”, each with a length of up to 255 bytes. Strings are typically represented as quoted sections, for example:

"the first string" "second" "another, third string"

While it wasn’t in the past, our behavior regarding zone file imports should now be correct and RFC-compliant, adding explicit quotes to imported TXT records. These explicit quotes are currently shown in both API and dashboard.

For simplicity and historical reasons, contents without explicit surrounding quotes are treated as a single string, only being split up if the 255-byte limit is exceeded. For example, one two three is treated as "one two three", even though, strictly speaking, the RFC-compliant interpretation would be "one" "two" "three". In the future, we may disallow unquoted TXT contents as we move to be fully RFC-compliant. For that reason, explicit quotes around strings in TXT record contents are expected and in fact strongly encouraged. These quotes should not cause any issues and in fact records with contents hello and "hello" will be exactly, byte-for-byte identical at the edge.

3 Likes

Thanks Janik & Laudian. I will update our internally maintained zone file to have the quotes so we’re following strict RFC guidance.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.