DKIM, short for DomainKeys Identified Mail, is a way of signing every email your domain sends. The sending server adds a hidden digital signature to each message, and publishes the key needed to check it in your domain’s DNS. The receiving server looks up that key, checks the signature, and learns two things: that the message really came from a server your domain authorised, and that nobody changed it on the way. Alongside SPF and DMARC, it is one of the three records that decide whether a business’s email is trusted or treated as suspicious.
In short
- A signature added to every email your domain sends.
- Proves where a message came from and that it was not altered.
- The checking key lives in your domain’s DNS.
- Works with SPF and DMARC, not instead of them.
How the signature works
DKIM uses a pair of keys that belong together.
- The private key stays on the sending service. It signs each outgoing message, covering the important headers and the body.
- The public key is published as a DNS record on your domain, where anybody can read it.
- The signature travels in the message header, naming your domain and the selector used.
When the message arrives, the receiving server reads the signature, fetches the public key from your DNS, and checks that the two match. If somebody altered the message or forged the signature, the check fails. Nothing about this is visible to the person reading the email.
Selectors, and why a domain can have several keys
Most businesses send email through more than one service: the everyday mailboxes, a newsletter tool, perhaps a booking system or an online store. Each one signs with its own key.
A selector keeps them apart. It is a short label written into each signature, and it tells the receiving server which published key to look up. One selector might belong to the mailbox provider and another to the newsletter platform. Each service that sends as your domain should have its own DKIM record, published under its own selector.
Where it sits beside SPF and DMARC
The three records answer different questions.
- The SPF record says which servers may send for your domain.
- DKIM proves an individual message was signed by an authorised sender and arrived unchanged.
- DMARC says what receiving servers should do when the checks fail, and sends reports.
SPF has a known weakness: it usually fails when a message is forwarded, because the forwarding server is not on your list. A DKIM signature normally survives forwarding, which is one reason DMARC can still pass when SPF does not.
Why it matters now
Large mailbox providers have tightened what they expect. Since February 2024, Google and Yahoo have required anybody sending to them in large volume to authenticate with SPF and DKIM and to publish DMARC, and smaller senders are expected to have at least one of the first two. Our page on email deliverability covers the full set of requirements.
For a small business, the practical effect is simpler. Mail without a valid signature is more likely to be filtered as spam or rejected, including invoices, quotations and replies to inquiries.
Setting it up
DKIM is switched on in the sending service, then published in DNS. The order matters.
- Find the DKIM setting in each service that sends as your domain, such as Microsoft 365, Google Workspace or a newsletter tool.
- Copy the record it generates, usually a TXT or CNAME record with a long value.
- Publish it at your domain host, exactly as shown, under the selector name given.
- Return to the service and switch signing on, once the record has had time to appear.
- Send a test message to a mailbox you control and check that DKIM shows as passed.
Google recommends keys of 2048 bits where the DNS host allows it. Some hosts limit the length of a single record, which is one reason a record can appear published but fail to work.
Where it goes wrong
DKIM faults are quiet. Mail keeps flowing, but more of it lands in spam.
- A record never published. The service was set up, but nobody added the DNS record.
- A record pasted with a break or a missing character, which makes the key unreadable.
- A new service added without its own key, so its mail goes out unsigned.
- Old records left behind for services the business stopped using years ago.
- Changes after signing. A footer or tracking added by another system after the message was signed breaks the signature.
Rotating keys and retiring old ones
A DKIM key does not expire on its own, but it should not stay in place forever. Replacing keys from time to time limits the damage if one is ever exposed, and services that support rotation publish a new selector before retiring the old one. When the business stops using a sending service, remove its DKIM record, so mail signed by an account the business no longer controls stops passing as yours.
Checking yours
Open any email you sent to a Gmail address, choose to show the original message, and look for the DKIM line. It should say pass and name your own domain. If it names the sending service’s domain instead, the service is signing for itself, not for you, and DMARC alignment will fail.
Words you will hear
- Private key. The secret the sending service uses to sign messages.
- Public key. The published half, held in your DNS.
- Selector. The label that points to the right public key.
- Signature. The header added to each signed message.
- Alignment. The signing domain matching the visible from domain.
- Key rotation. Replacing an old key with a new one.
List every service that sends email as your domain, then check one recent message from each. Any service whose mail does not show a DKIM pass for your own domain is the next record to publish.
Questions we get
More about dkim
What does DKIM stand for?
How does DKIM work?
What is the difference between SPF, DKIM and DMARC?
What is a DKIM selector?
Do I need DKIM if I already have SPF?
Why does my DKIM check fail?
Where do I find my DKIM record?
Related terms
SPF record
An SPF record is a DNS entry listing the servers allowed to send email for your domain. One missing entry and your own invoices start landing in spam.
DMARC
DMARC is a DNS record telling mail providers what to do with messages that fail SPF and DKIM for your domain, and where to send reports about who is sending.
Email deliverability
Deliverability is whether your email reaches the inbox or the spam folder. It is decided by your sending reputation, not by how well the email is written.