How can I configure TXT records that are longer than 255 characters in Route 53?

2 minute read
-1

I want to configure text (TXT) records that are longer than 255 characters in Amazon Route 53.

Resolution

Note: It's a best practice to create a TXT record that contains the applicable values instead of an SPF record. The Internet Engineering Task Force (IETF) in 2014 deprecated the SPF record type. Most email providers don't support SPF records. While Route 53 provides an option to create an SPF record, your email provider might not be able to identify the SPF record. Or, you might see the error SPF validation isn't working. For more information, see RFC 7208 on the IETF website.

Creating TXT records

Key points to remember:

  • A TXT record contains one or more strings that are enclosed in double quotation marks (").
  • You can enter a value of up to 255 characters in one string in a TXT record.
  • You can add multiple strings of 255 characters in a single TXT record.
  • The maximum length of a value in a TXT record is 4,000 characters.
  • TXT record values are case-sensitive.

For values that exceed 255 characters, break the value into strings of 255 characters or less. Enclose each string in double quotation marks (") using the following syntax: Domain name TXT "String 1" "String 2" "String 3"….."String N".

For information on the values to specify in your TXT record, see Entering TXT record values.

To create a TXT record to replace an SPF record:

  1. Open the Route 53 console.
  2. Choose Hosted zones.
  3. Select the domain of the SPF record
  4. Copy the value of the SPF record, and then choose Create record.
  5. For Routing policy, choose Simple routing.
  6. Choose Next.
  7. Choose Define simple record.
  8. For Record name, specify a name.
  9. For Value/Route traffic to, choose IP address or another value depending on the record type. Then, paste the SPF record value that you copied in step 4.
  10. For Record type, choose TXT.
  11. For TTL (seconds), specify a time to live value.
  12. Choose Define simple record.

The following example shows a TXT record that has configured values for domain verification, the SPF record, and DKIM signing:

txt1.geeksbox.club. TXT 3600 "google-site-verification=rXOxyZounnZasA8Z7oaD3c14JdjS9aKSWvsR1EbUSIQ"
"v=spf1 include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com ~all"
"spf2.0/pra include:spf1.amazon.com include:spf2.amazon.com include:amazonses.com -all"
"v=DKIM1;k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDeIhtCv3vUinyhKiKtZ8efjHGGo8gE1T+o7gLrvo6yRtdz9ICe6Fz5sgz0WYFW5nCV4DmaTcS25TfgWKsLgg"
AWS OFFICIAL
AWS OFFICIALUpdated a year ago
2 Comments

Here is the solution

Paste the TXT value and find an approximate middle of the value. Put your mouse pointer and press enter on keyboard. That's it, no quotation marks whatsover, since route53 will include it for you.

Syed
replied 2 months ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
MODERATOR
replied 2 months ago