What is DKIM?
By Ash, Founder, HosteazePublished 1 min read
The short answer
DKIM (DomainKeys Identified Mail) adds a hidden digital signature to every email you send. Your email provider signs each message with a private key, and you publish the matching public key in your domain's DNS. Receiving servers use it to confirm the email came from your domain and wasn't changed on the way.

DKIM works like a wax seal on a letter. Your email provider stamps every outgoing message with a signature only it can make, and anyone can check that seal against the public key in your DNS. If someone forges your address, or a message is altered on the way, the seal doesn't match.
How does DKIM work?
- Your email provider creates a pair of keys: a private key it keeps, and a public key for you.
- You publish the public key as a DNS record on your domain.
- Every email you send gets a
DKIM-Signatureheader, made with the private key. - The receiving server looks up your public key and checks the signature. A match is a DKIM pass.
What does a DKIM record look like?
The record lives at a name made of a selector, _domainkey, and your domain:
google._domainkey.yourdomain.com TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."| Part | Meaning |
|---|---|
google | The selector. Each service picks its own (Microsoft 365 uses selector1 and selector2). |
v=DKIM1 | Identifies the record. |
k=rsa | The key type. |
p= | The public key itself, a long string you copy from your provider. |
You never write the key yourself. Your provider generates it and shows you the exact name and value to paste. Some, including Microsoft 365, ask for a CNAME record instead of a TXT record so they can rotate the key for you.
Why does DKIM matter more than SPF?
DKIM survives forwarding, and SPF doesn't. When a client forwards your email to their accountant, the forwarding server isn't on your SPF list, but your DKIM signature still checks out. That makes DKIM the more reliable way to pass DMARC. For the steps, see how to set up SPF, DKIM and DMARC.
Frequently asked questions
What is a DKIM selector?
A label that lets one domain have several DKIM keys, one per service. It forms the first part of the record's name, for example google._domainkey.yourdomain.com.
Do I need a DKIM record for each service that sends my email?
Yes, ideally. Each service signs with its own key, so each needs its own DKIM record under a different selector. They don't conflict with each other.
Should I use a 1024-bit or 2048-bit key?
Use 2048-bit if your DNS provider accepts it. Google and Microsoft both support 2048-bit keys.



