4 Nov 2026 · 7 min read · EN

Rotate DKIM keys without email downtime (cPanel runbook)

A concise runbook to rotate DKIM keys without interrupting mail. Includes cPanel DNS steps, DMARC reporting setup, and SPF checks to monitor results.

By Tim Gocelerus

Rotate DKIM keys without email downtime (cPanel runbook)

Problem

Rotating DKIM keys risks breaking signatures for messages in flight or queued mail; if signatures disappear or start failing, receivers may mark or reject mail. This runbook shows a safe, practical process for cPanel-hosted domains that avoids downtime and gives you monitoring to detect problems.

Overview and prerequisites

  • Goal: publish a new DKIM key and retire the old one without causing deliverability problems.
  • Key idea: use an overlap (dual-selector) period — publish the new public key while keeping the old public key in DNS until you are confident no valid-signed messages rely on it.
  • You will also enable DMARC aggregate reporting (rua) so you get daily reports that show DKIM/SPF alignment results, and optionally enable forensic (ruf) reporting while debugging.
  • For cPanel-managed hosting you will use Email → Email Accounts to create any report mailboxes and Domains → Zone Editor (or DNS Zone Editor) to add TXT records. If your cPanel skin hides DNS controls, ask your host.

Quick checklist (what to prepare)

  1. Inventory current selectors and signing behavior (which selector(s) are published, which selector your mail server uses to sign).
  2. Generate a new DKIM key pair (keep private key secure).
  3. Publish the new selector's public key in DNS.
  4. Configure your mail server to sign with the new selector (or ask host/support to enable it).
  5. Run an overlap period (both public keys remain in DNS while you send signed mail with the new selector).
  6. Monitor DMARC rua reports and message headers for successful DKIM verification.
  7. Remove the old selector after you confirm no signed mail relies on it.

Runbook: step-by-step

  1. Inventory current state

    • Check which selector TXT records exist in DNS (look for TXT records at selector._domainkey.example.com). Use your cPanel Zone Editor or an external DNS tool. Record the selector names and TTLs.
  2. Create or confirm a dedicated mailbox for DMARC aggregate reports

    • In cPanel: Email → Email Accounts → Create a mailbox such as [email protected]. Use a dedicated mailbox so you don’t fill a general inbox with attachments.
  3. Publish a DMARC record that sends aggregate reports (if you don’t already)

    • In cPanel: Domains → Zone Editor → Manage for the domain → Add Record → Type: TXT.

    • Example minimal monitoring DMARC record (paste all on one line):

_dmarc.example.com. IN TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
  • If you want forensic (ruf) reports while debugging, add ruf=mailto:... and consider fo=1 to request more forensics, but expect many receivers will not send ruf.
  1. Generate the new DKIM key pair

    • Generate a strong key pair on a secure machine and keep the private key where your mail server can use it. Choose a new selector name (for example: s2026b or selector2). If your host generates keys for you, request a new selector from them.
  2. Publish the new selector public key in DNS

    • Add a TXT record for the new selector under the _domainkey subdomain. Example (replace selector and key with your values):
selector2._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."
  • Use the same Zone Editor path: Domains → Zone Editor → Add Record → Type TXT.
  1. Configure your mail server to use the new selector (start signing)

    • If you manage your own MTA on the server, configure it to sign outbound mail with the new private key and selector. If your hosting provider manages signing, open a support ticket asking them to enable signing with the new selector while keeping the old selector published.

    • Important: do not remove the old selector's DNS record yet. During the overlap the server should sign with the new selector; some environments will let you sign with both selectors — if you can sign with both during the overlap, do so.

  2. Overlap and monitor

    • Keep both public keys published and run an overlap window. Sources commonly use windows from one week up to 30 days; pick a conservative overlap (for example 7–30 days) depending on how many external systems send on your behalf.

    • Use DMARC aggregate (rua) reports to watch DKIM results. Allow 24–48 hours after updating DMARC for the first reports to arrive. The RUA XMLs show counts per sending IP and DKIM/SPF/DMARC pass/fail.

    • Inspect message headers of received mail that you send to external addresses (or send test messages to Gmail/Microsoft test accounts) and confirm DKIM signatures validate and show the new selector in the DKIM-Signature header.

  3. Verify SPF and other dependencies

    • Before removing the old selector, confirm SPF is healthy. SPF evaluation has a 10-DNS-lookup limit; use an SPF checker that expands includes and counts lookups. If SPF returns a permerror at receivers, delivery can fail regardless of DKIM.

    • As part of the audit, list all services that send mail for your domain (marketing, transactional, CRM, support) and cross-check against your DMARC aggregate reports for the last 90 days before removing includes.

  4. Retire the old selector

    • After the overlap period and after DMARC reports and header checks show the new selector is in use and validating, remove the old selector TXT record from DNS using Domains → Zone Editor → Delete the TXT for oldselector._domainkey.example.com.

    • Wait a TTL period and continue monitoring DMARC reports for any new failures.

  5. Housekeeping and follow-up

  • Keep a documented rotation schedule and record the selector names and creation/retire dates.

  • If you use a third-party DMARC reporting service, remember that external reporting endpoints require a verification TXT record at reporting-domain._report._dmarc.destination-domain to allow receivers to send reports to that mailbox.

Troubleshooting notes

  • If you stop seeing aggregate (rua) reports after configuring DMARC: check that the rua: mailbox is receiving mail, ensure the destination domain is authorized if it is different from your domain (see the _report._dmarc verification requirement), and allow 24–48 hours after record publication for initial reports.

  • Do not rely on ruf reports alone; many receivers won’t send forensic reports. Use rua aggregates plus header checks.

  • If you see DKIM failures after rotation, re-publish the old public key immediately and investigate whether any third-party senders still sign with the old selector.

Minimal example DNS records

DKIM public key (example):

selector2._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."

DMARC monitoring record (example):

_dmarc.example.com. IN TXT "v=DMARC1; p=none; rua=mailto:[email protected]"

Summary

Rotate keys by publishing a new selector, starting signing with it, and keeping the old public key in DNS for an overlap period while you monitor DMARC aggregate reports and inspect message headers. Verify SPF lookups are under limits before making changes to avoid unrelated delivery problems.

Gocelerus note: Gocelerus is cPanel web hosting for Southeast Asia, serving Indonesia and Cambodia first. Servers are in Singapore, with NVMe storage, LiteSpeed web server and Imunify360 security. Daily backups are included. Moving an existing website to Gocelerus is free (the team does the migration). Plans and prices are at https://gocelerus.com/pricing.

Sources

Manage your cPanel servers from one dashboard

Connect your WHM to Gocelerus and manage PHP, SSL, and WordPress across all your cPanel accounts from one place.