DKIM works like an official stamp on each message. The sending server holds a secret private key and uses it to sign parts of the message (such as the sender, subject and body), and the matching public key is published in DNS so any receiving server can check the stamp. Unlike SPF, the signature stays valid even when a message is forwarded.
What DKIM looks like
The signature inside the message:
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=default;
h=from:to:subject:date; bh=...; b=...
d=is the signing domain.s=is the selector, which tells receivers where to find the key.
The public key in DNS, as a TXT record at selector._domainkey.domain:
default._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh...IDAQAB"
Practical example: checking DKIM
- Send a message from your mailbox to a Gmail account.
- Open it and choose Show original.
- Look for the line
DKIM: 'PASS' with domain example.com.
To check the record itself:
dig TXT default._domainkey.example.com +short
Or use the TXT lookup tool.
Common problems
- Truncated record: a 2048-bit key is long, and some DNS panels split or cut it. Copy it whole, with no extra spaces or line breaks.
- Wrong selector: the record is published at
mail._domainkeywhile the server signs withdefault. - DNS hosted elsewhere: the key is created on the hosting, but the zone lives at Cloudflare, for example, so it has to be copied there.
- Message changed after signing: some mailing lists and antivirus gateways add text and break the signature. See DKIM fail.
On ArabyHost
DKIM is set up automatically, along with SPF, for your business email when your domain points to ns1.arabicode.com and ns2.arabicode.com, so you never have to generate keys yourself. If your DNS zone is hosted elsewhere, copy the DKIM record from the Email Deliverability page in cPanel. To complete the setup, add a DMARC policy as described in the SPF, DKIM and DMARC guide.
FAQ
What is a DKIM selector?
A short name that identifies the key and appears in the record name, like default._domainkey.example.com. It lets one domain use several keys, one per sending service.
Can I have more than one DKIM record?
Yes, unlike SPF. Each service that sends for you can have its own selector and key without conflict.
Why does DKIM fail when the record exists?
Usually the message was changed in transit, for example a mailing list added a footer, or the record was copied incomplete or with extra spaces, or the key in DNS doesn't match the server's key.