In Amazon SES, what is the difference between Easy DKIM and BYODKIM, and when would you choose BYODKIM?
answer
- who holds the private key
- three CNAMEs vs one TXT
- rotation: automatic or yours
- selector and origin EXTERNAL
- per-region tokens vs one reused key
basics
~20 sEasy DKIM has SES generate and rotate the signing key pair — you publish three CNAME records and forget it. BYODKIM means you supply your own private key and publish the public-key TXT record yourself, keeping key custody and rotation.
solid answer
~50 sBoth make SES add a `DKIM-Signature` header to your outbound mail; they differ in who owns the private key. With **Easy DKIM**, SES generates the key pair per region and hands you three CNAME records under `_domainkey` that point at SES-hosted records — because they are CNAMEs, SES can rotate the underlying keys without you touching DNS, and you pick RSA 1024- or 2048-bit. With **BYODKIM**, you generate the key pair, pass the base64 private key and a selector to `PutEmailIdentityDkimSigningAttributes` with `SigningAttributesOrigin` set to `EXTERNAL`, and publish one TXT record at `<selector>._domainkey.<domain>` yourself; rotation becomes your job. Choose Easy DKIM by default. Reach for BYODKIM when policy requires you generate and hold the key material, when the same key must sign the domain across SES and another provider, or when you want one selector reused across regions instead of per-region tokens.
code
bash · 14 lines# Easy DKIM: SES generates and rotates the key; you publish 3 CNAMEs
aws sesv2 create-email-identity \
--email-identity example.com \
--dkim-signing-attributes NextSigningKeyLength=RSA_2048_BIT
# BYODKIM: you supply the private key and publish one TXT record
aws sesv2 put-email-identity-dkim-signing-attributes \
--email-identity example.com \
--signing-attributes-origin EXTERNAL \
--signing-attributes DomainSigningSelector=sel1,DomainSigningPrivateKey="$(cat key.b64)"
# Check whether signing is actually active
aws sesv2 get-email-identity --email-identity example.com \
--query 'DkimAttributes.[SigningEnabled,Status,SigningAttributesOrigin]'go deeper
Know that SES can sign your outbound mail with DKIM and that setup means publishing DNS records for your domain — three CNAMEs for Easy DKIM, one TXT for BYODKIM.
Explain the mechanics: the CNAME indirection is what lets SES rotate Easy DKIM keys without a DNS change, while BYODKIM means you generate the key, supply it with a selector, and own rotation.
Show the operational judgment: monitor the identity's DKIM status because SES sends unsigned rather than failing, and plan selector overlap when rotating a BYODKIM key so in-flight mail still verifies.
Own the domain-wide policy. Decide whether key custody, multi-provider signing from one domain, or multi-region uniformity justifies taking on manual rotation, and make sure every sending stream on the domain authenticates consistently.
## What SES is actually deciding here DKIM attaches a signature header to each outbound message; the receiving mail server looks up a public key in DNS at `<selector>._domainkey.<domain>` and verifies the signature. The signing algorithms, canonicalisation and header selection are the DKIM protocol's own subject and are covered elsewhere. What SES makes you decide is narrower and entirely operational: **who generates and holds the private key, and who is responsible for rotating it.** That single choice is the whole of Easy DKIM vs BYODKIM. ## Easy DKIM When you set up a domain identity with Easy DKIM, SES generates the key pair inside the region and returns three DKIM tokens. You publish three CNAME records of the shape: ``` <token1>._domainkey.example.com CNAME <token1>.dkim.amazonses.com <token2>._domainkey.example.com CNAME <token2>.dkim.amazonses.com <token3>._domainkey.example.com CNAME <token3>.dkim.amazonses.com ``` The key point is the indirection. Your DNS delegates the record to SES-hosted DNS, so SES can rotate the key behind the token without you making a DNS change. Three tokens exist so rotation can happen with overlap. You choose the key length through `NextSigningKeyLength` (`RSA_1024_BIT` or `RSA_2048_BIT`). Verification is asynchronous: the identity's DKIM status moves from `PENDING` to `SUCCESS` once SES sees the records, and it can regress to `FAILED` if the records disappear. Nothing stops SES from sending while the status is not `SUCCESS` — the mail simply goes out unsigned, which is exactly the silent failure that wrecks DMARC alignment later. Easy DKIM tokens are **per identity per region**. Verifying `example.com` in `us-east-1` does not verify it in `eu-west-1`; the second region issues its own three tokens and needs its own three CNAMEs. ## BYODKIM Bring Your Own DKIM inverts the ownership. You generate an RSA key pair yourself, choose a selector, and hand SES the private key: ``` aws sesv2 put-email-identity-dkim-signing-attributes \ --email-identity example.com \ --signing-attributes-origin EXTERNAL \ --signing-attributes DomainSigningSelector=sel1,DomainSigningPrivateKey=<base64-der> ``` You then publish a single TXT record at `sel1._domainkey.example.com` containing the public key. SES signs with the key you gave it and nothing else. Rotation is now a procedure you own: generate a new key, publish a TXT record under a **new** selector, switch SES to that selector, and only retire the old TXT once mail signed with it has aged out of receivers' verification window. Skipping the overlap breaks verification for in-flight messages. ## Choosing between them Easy DKIM is the default answer, and an interviewer expects you to say so. Automatic rotation is a real operational win, and the CNAME delegation means one DNS change ever. BYODKIM earns its extra work in a few concrete situations: - **Key custody is a compliance requirement.** Some organisations mandate that signing key material is generated inside their own process and never issued by a vendor. - **The same domain signs through more than one provider.** If SES sends transactional mail and another platform sends marketing from the same domain, reusing one key and selector keeps the DNS surface small and the signing behaviour identical. - **Multi-region SES with one selector.** BYODKIM lets `us-east-1` and `eu-west-1` sign with the same selector, rather than six CNAMEs across two regions. - **DNS constraints.** Some DNS setups make those specific CNAMEs awkward; a single TXT record is easier. ## Where it bites in production The common incidents are all about the DNS records outliving nobody's attention. Someone migrates DNS providers and does not copy the `_domainkey` records across; SES quietly starts sending unsigned mail; DKIM no longer authenticates, and if SPF is not aligned either, DMARC-enforcing receivers start rejecting. Because SES keeps returning message IDs, nothing in your application logs looks wrong. Watch the identity's DKIM status as a monitored signal, not a one-time setup step. With BYODKIM the recurring failure is rotation that never happens because it is manual and undocumented, and private keys that end up in a git repository because someone needed them at deploy time. If you take custody of a key, take custody of its storage too — Secrets Manager or an equivalent, not a config file. One more subtlety worth stating: DKIM survives forwarding in a way envelope-based authentication does not, because the signature travels with the message. That is why DKIM, not SPF, is usually the authentication mechanism that keeps mail authenticated after a mailing list or a corporate forwarder touches it — and it is why getting DKIM right in SES matters more than it first appears.
- Your DKIM CNAMEs were dropped during a DNS migration. What does SES do on the next send?It keeps sending. The identity's DKIM status regresses, SES stops attaching a valid signature, and the API still returns a message ID — nothing in your application errors. Receivers that enforce DMARC start failing the mail if SPF is not aligned either. Treat the identity's DKIM status as a monitored signal and alarm on it, rather than assuming setup is permanent.
- Does verifying a domain identity with Easy DKIM in one region cover your other SES regions?No. Identities and their Easy DKIM tokens are per region, so a second region issues its own three tokens and needs its own three CNAME records. That per-region duplication is one of the practical arguments for BYODKIM, where a single selector and key can be installed in every region you send from.
- How would you rotate a BYODKIM key without breaking verification for mail already in flight?Generate the new pair, publish its public key under a new selector, then point SES at that selector. Leave the old selector's TXT record in place until messages signed with it have aged out of receivers' verification window, then remove it. Cutting the old record at the same moment you switch selectors invalidates signatures on mail still being delivered or forwarded.
saying these in an interview costs you the question
- Thinking Easy DKIM and BYODKIM differ in signing strength
- Believing SES refuses to send when DKIM verification lapses
- Assuming one region's DKIM setup covers all SES regions
- Treating BYODKIM key rotation as something SES does for you
- Storing the BYODKIM private key in the application repository