Key takeaways
- Sign cold mail with a dedicated subdomain, choose Automatic Sender Security if your DNS host supports its CNAMEs, and use a 2048-bit key.
- If you manage keys manually, rotate on a schedule rather than only after a problem, and keep the old key published until new mail has verified against the new one.
- Mailgun's DKIM security page describes the trade-off:
For cold email, the DKIM decisions matter more than the record itself: which domain signs, which key length you publish, whether Mailgun rotates the key for you, and how you rotate it without breaking signatures on mail already in flight. This guide assumes the record is already published. For the step-by-step record publishing, see the setup guide.
Research checked: 12 November 2026
The short answer
Sign cold mail with a dedicated subdomain, choose Automatic Sender Security if your DNS host supports its CNAMEs, and use a 2048-bit key. If you manage keys manually, rotate on a schedule rather than only after a problem, and keep the old key published until new mail has verified against the new one.
Four decisions before you publish
Decision 1: Automatic Sender Security or manual keys?
Mailgun's DKIM security page describes the trade-off:
- Automatic Sender Security publishes two CNAME records that point to Mailgun's hosted public keys. Keys rotate every 120 days by default, and the minimum interval is 5 days. You do not touch DNS when keys rotate.
- Manual rotation publishes the public key as a TXT record in your DNS. You control the timing, but every rotation is your job.
For a team with several sending domains, automatic rotation removes a recurring task that is easy to forget. For a team with a DNS host that rejects the CNAME form, manual rotation is the fallback, and it needs a calendar entry.
Decision 2: Key length
Google's bulk sender requirements say sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer, and recommend 2048 bits where supported. Mailgun's documentation calls the 2048-bit option more secure but more complex to publish, because some DNS providers need it split into two strings. Use 2048 bits, and split it only where the host requires.
Decision 3: Rotation without breakage
Mailgun's guidance is to rotate at least every six months, and immediately if a key is compromised. A domain can sign with up to three DKIM keys, chosen round-robin per message. A rotation plan that follows that model:
- Add the new key to Mailgun and publish its TXT record under a new selector.
- Keep the old key published. Email providers may cache DNS, and removing a key early causes verification failures for messages still in transit.
- Send several test messages and confirm their `DKIM-Signature` uses the new selector.
- Only after that, remove the old key from Mailgun and then from DNS.
Write the dates into your outreach calendar so the removal step happens.
Decision 4: Use a cold-only domain for the key
If cold sending shares a DKIM domain with your invoices and password resets, a problem in one stream affects the other. A separate sending subdomain gives its own key and its own signature domain. Keep the `d=` value of cold mail on that subdomain and make sure the From address aligns with it, otherwise DMARC will not pass on the strength of DKIM.
A pre-send checklist
- [ ] Signing domain is the cold-sending subdomain, and `d=` matches it.
- [ ] Key is 2048 bits, or 1024 at minimum if your host cannot publish 2048.
- [ ] Selector is published and returns the key from `dig`.
- [ ] A test message shows `dkim=pass` with the expected selector.
- [ ] Rotation date written down; previous key still published until the new one is proven.
How to test before you scale
Send a small batch from three different mailboxes on the domain and check each received copy's `DKIM-Signature` and `dkim=` result. A key that passes for one mailbox and fails for another usually means a second signing process is involved, such as a mailbox provider adding its own signature. Resolve that before adding volume, because a failing signature on one stream weakens the DMARC result for all of them.