How do you check if DKIM is working?
To check if DKIM is working, run three tests: confirm the public key resolves in DNS at selector._domainkey.yourdomain, send a real message and confirm the receiver's Authentication-Results header shows dkim=pass, then confirm the header.d= domain matches your From domain so DKIM counts for DMARC.
Each test catches a different failure. A published key proves nothing if the platform is not signing, and a passing signature on the wrong domain does nothing for DMARC (Domain-based Message Authentication, Reporting and Conformance). This guide covers the commands, where to look in Gmail and Outlook, what each result means and how an MSP (managed service provider) checks a whole portfolio. If DKIM is not set up yet, start with how to set up DKIM, or the DKIM pillar guide for the concept.
Key takeaways
- DKIM is working only when all three tests agree: the key is in DNS, real mail shows
dkim=pass, and the signing domain aligns with the From domain. - The selector comes from the
s=tag of a real message'sDKIM-Signatureheader. Without it you cannot look up the key. - Test with a message sent to a different mailbox at a large provider, such as a Gmail account, and read the receiver's
Authentication-Resultsheader. dkim=pass header.d=example.onmicrosoft.comor agappssmtp.comdomain means DKIM verifies but does not help DMARC.- "How long does DKIM take" is mostly a DNS caching question: TTLs, negative caching, and provider waits of up to 48 hours.
What are the three checks for DKIM?
The three checks are a DNS check, a message check and an alignment check. Run them in that order, because each depends on the one before. The table shows what each proves and what it cannot tell you.
| Check | What you test | Tool | Proves | Does not prove |
|---|---|---|---|---|
| 1. Key in DNS | TXT or CNAME at selector._domainkey.domain |
dig, nslookup, Resolve-DnsName |
A receiver can fetch the public key | That anything is signing with it |
| 2. Real message passes | DKIM-Signature and Authentication-Results headers |
Gmail Show original, Outlook message details | The platform signs and the signature verifies | That the signature helps DMARC |
| 3. Alignment | header.d= versus From domain, aggregate reports |
Headers, DMARC rua reports |
DKIM counts towards a DMARC pass | Nothing more is needed for DKIM |
Check 1: is the DKIM public key published in DNS?
The key is published if a TXT query for selector._domainkey.yourdomain returns a record containing v=DKIM1 and a non-empty p= value, either directly or after following a CNAME to the provider. You need the exact selector first, because DKIM keys live under a name only the sender knows.
How do you find the DKIM selector in an email header?
Open the full header of a message from the domain and find the DKIM-Signature line. The s= tag is the selector and the d= tag is the signing domain. Together they give the DNS name to query: s value, then ._domainkey., then the d value.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.co.uk;
s=selector1; h=from:to:subject:date:message-id; bh=...; b=...
Here the receiver queries selector1._domainkey.example.co.uk. RFC 6376 Section 3.6.2.1 says "All DKIM keys are stored in a subdomain named "_domainkey"", and gives the same construction. The receiver's Authentication-Results header usually repeats the selector as header.s=. A message can carry several DKIM-Signature headers (for example one from the client's platform and one from an ESP, an email service provider); check each one. Our DKIM selector guide explains why every sender should have its own.
How do you look up a DKIM record with dig or nslookup?
Query the TXT record at the selector name. On macOS or Linux use dig; on Windows use nslookup -type=TXT or Resolve-DnsName. All three follow a CNAME automatically, so a provider-hosted key still returns the TXT value at the end of the chain.
# macOS / Linux
dig +short TXT selector1._domainkey.example.co.uk
# Show the CNAME on its own (Microsoft 365 and most ESPs)
dig +short CNAME selector1._domainkey.example.co.uk
# Windows
nslookup -type=TXT selector1._domainkey.example.co.uk
Resolve-DnsName -Type TXT selector1._domainkey.example.co.uk
To bypass a stale local cache, ask a public resolver or the authoritative server directly, for example dig +short TXT google._domainkey.example.com @8.8.8.8, or find the zone's name servers with dig +short NS example.com and query one of them. If you prefer a browser, the free DKIM validator on this site runs the same lookup and parses the tags.
What does a valid DKIM record look like?
A valid record starts with v=DKIM1, names the key type with k=rsa (RFC 6376 makes rsa the default if k= is absent) and carries the base64 public key in p=. A 2048-bit key is usually returned as two or more quoted strings, which is normal.
$ dig +short TXT google._domainkey.example.com
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn5q..." "...IDAQAB"
What to look for in the answer:
v=DKIM1first. RFC 6376 Section 3.6.1 says that ifv=is present it "MUST be set to "DKIM1"" and must be the first tag.- A long
p=value. Roughly 216 base64 characters suggests a 1024-bit key, roughly 392 a 2048-bit key. The DKIM key length guide explains why 2048 is the target. - An empty
p=. RFC 6376 says "An empty value means that this public key has been revoked." Mail signed with that selector fails withkey revoked. t=y. The domain is testing DKIM. RFC 6376 says verifiers "MUST NOT treat messages from Signers in testing mode differently from unsigned email". Remove the flag once tests pass.- Exactly one TXT record. Two different TXT records at one selector give unpredictable results.
- No answer at all. Either the selector is wrong, the record is not published yet, or it sits at the wrong name, for example
selector1._domainkey.example.co.uk.example.co.ukbecause the DNS panel appended the zone a second time.
Split strings are fine: RFC 6376 Section 3.6.2.2 says "Strings in a TXT RR MUST be concatenated together before use with no intervening whitespace." A space inside the base64 or a truncated final string is not fine.
How do you check Microsoft 365 and Google Workspace keys?
Microsoft 365 publishes keys through two CNAMEs, selector1._domainkey and selector2._domainkey, that point into Microsoft's DNS. Google Workspace uses one TXT record at google._domainkey by default. Check both the CNAME targets and the TXT they resolve to.
dig +short CNAME selector1._domainkey.example.co.uk
selector1-example-co-uk._domainkey.contoso.n-v1.dkim.mail.microsoft.
dig +short TXT selector1._domainkey.example.co.uk
"v=DKIM1; k=rsa; p=MIIBIjANBgkqh..."
Microsoft's DKIM configuration page says "Only one selector is active" at a time; the other is used after a key rotation. Both CNAMEs must resolve. The target format differs between older and newer custom domains, so compare against the values the tenant shows rather than a template. If the client's DNS is on Cloudflare, Microsoft says to set these CNAMEs to DNS only, because a proxied record returns Cloudflare addresses instead of the CNAME target.
For Google Workspace, Google's Set up DKIM page says "The default prefix selector is google", so dig +short TXT google._domainkey.example.com is the first query to run. A tenant may use a different prefix if google was already taken.
Does my domain have DKIM?
You cannot list every DKIM key a domain has, because DNS does not let you enumerate names under _domainkey. Check the selectors you expect (selector1 and selector2 for Microsoft 365, google for Google Workspace, and whatever each ESP documents), then confirm with real headers or DMARC aggregate reports.
Aggregate reports are the most complete answer. Every record in a report includes the DKIM domain and selector the receiver saw, per sending source, so a few weeks of reports at p=none show every selector in use, including ones nobody documented. A domain that sends no mail and has no DKIM records is fine: Microsoft advises against publishing DKIM on parked domains at all.
Check 2: does a real message pass DKIM?
A message passes when the receiving server's Authentication-Results header shows dkim=pass for your signature. Send a test to a mailbox at a different provider, open the full header, and read the receiver's verdict, not the sender's dashboard. This is the only check that proves the platform is actually signing.
Two provider notes before you send. Google's Set up DKIM page says "You can't verify DKIM is on by sending yourself a test message"; send to a different Gmail or Google Workspace user. Microsoft's DKIM page says "Don't send mail to AOL for DKIM testing", because AOL might skip the DKIM check if SPF passes.
How do you test a DKIM signature in Gmail?
Send a message from the domain to a Gmail account, open it, and use Gmail's original view. Google's header instructions say: beside the Reply button, click the More icon, then select Show original. A new window shows the full header, with Copy to clipboard to copy it.
In the raw text, find the Authentication-Results line added by mx.google.com:
Authentication-Results: mx.google.com;
dkim=pass header.i=@example.co.uk header.s=google header.b=Ab12Cd34;
spf=pass (google.com: domain of sender@example.co.uk designates 203.0.113.10 as permitted sender) smtp.mailfrom=sender@example.co.uk;
dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=example.co.uk
Gmail reports the signing identity as header.i=@example.co.uk; the domain after the @ is the one to compare. Google's DKIM troubleshooting page also notes that "Gmail checks only the first 5 signatures", which matters when a message passes through several signing hops. The Show original steps are for Gmail in a browser; on a phone, open the message on a computer instead.
How do you check DKIM in Outlook and Microsoft 365?
In new Outlook and Outlook on the web, open the message, select More actions (the three dots), then View > View message details, as described in Microsoft Support. In classic Outlook for Windows, open the message and use File > Properties, then read the Internet headers box.
Exchange Online writes its verdict in this format, documented on Microsoft's anti-spam message headers page:
Authentication-Results: spf=pass (sender IP is 203.0.113.10)
smtp.mailfrom=example.co.uk; dkim=pass (signature was verified)
header.d=example.co.uk;dmarc=pass action=none
header.from=example.co.uk;compauth=pass reason=100
Microsoft defines header.d as the "Domain identified in the DKIM signature, if any. This domain is queried for the public key." A dkim=fail carries the reason in brackets, for example (body hash did not verify). An unsigned message shows dkim=none (message not signed) and header.d=none, which is the typical result when a custom domain never had signing enabled.
To check outbound signing from a Microsoft 365 tenant, the receiver matters more than the sender: send from the client's tenant to an external mailbox (Gmail works well) and read that receiver's header.
What does compauth tell you about DKIM?
compauth is Microsoft's composite authentication result. Microsoft says it combines SPF, DKIM, DMARC and other parts of the message and "Uses the From: domain as the basis of evaluation". It is not a DKIM result, but its reason code tells you whether DKIM carried the pass.
| compauth value | Reason code | What it means for DKIM |
|---|---|---|
pass |
101 |
Message DKIM signed by the From domain: aligned DKIM did the work |
pass |
100 |
SPF passed, or DKIM passed with aligned domains |
pass |
108 |
DKIM failed because earlier legitimate hops modified the body |
fail |
000 |
DMARC failed with p=quarantine or p=reject |
fail |
001 |
Implicit fail: no records, or a weak policy such as p=none |
softpass |
2xx |
Soft pass on implicit authentication |
Microsoft notes that a message can still be delivered despite a compauth failure, so use it as a pointer and read the dkim= field itself for the answer.
Check 3: does DKIM align for DMARC?
DKIM aligns when the header.d= (or d=) domain matches the From domain, or shares its Organizational Domain under relaxed alignment. Compare the two values in the same Authentication-Results header. A pass on a provider's own domain verifies the signature but contributes nothing to DMARC.
RFC 9989, the DMARC standard that obsoletes RFC 7489, makes relaxed (adkim=r) the default. Relaxed alignment means "the Author Domain has the same Organizational Domain as an Authenticated Identifier", so d=mail.example.co.uk aligns with From: example.co.uk. With adkim=s, only an identical domain aligns. RFC 9989 Section 4.4.1 counts a DMARC pass "if any DKIM-Authenticated Identifier aligns with the Author Domain", so one aligned signature is enough even when others are present.
header.d= |
From domain | Aligned (relaxed)? |
|---|---|---|
example.co.uk |
example.co.uk |
Yes |
news.example.co.uk |
example.co.uk |
Yes (strict: no) |
contoso.onmicrosoft.com |
example.co.uk |
No |
example-co-uk.20230601.gappssmtp.com |
example.co.uk |
No |
sendgrid.net |
example.co.uk |
No |
The last three rows are the common "DKIM passes but DMARC fails" cases. The DMARC alignment guide covers the rules in depth.
How do DMARC aggregate reports show DKIM results?
Aggregate reports show two different DKIM values per sending source: the raw verification result under auth_results, and the DMARC-aligned result under policy_evaluated. A source with auth_results DKIM pass but policy_evaluated DKIM fail is signing with a domain that does not align.
<record>
<row>
<source_ip>203.0.113.10</source_ip>
<count>412</count>
<policy_evaluated>
<disposition>none</disposition>
<dkim>fail</dkim>
<spf>pass</spf>
</policy_evaluated>
</row>
<identifiers>
<header_from>example.co.uk</header_from>
</identifiers>
<auth_results>
<dkim>
<domain>contoso.onmicrosoft.com</domain>
<selector>selector1</selector>
<result>pass</result>
</dkim>
</auth_results>
</record>
RFC 9990 defines the auth_results DKIM element with domain (the d= tag), selector (the s= tag) and result, and describes the policy_evaluated value as "The DMARC-aligned authentication result", which is only pass or fail. This is the check that scales: one report covers every source that sent as the domain that day, not just the message you tested. DMARC aggregate reports explained walks through the rest of the format.
What do DKIM results mean?
DKIM results in Authentication-Results headers use the values defined in RFC 8601 Section 2.7.1: pass, fail, neutral, policy, temperror, permerror and none. The bracketed text often carries the more specific verifier result from RFC 6376, such as body hash did not verify.
| Result | RFC 8601 definition (shortened) | Typical cause | What to do |
|---|---|---|---|
pass |
Signed, and the signature "passed verification tests" | Working | Check header.d= for alignment |
fail (body hash did not verify) |
Signed, but failed verification | Footer, disclaimer, link rewriting or a mailing list changed the body after signing | Find the system that modifies mail; sign after it or move the footer before signing |
fail (signature did not verify) |
Signed, but failed verification | Headers changed, or the DNS key does not match the private key | Compare the published key with the platform's; check for a half-finished rotation |
neutral |
Signed, but with "syntax errors" or otherwise not processable | Malformed signature header | Fix the signing software or service |
policy |
Signed, but some aspect was "not acceptable" to the receiver | Receiver rule, for example a weak algorithm | Move to rsa-sha256 and a 2048-bit key |
temperror |
Error "likely transient", such as a temporary inability to retrieve a public key | DNS timeout or DNS host outage | Retest; check the DNS host |
permerror |
Unrecoverable error | Missing key (no key for signature), revoked key, broken record |
Publish or fix the record at the selector |
none |
"The message was not signed." | Signing never enabled, or mail sent through an unsigned path | Enable signing on that platform |
The RFC 6376 verifier strings you will see in brackets map to these: Section 6.1.2 defines no key for signature and key revoked as permanent failures and key unavailable as a temporary one, and Section 6.1.3 defines body hash did not verify and signature did not verify. Receivers phrase the bracketed text slightly differently, so match on the meaning, not the exact string. For reading the rest of the header, see how to read email headers.
Why is DKIM not working?
When DKIM is not working, one of the three checks is failing, and the header usually says which. Start from the result value, then match it to the cause below. Most cases are a missing signature, a signature on the provider's domain, a broken TXT record, or DNS that has not caught up yet.
| Symptom | Likely cause | Fix |
|---|---|---|
No DKIM-Signature header, dkim=none |
Signing not enabled on the platform, or mail leaves through a server that does not sign | Enable signing; check every outbound path, including scanners, printers and line-of-business apps |
dkim=pass header.d=contoso.onmicrosoft.com |
Microsoft 365 custom domain signing not enabled; mail signed only with the tenant's initial domain | Enable DKIM for the custom domain in the Defender portal or PowerShell |
dkim=pass with d= ending in gappssmtp.com |
Google Workspace domain without its own key | Generate a key, publish google._domainkey, click Start authentication; see gappssmtp.com in email headers |
dkim=pass header.d= an ESP's domain |
ESP domain authentication not completed | Publish the ESP's CNAMEs and finish its domain verification |
permerror (no key for signature) |
Selector not published, or published at the wrong name | Query s= and d= from the header; fix the host name |
fail or key syntax error with a 2048-bit key |
TXT value truncated or split badly at the 255-character string limit | Re-enter as several quoted strings with no spaces inside the key |
fail (body hash did not verify) |
Message changed after signing | See how secure email gateways affect DKIM |
| Key correct in your DNS panel, but lookups fail | Cached negative answer or old TTL; Cloudflare proxy on a CNAME | Query the authoritative server; wait out the TTL; set CNAMEs to DNS only |
| New key in DNS, receivers still verify the old one | Rotation in progress or a cached TXT | Check which selector s= names; see rotating DKIM keys safely |
On the Microsoft 365 initial domain: Microsoft's documentation says the *.onmicrosoft.com domain is signed automatically and that no DKIM signing occurs for custom domains until you configure it. A signature on the onmicrosoft.com domain is therefore a sign that the custom domain step is missing, not that DKIM is working for the client.
How long does DKIM take to update?
DKIM itself updates instantly; DNS caching is what you wait for. A new or changed record is visible to a resolver once any cached copy expires, which is the old record's TTL (time to live). Providers add their own detection delays: Microsoft says up to 48 hours for DNS propagation, and Google says up to 48 hours for DKIM to start working.
The details that explain most "it still fails" tickets:
- Changed record: resolvers that cached the old value keep it until its TTL runs out. A TTL of
3600means up to an hour;86400means up to a day. Lower the TTL a day before a planned change. - New record you queried too early: a "does not exist" answer is cached too. RFC 2308 Section 5 says its TTL "is taken from the minimum of the SOA.MINIMUM field and SOA's TTL", so check the zone's SOA record (
dig SOA example.co.uk) to see how long a premature lookup can linger. - Microsoft 365: Microsoft's DKIM page says "It takes a few minutes (or possibly longer) for Microsoft 365 to detect the new CNAME records", and that "DNS propagation can take a few minutes to 48 hours depending on your DNS provider and TTL settings." Until detection, the domain stays at
CnameMissingand the signing toggle cannot be enabled. Microsoft's troubleshooting guidance treatsCnameMissingafter 48 hours as a problem to investigate, not a wait. - Google Workspace: Google says "it can take up to 48 hours for DKIM authentication to start working" after adding the key, and that the Admin console may show "You must update the DNS records for this domain" for up to 48 hours even when the record is correct.
- Key rotation in Microsoft 365: Microsoft says it "takes four days (96 hours) for the new private key to start signing messages."
The practical test is the authoritative server. If dig @<authoritative name server> returns the correct record, the rest is caching and provider timing, and there is nothing more to change.
How do you check DKIM status in Microsoft 365 with PowerShell?
Connect to Exchange Online PowerShell and run Get-DkimSigningConfig. It lists every custom domain with DKIM configuration, whether signing is enabled, the status, and the exact CNAME targets to compare with DNS. This is the fastest way to check many domains in one tenant.
Connect-ExchangeOnline
# Every configured domain, its state and the CNAMEs Microsoft expects
Get-DkimSigningConfig | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME
# Full detail for one domain, including key size and rotation dates
Get-DkimSigningConfig -Identity example.co.uk | Format-List
Read the output like this:
Enabled : Truewith a signing status: the domain is signing. Confirm with Check 2.Status : CnameMissing: Microsoft has not detected both CNAMEs. CompareSelector1CNAMEandSelector2CNAMEwithdig +short CNAMEresults character by character.- Domain missing from the output: DKIM was never configured for it, so mail from it is not signed with the custom domain.
- Rotation fields: Microsoft documents
KeyCreationTime,RotateOnDate,SelectorBeforeRotateOnDateandSelectorAfterRotateOnDatefor tracking which selector is active.
Microsoft notes that the *.onmicrosoft.com domain typically does not appear in this output unless someone configured it manually. Setup and enablement commands are in how to set up DKIM.
How should an MSP check DKIM across a client portfolio?
At portfolio scale, start from DMARC aggregate reports, not individual messages. They show every source sending as each client domain, with its DKIM domain, selector and aligned result. Then use DNS and PowerShell checks only for the domains and sources the reports flag.
A routine that works as a monthly or quarterly review:
- Make sure every client domain has a DMARC record with a
ruaaddress. Without reports you only know about the senders you remembered. - Find unaligned sources. Filter report rows where
policy_evaluatedDKIM isfail. Group byauth_resultsDKIM domain:onmicrosoft.com,gappssmtp.comand ESP domains each point to a known fix. - Run
Get-DkimSigningConfigin each Microsoft 365 tenant. Flag domains that are not enabled, stuck atCnameMissing, or still on 1024-bit keys. - Query the expected selectors for every domain.
selector1,selector2,googleand each documented ESP selector. Record emptyp=values (revoked) andt=yflags left over from testing. - Send one real test per platform after any change, to an external Gmail account, and keep the
Authentication-Resultsline in the ticket as evidence. - Keep a selector register per domain: selector, platform, owner, key size, date published, last rotation. The DKIM management guide for MSPs covers ownership and offboarding.
- Only then move DMARC policy. Once every legitimate source shows aligned DKIM or SPF, move from
p=nonetop=quarantinetop=reject. RFC 9989 removedpct, so there is no percentage ramp.
For UK clients, the NCSC's DKIM guidance recommends a 2048-bit key, suggests rotating keys every 12 months, and notes that alignment issues are raised through a DMARC reporting tool. A platform such as DMARC AI processes the aggregate reports for every client domain and uses AI to classify sending sources, which makes step 2 a filter rather than an XML exercise.
FAQ
How do I know if DKIM is enabled?
Look for a DKIM-Signature header in a message sent from the domain, then check the receiving server's Authentication-Results line for dkim=pass with your own domain in header.d= or header.i=. In Microsoft 365, Get-DkimSigningConfig shows Enabled per domain. In Google Workspace, the status reads "Authenticating email with DKIM".
Can I test DKIM without sending an email?
Partly. A DNS lookup with dig or nslookup confirms the public key is published and well formed, which is Check 1. It cannot confirm that the platform signs outgoing mail or that the signature verifies. For that you need a real message and the receiver's header, or DMARC aggregate reports showing the source with a DKIM pass.
Why does DKIM pass but DMARC fail?
The signature verified, but its d= domain does not align with the visible From domain. Typical causes are a Microsoft 365 tenant signing only with its onmicrosoft.com domain, Google Workspace signing with a gappssmtp.com domain, or an ESP signing with its own domain. Enable custom-domain signing on that platform and retest.
What does dkim=none mean?
It means the receiver found no DKIM signature to evaluate: RFC 8601 defines it as "The message was not signed." Usually signing was never switched on for that domain or platform, or the message left through a path that does not sign, such as an on-premises relay or a scan-to-email device.
How often should I check DKIM?
Check after every change to DNS, mail platforms or sending services, and review all client domains on a fixed schedule, monthly or quarterly. Continuous DMARC aggregate report monitoring catches new unaligned senders between reviews, and the NCSC suggests rotating keys every 12 months, which is a natural point for a full recheck.
Final thoughts
Checking DKIM is three questions, asked in order: is the key in DNS, does a real message pass, and does the pass align with the From domain. Most failed checks stop at the third question, with a valid signature on onmicrosoft.com, gappssmtp.com or an ESP's domain.
For one domain, dig plus a Gmail Show original view answers all three in five minutes. For a portfolio, let aggregate reports find the problem sources first, then use DNS and PowerShell to confirm the fix. Keep the Authentication-Results line as evidence, and DKIM stops being something you assume is working.