Why does Route 53 reject my DKIM key with "CharacterStringTooLong"?


Route 53 is enforcing the DNS TXT record specification, not being difficult. A single TXT string has a maximum length of 255 characters (per RFC 7208), and a standard 2048-bit DKIM key is around 400 to 500 characters. It simply does not fit in one piece.

The fix is to split the value into multiple quoted strings, each under 255 characters, separated by spaces on the same line. DNS resolvers automatically concatenate them back into the full key when validating.

"v=DKIM1; k=rsa; p=FIRST_255_CHARS" "NEXT_255_CHARS" "REMAINING_CHARS"

One common mistake: do not put each quoted chunk on a separate line. Route 53 interprets separate lines as separate TXT records, not segments of one record. That breaks DKIM validation entirely.

For a full step-by-step walkthrough (console and CLI): Your DKIM Key Is Too Long for Route 53 (And How to Fix It)