Last Updated: February 2026 15 min read

How to Check If Your DKIM Is Working Correctly

To verify DKIM is working, send a test email and check the Authentication-Results header for "dkim=pass". You can also use MXToolbox DKIM Lookup to confirm your public key is published correctly in DNS, or run dig from the command line. Both checks are necessary: the DNS record must exist AND your mail server must be actively signing outgoing messages with a valid DKIM signature.

DKIM (DomainKeys Identified Mail) requires two components working in unison: a public key published in DNS and a mail server that cryptographically signs every outgoing message with the corresponding private key. If either component is misconfigured, DKIM verification will fail at the receiving end, which can undermine your DMARC compliance and hurt your deliverability. This guide walks through every method for verifying DKIM, explains the signature fields in detail, and covers common failures and their fixes.

Check DKIM in Gmail Headers

Gmail provides a straightforward way to inspect authentication results for any message you receive. This is the fastest method to confirm whether a sending domain has DKIM configured correctly.

  1. Send a test email from the domain you want to verify to a personal Gmail account (@gmail.com).
  2. Open the email in the Gmail web interface.
  3. Click the three-dot menu (More) in the top-right corner of the message.
  4. Select "Show original" from the dropdown. This opens a new tab with the full message headers.
  5. Look at the summary section at the top. Gmail displays SPF, DKIM, and DMARC results in a clean table format.
  6. Confirm DKIM shows "PASS" with the correct signing domain.

In the raw headers below the summary, look for the Authentication-Results header. A passing result looks like this:

Authentication-Results: mx.google.com;
       dkim=pass [email protected] header.s=google header.b=abc12DEf;
       spf=pass (google.com: domain of [email protected] designates
           209.85.220.41 as permitted sender);
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=example.com

The key fields to check are dkim=pass, the header.i= (signing identity which should match your domain), and header.s= (the selector used). If you see dkim=fail or dkim=none, your DKIM configuration needs attention.

Quick Check Without Raw Headers

In the Gmail web interface, you can also click the small arrow next to "to me" below the sender name. This shows a simplified view including "Signed-by:" which displays the DKIM signing domain. If this field matches your From domain, DKIM is likely working correctly.

Check DKIM in Outlook Headers

Microsoft Outlook also allows you to inspect message headers, though the process differs between Outlook on the web (OWA) and the desktop application.

Outlook on the Web (OWA)

  1. Open the email message you want to inspect.
  2. Click the three-dot menu (More actions) in the top-right corner of the message.
  3. Select "View" > "View message source" or "View message details" depending on your version.
  4. Search for Authentication-Results in the header text.
  5. Look for dkim=pass or dkim=fail in the result.

Outlook Desktop (Windows)

  1. Open the email message in its own window (double-click it).
  2. Go to File > Properties.
  3. In the Properties dialog, look at the "Internet headers" text box at the bottom.
  4. Search for the Authentication-Results header within the text.
  5. Verify the DKIM result shows pass.

The Authentication-Results header in Outlook follows the same format as Gmail. Look for dkim=pass along with the signing domain and selector information. Microsoft 365 uses selectors named selector1 and selector2 by default for domains hosted on their platform.

Check DKIM Using MXToolbox

MXToolbox provides a web-based DKIM lookup tool that queries your DNS directly. This method verifies that your public key is published correctly without needing to send a test email.

  1. Navigate to mxtoolbox.com/dkim.aspx in your browser.
  2. Enter your domain name (e.g., example.com).
  3. Enter your DKIM selector (e.g., "google", "selector1", or your custom selector).
  4. Click "DKIM Lookup".
  5. Review the results. The tool queries selector._domainkey.yourdomain.com and displays the public key record, key length, and any errors.

A successful lookup shows the full public key value, the key type (typically RSA), and the key length. MXToolbox will flag common issues such as missing records, syntax errors, or keys shorter than the recommended 2048 bits.

Finding Your DKIM Selector

If you do not know your selector, use one of these approaches:

Common DKIM selectors by provider:

Email ProviderDefault Selector(s)
Google Workspacegoogle
Microsoft 365selector1, selector2
Amazon SESVaries by region and configuration date
Mailchimpk1
SendGrids1, s2
PostmarkVaries (check account settings)

Check DKIM Using Command Line (dig / nslookup)

For administrators and developers who prefer the command line, you can query your DKIM DNS record directly using dig (Linux/macOS) or nslookup (Windows).

Using dig (Linux / macOS)

dig TXT selector._domainkey.example.com +short

Replace selector with your actual DKIM selector and example.com with your domain. A successful response returns the TXT record containing your public key:

"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC..."

If the command returns no output, the DNS record does not exist for that selector and domain combination.

Using nslookup (Windows)

nslookup -type=TXT selector._domainkey.example.com

The output will include the TXT record contents if the DKIM record exists. On Windows, you can also use PowerShell:

Resolve-DnsName -Name "selector._domainkey.example.com" -Type TXT

Validating the DNS Record

When you retrieve your DKIM DNS record, verify the following:

Understanding DKIM Signatures

Every DKIM-signed email includes a DKIM-Signature header that contains all the information a receiving server needs to verify the message. Understanding these fields helps you diagnose problems when DKIM verification fails.

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=example.com; s=google;
        h=from:to:subject:date:message-id:mime-version;
        bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=;
        b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk2pFSSNEA...

Here is what each field means:

FieldNameDescription
v=1VersionDKIM version. Always set to 1 in the current specification.
a=rsa-sha256AlgorithmThe cryptographic algorithm used to generate the signature. RSA-SHA256 is the standard; Ed25519-SHA256 is an emerging alternative.
c=relaxed/relaxedCanonicalizationHow the header and body are normalized before signing. The first value applies to headers, the second to the body. "relaxed" is tolerant of whitespace changes; "simple" requires exact matches.
d=example.comSigning DomainThe domain claiming responsibility for the message. This value is critical for DMARC alignment.
s=googleSelectorUsed to locate the public key in DNS at selector._domainkey.domain.com.
h=from:to:...Signed HeadersThe list of headers included in the signature calculation. The "from" header must always be signed.
bh=...Body HashA hash of the canonicalized message body. The receiving server recalculates this to detect body modifications.
b=...SignatureThe actual cryptographic signature over the headers and body hash. Verified using the public key from DNS.

The d= (signing domain) field is particularly important because it determines whether DKIM aligns with DMARC. If your From header shows [email protected] but the DKIM signature uses d=esp-provider.com, DKIM will pass but will not align for DMARC purposes.

Understanding DKIM Verification Results

When a receiving mail server checks DKIM, it produces one of several result codes. Knowing what each means helps you diagnose issues quickly.

dkim=pass

The signature is valid. The receiving server found the public key in DNS, the body hash matched, and the cryptographic signature verified successfully. No action is required.

dkim=fail

The signature is invalid. The public key was found but the signature did not verify. Common causes include message modification after signing, a mismatched key pair, or a corrupted DNS record.

dkim=neutral or dkim=none

No DKIM signature was found on the message. This means your mail server is not signing outgoing emails, or the DKIM-Signature header was stripped in transit.

dkim=temperror

Temporary DNS lookup failure. The receiving server could not retrieve your public key due to a DNS timeout or transient network issue. This usually resolves itself, but persistent temperrors indicate DNS infrastructure problems.

dkim=permerror

Permanent error in the DKIM evaluation. This typically means the DNS record has syntax errors, the key format is invalid, or the record is otherwise unparseable. Check your DNS TXT record for formatting issues.

Common DKIM Failures and How to Fix Them

When DKIM verification fails, the cause almost always falls into one of these categories. Work through each systematically when debugging.

Selector Misconfiguration

The most frequent issue is a mismatch between the selector your mail server uses to sign messages and the selector where your DNS record is published. For example, if your server signs with s=selector1 but your DNS record is published at google._domainkey.example.com, the receiving server will look up the wrong location and fail to find the key.

Fix: Check the s= value in your DKIM-Signature header and verify that a matching TXT record exists at s-value._domainkey.yourdomain.com. Make sure the selector matches exactly, including case.

Body Hash Mismatch

A body hash mismatch (bh= does not match the recalculated hash) means the message body was altered after signing. This is one of the most common DKIM failures in practice.

Common causes:

Fix: Identify which system in your mail flow is modifying the message after DKIM signing occurs. Reconfigure your sending pipeline so that DKIM signing happens last, after all content modifications are complete.

DNS Record Errors

DNS record problems prevent receiving servers from retrieving your public key entirely. Common DNS issues include:

Fix: Use dig or MXToolbox to verify the exact contents of your DNS record. Compare it against what your email provider expects. Ensure the full public key is present and the record is syntactically valid.

Key Pair Mismatch

If the private key used for signing does not correspond to the public key in DNS, every signature will fail. This can happen after a key rotation if the DNS record was updated but the mail server was not, or vice versa.

Fix: Regenerate the key pair through your email provider and update both the DNS record (public key) and the mail server configuration (private key) simultaneously. Use a new selector for the new key to avoid issues during the transition.

DKIM Key Rotation: Why and How Often

DKIM key rotation is the practice of periodically replacing your DKIM key pair with a new one. While DKIM keys do not expire in the traditional sense, rotating them limits the exposure window if a private key is ever compromised.

Why Rotate DKIM Keys

Recommended Rotation Schedule

Rotate your DKIM keys every six to twelve months under normal circumstances. Rotate immediately if you suspect any compromise. For high-security environments, quarterly rotation may be appropriate.

How to Rotate Without Downtime

  1. Generate a new key pair with a new selector name (e.g., switch from s=selector1 to s=selector2).
  2. Publish the new public key in DNS under the new selector.
  3. Wait for DNS propagation (24-48 hours).
  4. Update your mail server to sign with the new private key and new selector.
  5. Keep the old DNS record active for at least 7 days to allow in-flight messages to verify.
  6. Remove the old DNS record once the transition period is complete.

Test All Sending Sources

If you use multiple systems to send email (marketing platform, transactional service, CRM, helpdesk), each sending source needs its own DKIM configuration. Test DKIM from each one independently, as they may use different selectors and key pairs. A failure in one source can affect your overall DMARC reporting results.

DKIM Alignment for DMARC

DKIM on its own verifies message integrity, but for DMARC to pass, DKIM must also align with your From header domain. Alignment means the domain in the DKIM signature (d= value) matches the domain in the visible From header.

Relaxed Alignment (Default)

Relaxed alignment requires the DKIM signing domain to share the same organizational domain as the From header. This means subdomains are allowed to align:

Strict Alignment

Strict alignment requires an exact match between the DKIM signing domain and the From header domain. No subdomain variation is permitted:

Relaxed alignment is the default in DMARC and is sufficient for most organizations. Strict alignment provides stronger protection against subdomain spoofing but requires all sending services to sign with the exact From domain. The alignment mode is configured in your DMARC record using the adkim= tag (r for relaxed, s for strict).

Third-Party Sender Alignment

When using third-party email services (ESPs, marketing platforms, CRMs), make sure each service signs with your domain rather than their own default domain. If your ESP signs with d=esp-provider.com but your From address is [email protected], DKIM will pass but DMARC alignment will fail. Most providers support custom DKIM signing domains. Ensuring proper alignment is critical for meeting Gmail's sender requirements and Yahoo's authentication policies.

DKIM Verification Tools Compared

Several tools can help you verify DKIM configuration. The right choice depends on whether you need a quick DNS check, full message analysis, or ongoing monitoring.

Tool Free / Paid Features Best For
MXToolbox DKIM Lookup Free (basic) / Paid (monitoring) DNS record lookup, key validation, syntax checking Quick DNS record verification
Google Admin Toolbox Free DKIM, SPF, DMARC header analysis for Google-related setups Google Workspace administrators
mail-tester.com Free (limited) / Paid Full message analysis, deliverability scoring, authentication checks Comprehensive message testing
DKIM Validator (dkimvalidator.com) Free Send test email for full DKIM signature verification End-to-end signing verification
dig / nslookup (CLI) Free (built-in) Direct DNS TXT record queries, scriptable, no third-party dependency Administrators, scripting, automation
dmarcian DKIM Inspector Free (basic) / Paid (full platform) DNS record analysis, alignment testing, monitoring dashboards Ongoing DKIM and DMARC monitoring

For a thorough verification, use at least two methods: a DNS lookup tool (like MXToolbox or dig) to verify the public key is published, and a message-based test (like sending to Gmail and checking headers) to confirm your server is actively signing. DNS-only checks do not verify that signing is actually happening.

DKIM Verification Checklist

Use this checklist to confirm your DKIM setup is fully operational across all sending sources:

  1. Verify DNS record exists: Use MXToolbox or dig to confirm your public key is published at the correct selector._domainkey.domain.com location.
  2. Confirm key length is 2048-bit: Check that your RSA key is at least 2048 bits. 1024-bit keys are increasingly deprecated by major providers.
  3. Send a test email and check headers: Send to Gmail or Outlook and verify dkim=pass in the Authentication-Results header.
  4. Verify DMARC alignment: Confirm the d= domain in your DKIM signature matches (or aligns with) your From header domain.
  5. Test all sending sources: Repeat the test from every system that sends email on behalf of your domain: primary ESP, transactional service, CRM, marketing platform, and helpdesk.
  6. Check SPF alongside DKIM: DMARC requires at least one of SPF or DKIM to pass with alignment. Verify both are configured correctly for redundancy.
  7. Monitor DMARC reports: Review your DMARC aggregate reports regularly to catch DKIM failures from any sending source you may have missed.

Compliance Across Major Providers

DKIM is now a mandatory requirement for bulk senders across Gmail, Yahoo, and Microsoft. Ensuring your DKIM signatures pass verification and align correctly for DMARC is essential to meet Gmail's sender requirements, Yahoo's email sender requirements, and Microsoft's bulk sender requirements.

Frequently Asked Questions

How do I find my DKIM selector?
Look in the DKIM-Signature header of any email you have sent. The selector is the s= value. Common selectors include "google" for Google Workspace, "selector1" or "selector2" for Microsoft 365, and custom selectors for services like Amazon SES or Mailchimp.
Why does DKIM pass sometimes but fail other times?
DKIM can fail intermittently when messages are modified after signing. Common causes include email forwarding services, mailing lists that add footers, security gateways that modify content, and antivirus scanners that alter message bodies. Each modification invalidates the original DKIM signature.
Can I have multiple DKIM keys for the same domain?
Yes, you can publish multiple DKIM keys using different selectors. This is common when you use multiple email services (such as Google Workspace and a marketing platform) or when you rotate keys. Each selector points to a separate public key in DNS.
What is the difference between DKIM and SPF?
SPF verifies that an email was sent from an authorized IP address for a domain, while DKIM verifies that the message content was not altered after sending by using a cryptographic signature. Both are required for DMARC compliance, and together they provide complementary layers of email authentication.
How often should I rotate my DKIM keys?
Industry best practice is to rotate DKIM keys every six to twelve months, or immediately if you suspect a key has been compromised. Use a new selector for each rotation so you can publish the new key before switching signing, ensuring zero downtime during the transition.
Does DKIM survive email forwarding?
DKIM can survive forwarding if the forwarding server does not modify the message body or signed headers. However, many forwarding services add footers, modify subject lines, or alter content, which breaks the DKIM signature. This is one reason ARC (Authenticated Received Chain) was developed as a complementary standard.

Related Articles

Ready to Improve Your Email Deliverability?

SortedIQ helps high-volume senders maximize inbox placement and sender reputation.

Talk to Our Team