DKIM (DomainKeys Identified Mail) adds a digital signature to each email. The receiver fetches your public key from DNS and checks that the message wasn't altered and really came from a holder of your private key.
Selectors
The public key lives at <selector>._domainkey.yourdomain.com. The selector lets you have several keys at once, one per service. Microsoft 365 uses selector1 and selector2, published as CNAMEs to Microsoft.
Why DKIM matters for DMARC
DKIM survives forwarding better than SPF, and third-party services can sign as your domain, which gives aligned DKIM and a DMARC pass. Setting up DKIM for every service that sends as you is usually the main job on the road to p=reject.
Key length and rotation
- Use 2048-bit keys where the service allows; 1024-bit is the minimum.
- Rotate keys periodically. Two selectors let you switch without downtime.
- Remove keys for services you no longer use.
Turning it on in Microsoft 365
In the Defender portal, open Email & collaboration → Policies → Threat policies → Email authentication settings → DKIM, publish the two CNAME records it shows, then enable signing.