// how to fix
Long DKIM key in DNS: TXT records split into several strings
A 2048-bit DKIM key is too long for one DNS text string. Split it the right way, or the key is broken and every signature fails.
What it means
A DKIM record holds a public key, a long block of letters and numbers. A 2048-bit key, the recommended size today, is about 400 characters long.
DNS has a rule: a single text string in a TXT record can hold at most 255 characters. A longer value must be stored as several strings, one after the other, inside the same record. Receivers join them back together without adding anything in between.
google._domainkey TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh...first part" "...second part...IDAQAB"
Why it matters
If the key is cut, has an extra space, or is split into two separate records, the receiver gets a wrong key. Every DKIM signature then fails, and DMARC can fail with it. The email looks fine to you but scores worse everywhere.
How to check
- Send a test email from the Delivmail home page. The report shows DKIM "fail" or a key error even though your provider says DKIM is on.
- Use the Domain scanner at
/domain-scannerto look at your DNS records. - Look at the raw record:
dig TXT google._domainkey.yourdomain.com
Replacegooglewith your selector. You should see one record, possibly with several quoted parts.
How to fix it
- Copy the key again from your provider's admin page (for example the Google Admin console for Google Workspace). Copy the whole value, from
v=DKIM1to the end. - Try pasting it as one value. Many DNS providers (Cloudflare, OVH and others) accept a long value and split it for you.
- If the panel refuses it, split it yourself into parts of less than 255 characters, each in double quotes, separated by a space:
"v=DKIM1; k=rsa; p=MIIBIjANBg...(about 200 characters)" "...rest of the key"
The space between the quoted parts is ignored. Spaces inside the quotes are not. - Keep it in one record. Two separate TXT records with half a key each do not work.
- Save and wait a few minutes, then test again.
Common mistakes
- A line break or space copied in the middle of the key.
- The key cut at 255 characters by the DNS panel, with the end lost.
- Quotes inside quotes, like
""v=DKIM1..."". - The
p=part missing or empty: an empty key means "this key is revoked".
Last resort
If your DNS provider cannot store long records at all, consider moving your DNS to a better provider. Some email services also let you choose a 1024-bit key, which fits in one string, but it is weaker and should only be temporary.
Check that it is fixed
The dig command should show one record whose joined value matches your provider's key exactly. Then send a new test email from the home page: DKIM should pass for your domain.
Check that it is fixed
DNS changes can take from a few minutes to a few hours. Then send a new test email or scan your domain again.
Related guides
- No SPF record on your domainYour domain does not say which servers may send email for it. Add one TXT record and receivers can tell your real emails from fakes.
- SPF error: too many DNS lookups (permerror)SPF allows at most 10 DNS lookups. Above that, the whole record breaks and receivers treat it as invalid. Here is how to slim it down.
- Several SPF records on one domainA domain must have only one SPF record. With two or more, SPF breaks for every email. Merge them into a single line.
- SPF fails: the sending server is not authorizedYour domain has an SPF record, but the server that sent your email is not in it. Find which service sent the email and add it.
- No DKIM signature on your emailsDKIM adds a digital signature that proves an email really comes from your domain. Turn it on in your email provider and publish its key in DNS.