DNS record splitter

Short answer

How do I add a TXT record longer than 255 characters?

A TXT record longer than 255 characters must be split into several strings of at most 255 characters each, quoted one after the other in the same record. This often applies to 2048-bit DKIM keys, which are around 400 characters. Paste the value and the tool splits it in the format your DNS provider uses. The receiver joins the strings again.

Paste the name and the value.

Why split

A DNS string can be at most 255 characters. A 2048-bit DKIM key is around 400 characters and must be split. Some DNS services do it themselves, others require you to split it.

Example

A split DKIM record looks like this in BIND format: selector1._domainkey IN TXT ( "v=DKIM1; k=rsa; p=MIIBIjANBgkq..." "...the rest of the key" ). It is still one record, but with two strings.

The strings are joined without spaces. A space or line break inside the key, on the other hand, makes DKIM fail.

Common mistakes

  • Two separate TXT records instead of one record with two strings. The key then becomes invalid.
  • Extra quotes that end up inside the value, because the provider adds them itself.
  • Parts of the key missing because the field at the provider cut the text.

Questions and answers

Does the key change when split?

No. The strings are joined again without spaces when the record is read.

How do I check that the record is correct?

Look up the name with the TXT lookup or the DKIM checker after you saved. If they show the whole key and a valid key length, the record is correct.

Must SPF records also be split?

Only if they are longer than 255 characters. That is rare, and then the record is often so long that it should be cleaned up or flattened.

Why does the DNS provider not accept the long record?

Some providers have a field that only takes one string, or cut the text at 255 characters. Then paste the split version with quotes around each string. If that does not help, the provider support can add it.