I get a "TXTRDATATooLong" error when attempting to add a TXT record to my domain. How can I resolve this?
This error indicates that your TXT records are longer than 255 bytes, which is the maximum length for a TXT record. Either shorten the string in your TXT record, split long strings into multiple values, or split a long TXT record into multiple parts, separated by double quotes.
Splitting your TXT record into multiple parts separated by quotes will display as a single-line TXT record that’s longer than 255 bytes.
You can add multiple strings for TXT records, and each string can be up to 255 bytes long.
To create a text record with multiple values, enclose each string in quotes and separate them with a line break:
"string1"
"string2"
This syntax results in two separate TXT records, which are displayed similarly to the following in a DNS lookup:
example.com. 300 IN TXT "string2"
example.com. 300 IN TXT "string1"
If you need a single string that is longer than 255 bytes (for example, if you’re setting up DKIM for use with SES), use the following syntax:
"string1""string2"
Note that there is no space between the double quotes. This syntax results in one TXT record, which is displayed similarly to the following in a DNS lookup:
example.com. 300 IN TXT "string1" "string2"
Note: Although the second method can cause long strings to be broken up by quotes and a space, RFC 4408 3.1.3 mandates that the string must be treated as equivalent to the two strings concatenated without quotes.
TXT, string, error
Did this page help you? Yes | No
Back to the AWS Support Knowledge Center
Need help? Visit the AWS Support Center
Published: 2016-08-05