Glossary · Authentication
What is DKIM?
The short answer
DKIM (DomainKeys Identified Mail) is a digital signature that your mail server adds to every email you send. The receiving mail server checks the signature against a key published in your domain's DNS. If it matches, the email really came from your domain and was not changed on the way.
Also called: DomainKeys Identified Mail, DKIM signature, DKIM record
By Ali Tahir Sajjad · Updated · 4 min read
DKIM: what to remember
- DKIM is a signature on your email. It proves the email came from your domain and was not changed after it was sent.
- DKIM uses two keys: a secret key that signs the email and a public key in your DNS that anyone can use to check it.
- DKIM does not hide or encrypt your email. It only proves where it came from.
- Gmail, Yahoo and Outlook expect senders to use DKIM. Without it, more of your email goes to spam.
What does DKIM mean?
DKIM stands for DomainKeys Identified Mail. The name is a mouthful, but the idea is simple: DKIM is a signature on your email.
Think of an old letter closed with a wax seal. The seal has the sender’s own stamp on it. If the seal is unbroken and the stamp is the right one, you know two things: the letter really came from that person, and nobody opened it and changed it on the way.
DKIM does the same for email. Your mail server stamps every email with a signature. The receiving mail server checks the stamp. If it is correct, the email is genuine.
DKIM is one of three checks that together are called email authentication. The other two are SPF and DMARC.
How DKIM works, step by step
DKIM uses two keys that belong together.
- A private key, which is secret and stays on your mail server.
- A public key, which sits in your domain’s DNS where anyone can read it.
Here is what happens when you send an email:
- You press send.
- Your mail server uses the private key to create a signature from the contents of the email.
- It adds that signature to the email as a hidden line called
DKIM-Signature. - The receiving mail server reads the signature. It finds your domain and a short label called the DKIM selector, which tells it where your public key is.
- It fetches the public key from your DNS and uses it to check the signature.
- If the signature matches, DKIM passes. If the email was changed, or the key is wrong, DKIM fails.
A DKIM example
A DKIM setup has two visible parts.
1. The DKIM record in your DNS. This is the public key.
Name: google._domainkey.example.com
Type: TXT
Value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOC...
2. The DKIM signature on each email. You can see it in the email header.
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=google; ...
In the signature, d=example.com is the domain that signed the email and s=google is the selector. When the receiving server checks it, the result is written into the header as dkim=pass.
DKIM vs SPF vs DMARC
These three work as a team, and each has its own job.
| What it checks | Simple picture | |
|---|---|---|
| SPF | Was the email sent from a server you allow? | A guest list at the door |
| DKIM | Is the email genuine and unchanged? | A seal on the letter |
| DMARC | What should happen if SPF and DKIM fail? | Instructions for the doorman |
DKIM has one big advantage over SPF: it stays with the email. If your email is forwarded to another address, SPF usually breaks, but the DKIM signature still passes. That is why DMARC accepts either one.
Why DKIM matters for cold email
Gmail, Yahoo and Outlook all expect senders to sign their email. An email with no DKIM signature looks careless at best and forged at worst, so it is much more likely to land in spam.
With cold email this matters twice as much. The person you are writing to has never heard of you, so the inbox provider has nothing to go on except the technical signals. DKIM is one of the first things it looks at.
There is one more catch. If you never set up DKIM for your own domain, Google and Microsoft still sign your email, but with their domain, not yours. That signature passes, yet it does nothing for your domain. A proper DKIM setup signs with your own domain name.
Every domain you send from needs its own DKIM record. PureMail’s team adds it for each domain when it sets up your Google Workspace inboxes or Microsoft 365 inboxes.
How to set up DKIM
The steps are the same idea on every provider.
- Create the DKIM key in your email provider’s admin panel. Google gives you one TXT record. Microsoft gives you two CNAME records.
- Add the record to your DNS, exactly as shown.
- Wait for the record to be visible, which can take from a few minutes to a day.
- Switch DKIM on in the admin panel. This step is easy to miss.
- Send a test email and check that the header says
dkim=passwith your domain.
Our guide to setting up SPF, DKIM and DMARC walks through each step.
Common DKIM mistakes
- Adding the record but never switching DKIM on. The record alone does nothing until signing is turned on.
- Copying the key with a line break or a missing character. DKIM keys are long, and one wrong character makes DKIM fail.
- Signing with the provider’s domain. If the header shows
d=followed by a Google or Microsoft domain, your own DKIM is not active yet. - Using a short key. Choose a 2048-bit key when your provider offers it.
- Setting up DKIM on one domain only. Each sending domain needs its own.