Skip to main content
Enter TitanOS

Email authentication error

DKIM 2048 bit vs 1024 bit keys: which should you use?

A DKIM key is an RSA key pair, and its length in bits sets how hard it is to forge. The two sizes small businesses meet are 1024 and 2048. Longer keys are stronger, but they produce a longer public key that has to fit in a DNS record, and some DNS hosts handle that badly.

By Kyle Deligny, Titanos, Brisbane. Last reviewed 1 December 2026. General information, not legal advice.

The standard sets a floor and leaves the rest to you. This page explains what RFC 6376 and its update RFC 8301 require, the trade-off with DNS, and a safe way to move from one size to the other.

What the standards say

RFC 6376 originally told signers to use keys of at least 1024 bits for long-lived keys, and allowed verifiers to treat shorter ones as unsafe. RFC 8301, which updated it in 2018, tightened this: signers must use RSA keys of at least 1024 bits, and verifiers must be able to validate keys from 1024 up to 4096 bits. It also says keys under 1024 bits must not be used for verification, and it retired the old rsa-sha1 signing algorithm in favour of rsa-sha256.

So 1024 bits is the minimum that complies, and 2048 is what the standard suggests when you can use it. A 512 bit key from an old setup is no longer acceptable and should be replaced now.

The trade-off with DNS

A 1024 bit public key encodes to a string a little over 200 characters, which fits inside one 255 character DNS string. A 2048 bit key encodes to roughly 400 characters, so it needs to be split into two strings inside the one TXT record. RFC 6376 allows this, and receivers join the strings, but some control panels do not split long values for you.

When the split is done wrongly, the result is a record that cannot be read, and the failure looks like a missing selector or a bad key. Our page on keys too long for a DNS TXT record covers the splitting steps in detail.

Some DNS providers also limit the size of a TXT value or of the response. If yours does, ask for support or choose a host that handles it, rather than dropping back to a shorter key.

Which size to choose

Choose 2048 when your DNS host and sending service both accept it. Most mainstream providers do. Keep 1024 only where a specific tool cannot publish or sign with a longer key, and plan to replace that tool or move the sender.

Do not change length in place on a live selector. Treat the change as a rotation: create a new key at 2048 bits under a new selector, publish it, switch signing and keep the old key for an overlap period. The steps are in our guide to rotating keys and selectors.

If a service manages the key for you through a CNAME, the size is the vendor's choice. Ask what it uses.

How to check what you have

Look up each selector's TXT record. A checker can decode the p= value and report the key size, and the Authentication-Results and DKIM-Signature headers on a real message tell you which selector was used. Record the size of every key in your selector register, so the next review begins with facts.

Check and upgrade your DKIM key length

  1. List every selector in use and the service that signs with it.
  2. Look up each public key and note its length, using a decoding checker.
  3. Replace any key shorter than 1024 bits immediately.
  4. Confirm your DNS host can publish a TXT value split into two strings.
  5. Ask each service whether it supports 2048 bit keys.
  6. Generate the new 2048 bit key under a new selector name.
  7. Publish it, then test the lookup returns the whole key.
  8. Switch signing, confirm dkim=pass and keep the old key for several days.
  9. Remove the old record and update your selector register.
  10. Re-check key lengths at each yearly review.

Questions people ask

Is a 1024 bit DKIM key still valid?

Yes. RFC 8301 sets 1024 bits as the minimum for signers, and verifiers must accept keys from 1024 to 4096 bits. A longer key is the better choice where you can use it.

Why does my 2048 bit key fail to publish?

Usually the DNS host did not split the value into strings of 255 characters or fewer, or it truncated the record. Re-enter it in two strings or ask the host for help.

Should I use 4096 bits?

The standard says verifiers must handle up to 4096, but the key is long, needs more DNS space and gives little practical gain for most mail. 2048 is the usual choice.

Does a longer key slow my mail?

Signing and checking take slightly more computing, which is not noticeable for a small business.

Where to from here

The free privacy policy audit reads your published privacy policy against the Australian Privacy Principles and tells you what is missing. Privacy Care keeps your policy and your shopper data practices current for AU$149 a month, with a 3-month minimum. Would it be okay if we showed you what the audit finds? A no is welcome.

Get the free auditSee Privacy CareBook a call

Sources

  1. RFC 8301, Cryptographic Algorithm and Key Usage Update to DKIM
  2. RFC 6376, DomainKeys Identified Mail (DKIM) Signatures, section 3.3.3 and 3.6.2
  3. ASD, how to combat fake emails
Book a free call