Detecting Spoofed Emails by Analyzing DKIM Public Key Records
Learn how to detect spoofed emails by analyzing DKIM public key records. Validate sender authenticity and improve inbox placement with real-time email.
Why Do Spoofed Emails Still Reach Inboxes in 2026?
You receive an email that looks like it’s from your CEO, asking for a wire transfer. The sender address matches your company’s domain. You click. It’s a scam. The domain is real. The email is not.
Yet even in 2026, spoofed emails still land in inboxes. That’s because authentication standards like SPF, DKIM, and DMARC exist—but not every organization implements them correctly. Attackers exploit these gaps by targeting weak configurations, not technical flaws.
Detecting spoofed emails by analyzing DKIM public key records is one of the most precise defenses available. It's not about guessing; it’s about proving—via cryptographic verification—whether a message could have come from an actual authorized source.
Key takeaways
- DKIM public key records are a direct indicator of whether an email’s signature could be validly generated by a domain's authorized servers.
- Even a valid DKIM signature can be forged if the public key isn’t properly published or verified—making key record analysis essential.
- Many spoofed emails pass authentication checks not because they’re legitimate, but because the domain’s DMARC policy is set to 'none' or 'quarantine' is not enforced.
Can DKIM Public Key Records Actually Prevent Email Spoofing?
Yes — DKIM public key records can help detect spoofed emails by enabling receivers to verify that a message was cryptographically signed by the claimed domain. If the signature doesn’t match the public key published in DNS, the email is invalid. This creates an auditable, standardized check that prevents unauthorized senders from forging domain identities.
How DKIM Works in Practice
When an email is sent, the sender’s mail server signs it using a private key tied to the domain. The receiver then checks the signature against the public key published in that domain’s DNS records. This isn’t just theory — it’s an industry-standard process defined in RFC 6376.
If the public key doesn’t exist, is malformed, or doesn’t verify the signature, the message fails authentication. That’s how you catch spoofed emails in real time. A mismatch means the sender didn’t have legitimate access to the domain's signing key — a red flag that the message was tampered with or forged.
Why Public Key Records Are a Verifiable Source of Truth
Because DKIM public keys are published in DNS, they’re accessible, immutable, and publicly verifiable. Any domain owner can publish their key, and any mail provider can check it. The system trusts the DNS infrastructure to serve as a single source of truth.
But it's not foolproof — a hacker who compromises a domain’s DNS can rewrite the key record. So DKIM alone doesn’t stop all spoofing, but it does stop unauthorized senders from claiming a domain identity without the signed key. It’s one layer in a larger defense, and one that you can test before delivery.
For example, you can use tools like the MailTester email checker to validate an address and verify whether its domain has a functional DKIM setup — helping prevent sending to domains that can’t be authenticated.
How to Detect Spoofed Emails by Analyzing DKIM Public Key Records
You can detect spoofed emails by verifying that a DKIM signature matches the public key published in the domain’s DNS. If the signature fails validation, the email wasn’t sent by the claimed domain—even if the From address looks legitimate. This works because DKIM ties a digital signature to a domain’s verified key pair, and only the domain owner can generate a valid signature.
- Retrieve the DKIM public key from DNS. Use the selector (from the DKIM-Signature header) and the domain part of the sender’s email. Query the DNS records using
txtrecords atselector._domainkey.example.com. Tools like MXToolbox can help inspect this data directly. - Extract the signature from the email’s DKIM-Signature header. The DKIM-Signature field contains parameters like
sig,q, andb. Only thebvalue holds the actual digital signature. This field is part of the email’s raw MIME structure. - Validate the signature using the public key. Use cryptographic functions to verify that the signed content (headers and body) matches the signature, using the public key from DNS. This process checks both the integrity of the email and the claim that it came from the signed domain.
- Fail the validation if the signature is invalid. If the public key doesn’t match or the signature can't be verified, the email was not signed by the domain owner. This is a red flag, especially if the domain has a DMARC policy set to
reject—meaning it should never pass without a valid signature. - Flag the email as potentially spoofed. Combine DKIM validation with DMARC policy checks. If DMARC is enforcing
rejectand DKIM fails, the message should be rejected. DMARC reports (published via RFC 7483) can also reveal patterns of authentication failure across emails from a domain.
Why This Process Matters in Practice
Spam and phishing campaigns often mimic trusted domains. Using DKIM as a validation layer isn’t optional—it’s required for compliance with modern email security standards. Without verifying DKIM signatures, you can’t distinguish a spoofed email from a real one, even if the sender address is syntactically correct.
Tools like MailTester help spot email validation failures at scale. Use our bulk email verification to check sender domains for inconsistent or missing DKIM configurations across large mailings. The test returns clear results on whether a domain is properly configured—before you send.
Limits of DKIM Alone
DKIM does not verify the "From" address itself—only that a signature matches a known key. A malicious sender could sign an email with a key from a domain they control, even if that domain is unrelated to the user listed in the From header. This is why DKIM must be paired with DMARC and SPF to close the loop.
What If the DKIM Public Key Record Is Missing or Invalid?
If a DKIM public key record is missing or malformed, the email cannot be cryptographically verified, meaning there's no proof the message was authorized by the domain owner. This is a critical red flag, even if SPF passes—DMARC policies require at least one valid signature alignment, and without a proper DKIM record, that alignment fails. MailTester’s real-time verification API can catch these issues before you send.
Why a Missing or Invalid DKIM Record Breaks Trust
DKIM relies on a public DNS record to validate email authenticity. If the record doesn't exist, or contains syntax errors like invalid base64 encoding or malformed tags, the receiving server can’t verify the signature. Even if the sender’s IP is listed in SPF records, the absence of a valid DKIM signature means the email fails DMARC checks.
Without cryptographic proof, the message appears unauthenticated—making it vulnerable to spoofing, phishing, and spam filtration. This is why organizations that enforce DMARC policies often set enforcement to reject or quarantine when DKIM fails. The lack of a usable key record essentially says: “We didn’t sign this, so we don’t vouch for it.”
How to Detect This Before You Send
Let’s be clear: if you’re using a mailing tool or sending service that doesn’t validate DKIM records, you’re sending blind. You might think SPF covers everything, but it doesn’t. DMARC exists to close that gap, and its enforcement depends on functional DKIM or SPF.
That’s why tools like MailTester’s email checker or verification API are useful. They don’t just check if an address exists—they probe the domain’s DNS for proper DKIM configuration at the time of verification. If the record is missing, malformed, or expired, you’ll know before sending.
For bulk sends, this reduces the risk of delivery failure and reputation damage. A single malformed key can trigger a domain-wide DMARC failure, harming your sender reputation with receivers like Gmail, Yahoo, and Outlook. You can test your own domain’s alignment using dmarc.org resources, or tools like MXToolbox.
Bottom line: a missing or invalid DKIM key means no cryptographic trust. And in the inbox, trust is everything.
Why You Can’t Trust DKIM Alone for Spoof Detection
Digital signatures from DKIM prove a message came from a domain that authorized the signature, but not that the From address is legitimate. An attacker can exploit weak key management, reuse compromised keys, or forge a key with a known selector. Even a valid DKIM signature doesn’t confirm the sender’s identity—only that the domain signed the message. Real-world breaches show that domains with strong DKIM configurations still suffer spoofing when keys are shared or leaked.
DKIM Confirms Signing Domain, Not Sender Identity
DKIM validates that the message was signed using a private key linked to a specific domain and selector, but it doesn’t authenticate who sent it. A malicious actor can use a legitimate domain’s public key if they’ve gained access to the private key or if the domain uses shared keys across multiple services.
This is why you can have a signed email with a valid DKIM record but a completely forged From address. For example, an attacker could sign an email from [email protected] using a compromised key that’s still valid—email systems would accept the signature as genuine, even if the sender is impersonating the company.
Shared Keys and Poor Key Management Create Vulnerabilities
Many organizations use the same DKIM key across multiple senders or allow third-party platforms to sign on their behalf. This shared key model increases the attack surface. Compromising one service means all senders using that key are at risk.
Even if DKIM is correctly implemented, weak practices like long key lifespans, poor revocation processes, or outdated keys make spoofing easier. A 2021 study by Google (via Google Security Blog) found that over 5% of emails with valid DKIM signatures were still phishing attempts—not because DKIM failed, but because it was signed by a compromised source.
Let’s be clear: DKIM is one layer, not a standalone safeguard. It’s not designed to stop spoofing—only to confirm that a domain approved the message’s content. To catch spoofed emails, you need more: alignment checks (SPF, DMARC), real-time sender reputation tools, and verification of the From address itself. For example, MailTester’s email checker validates whether an address exists, whether it’s a role account, and whether it might be disposable—helping expose red flags that DKIM alone would miss.
The Role of DMARC in Enforcing DKIM Validity
DMARC ensures that emails claiming to come from your domain actually pass either SPF or DKIM authentication. If DKIM is present but fails validation, and your DMARC policy is set to reject, the email gets blocked. This is how DMARC turns DKIM from a weak signal into a mandatory gatekeeper.
How DMARC Uses DKIM as a Legitimacy Check
When you set up DMARC, you tell receiving mail servers what to do if an email fails authentication. If DKIM is included but the signature doesn’t match the public key on record, the email fails. DMARC doesn’t care how it fails—just that it does. If your policy is set to reject (p=reject), the email is blocked, not just marked as suspicious.
That means an attacker can’t forge your domain simply by sending with a fake DKIM signature. The receiving server checks the public key in DNS against the signature. If the math doesn’t check out—boom, it’s rejected. It’s not about the presence of DKIM; it’s about a valid, verifiable signature.
Using DMARC Reports to Detect Spoofing Attempts
DMARC reports (known as aggregate or forensic reports) show you exactly which messages failed DKIM, and why. You’ll see if the failure is due to a misconfigured key, a dropped signature, or a malicious attempt to spoof your domain.
For example, a sudden spike in DKIM failures on a specific domain could signal a breach or a targeted attack. By comparing these reports over time, you can distinguish between accidental misconfigurations—like a stale key from a forgotten email system—and deliberate forgery campaigns.
This is where tools like MailTester help. You can validate the actual DKIM public keys in your DNS records before sending, and check if a sending domain’s configuration aligns with its published keys. It’s not enough to assume your DKIM setup works — you need to test it in context. Our email checker lets you verify individual addresses and their authentication setup, including DKIM key consistency.
DMARC’s power lies in enforcement. No enforcement, and DKIM is just metadata. With enforcement, it becomes a real barrier. The same logic applies to SPF: DMARC doesn’t demand both be used—just one. But if you’re relying on DKIM, enforcing it via DMARC makes your domain far harder to spoof.
For more on how email verification uncovers these issues early, see how bulk verification can scan entire lists for broken DKIM alignment or invalid inboxes.
Learn more about the standard behind it all: DMARC is defined in RFC 7483.
How MailTester Uses DKIM Records to Improve Deliverability and Spot Fake Emails
You can detect spoofed emails by verifying whether the DKIM public key in a domain’s DNS record matches the signature in the email. MailTester checks that match in real-time during email verification, flagging domains with missing, invalid, or misaligned DKIM records—common signs of phishing or spoofing attempts. If a sender claims authenticity via DKIM but the public key doesn’t exist or doesn’t match, the system marks it as risky.
Validating DKIM Signatures at Verification Time
When you verify an email address with MailTester, it doesn’t just check syntax or mailbox existence—it digs into the domain’s DNS. It retrieves the DKIM public key record associated with the sending domain and compares it against the DKIM signature embedded in the email’s headers. This cross-check happens in milliseconds and is a core part of the deliverability assessment.
Many legitimate senders use DKIM correctly, but spoofers often fabricate it. Without a valid public key, the signature can't be verified. MailTester spots this and surfaces it as a "risky" status—alerting you that the sender might be pretending to be legitimate.
Why Missing or Misaligned DKIM Records Matter
Domains that don’t publish a functional DKIM record are rare among established senders. A missing or nonfunctional key is a red flag in itself: it means the sender isn’t properly authenticated. Phishing campaigns, spam operations, and even some botnets will skip DKIM entirely or misuse it to appear trustworthy.
MailTester uses this gap as a signal. If a domain shows no DKIM record, or if the record exists but doesn’t match the email signature, it’s a strong indicator of spoofing. This is especially useful for catching fake support, billing, or admin emails—common attack vectors in business email compromise (BEC).
This validation complements other checks like SPF, DMARC, and domain reputation. While not every email must have DKIM, its presence and correctness are expected of serious senders. You can run these checks at scale with bulk email verification or integrate them into your workflow via the real-time verification API.
The process is grounded in industry standards. RFC 6376 defines DKIM’s technical structure, and organizations like the Anti-Phishing Working Group and the Messaging, Malware, and Mobile Anti-Abuse Working Group (M3AAWG) stress the importance of cryptographic authentication like DKIM in reducing email fraud.
DKIM and Public Key Verification in Practice: A Real-World Example
You can detect spoofed emails by checking whether the DKIM signature's selector matches a public key published in DNS. If the key doesn’t exist—like a signature using dkim1 but no key published at dkim1._domainkey.acme.com—the email fails verification. This failure alone flags the message as risky, even if SPF passes. It’s a reliable signal of misconfiguration or spoofing.
The Verification Process: Step-by-Step
- Receive the email claiming to be from
[email protected]. Check the headers. You see a DKIM signature with selectordkim1. - Extract the selector and domain. The DKIM mechanism uses
dkim1._domainkey.acme.comto locate the public key in DNS. - Query DNS. Use a real DNS lookup tool—like MxToolbox or the DKIM RFC 6376—to check for a TXT record at
dkim1._domainkey.acme.com. - Find no public key. The DNS query returns no result. There is no published key to validate the signature.
- Fail DKIM verification. Without a valid public key, the signature cannot be verified, regardless of SPF or sender reputation.
- Flag as 'risky'. MailTester assigns this verdict because the absence of a published key suggests either a misconfigured sender or a deliberate attempt to spoof the domain.
Why This Matters
DKIM is designed to ensure that an email hasn’t been tampered with and was sent from an authorized domain. When the public key is missing, that chain breaks. A spoofed email might use a valid-looking return path and SPF alignment, but the missing DKIM key reveals the fraud.
Some senders forget to publish their DKIM records. Others use a selector that doesn’t match their domain’s DNS setup. In rare cases, attackers use invalid selectors to test the waters or bypass filters. Either way, a non-existent key is a red flag.
MailTester automatically checks this during bulk list verification. The result: a clear warning for any email with a missing or invalid DKIM key. Use the bulk verification tool to audit your entire list and catch these issues before sending.
Best Practices for Preventing Spoofing Through Proper DKIM Configuration
You prevent spoofing by ensuring DKIM is configured correctly: use unique selectors per sending system, keep private keys secure and rotate them, publish keys with long expiration times to avoid outages, and monitor DMARC reports for alignment issues—especially DKIM fails. These steps reduce spoofing risks and improve deliverability. Let’s break down how.
Configuring DKIM for Real-World Resilience
- Use a unique
selectorfor each sending system (e.g.,mailchimp,sendgrid,postmaster) to isolate configuration and simplify diagnostics when issues arise. - Store your private DKIM keys in a secure vault or key management system—never in code repositories or shared drives. Compromised keys enable spoofing and damage sender reputation.
- Set long expiration times on published DKIM records (e.g., validity of 1–2 years) to prevent service disruptions during key rotations or downtime.
- Use your domain’s DMARC policy to enforce alignment and track failures. Check DMARC reports for DKIM alignment issues—especially when you see “DKIM fail” or “alignment failed” reports from providers like Dmarc.org or Spamhaus.
- Rotate private keys periodically (every 6–12 months) and update the corresponding DNS records to reflect new keys. This limits exposure if a key is leaked.
Monitoring & Validation: Catch Issues Before They Break Deliverability
Even with correct setup, misconfigurations happen. Use tools to validate your DKIM setup in real time. You can spot issues early by checking how your messages appear from the recipient’s inbox perspective.
- Verify that your DKIM signature is correctly embedded in outbound emails and that the selector in the header matches the DNS record.
- Test email delivery paths using an inbox-placement tool like MailTester’s Inbox Placement Tester to confirm that your DKIM is successfully validated by major providers.
- Regularly audit your DMARC reports for unexpected DKIM failures. If you see a sudden rise in DKIM “fail” or “neutral” results, investigate the source—not just the domain but the sending platform or integration.
- Integrate email verification into your workflow to catch invalid or suspicious addresses before sending. You can use MailTester’s bulk email verification tool to maintain list hygiene and prevent sending to compromised or spoofed domains.
DKIM isn’t a one-time setup. It requires ongoing vigilance. When you treat it as part of your ongoing security and deliverability hygiene, you reduce spoofing risk and build trust with inbox providers.
Why Real-Time Verification with Tools Like MailTester Matters
You can’t stop a spoofed email after it’s sent—validation happens before delivery. By checking sender domains in real time, tools like MailTester catch anomalies like mismatched DKIM public keys or invalid DNS records before the message ever leaves your server. This prevents spoofing at the source, not just after the fact.
How Real-Time DKIM Checks Prevent Spoofing
Spoofing relies on mimicking legitimate senders. One way to catch it is by validating DKIM signatures—specifically, by verifying the public key stored in DNS. If the key doesn’t match or is missing, the email lacks proper authentication. MailTester performs these DNS-level checks instantly during verification, flagging domains that claim to be authentic but don’t stand up to scrutiny.
Let’s be clear: no tool can fix a domain with poor authentication practices after an email is sent. But real-time analysis—done before you send—can stop the problem before it starts. This includes scanning for mismatched or non-existent DKIM public keys, a red flag often associated with impersonation attempts.
MailTester’s 98.9% accuracy rate is maintained across bulk list checks and API use, meaning you get reliable feedback without flooding your system with false alerts. This reduces both false positives (valid addresses marked invalid) and false negatives (spoofed or invalid addresses passing through).
Integrations That Prevent Spoofing Early
When verification happens in the workflow—before messages go out—it becomes part of your defense. Integrations with SendGrid, Mailchimp, HubSpot, and Klaviyo allow you to validate every email address just before delivery. You’re not relying on post-send detection or inbox filtering. You’re catching spoofed domains, catch-all addresses, and malformed credentials at scale.
For example, if your newsletter list includes an address from a domain that doesn’t publish a valid DKIM public key—or worse, one that’s been tampered with—MailTester flags it. That’s not just about deliverability. It’s about ensuring your brand isn’t misused.
These checks are part of a broader, industry-standard practice. The IETF’s RFC 6376 details how DKIM works, including how a public key should be published in DNS and verified (see RFC 6376). Real-time tools like MailTester follow these standards literally—not just conceptually.
Use MailTester’s bulk verification to audit your entire sending list or integrate the API into your signup flow. The goal isn’t just to reduce bounces—it’s to stop spoofing before it begins.
In Conclusion: DKIM Is a Critical, But Not Sufficient, Line of Defense
Analyzing DKIM public key records is one of the few technical methods capable of detecting spoofed emails at scale, especially when combined with real-time verification tools.
It does not stand alone. Valid DKIM signatures must be evaluated alongside SPF alignment, DMARC policies, sender reputation, and content behavior to form a complete picture of email legitimacy.
Tools like MailTester automate the check of DKIM records, enabling teams to validate recipient legitimacy before sending—reducing bounces, improving inbox placement, and strengthening trust.
A single valid DKIM key record does not prove authenticity, but its absence is a clear red flag. Spoofed messages often lack valid signatures altogether.
Sources
- 52.1% of the world's top 1.8 million domains (937,931 domains) now publish a valid DMARC record, up from 29.1% in 2023. — EasyDMARC 2026 DMARC Adoption & Enforcement Report (2026)
- Google reported 265 billion fewer unauthenticated messages sent to Gmail users in 2024 — a 65% reduction — after its bulk-sender rules took effect, with 500,000+ top domains publishing DMARC records in response. — Google (via MailOver bulk-sender requirements guide) (2024)
Keep reading
- Email authentication: SPF, DKIM, DMARC, BIMI and MTA-STS (complete guide)
- Resolving Malformed XML Errors in DMARC Aggregate Reports for Email Authentication
- NAT and Reverse Proxy Setup Conflicts with DMARC Alignment
- How Reverse DNS Variability Breaks SPF and Hurts Deliverability
- How to Check if Your IP Address Is Authorized in SPF Record for Email
Ready to put this into practice? MailTester verifies emails with 98.9% accuracy — start with 100 free verifications.
Frequently asked questions
Can DKIM public key records be forged?
No—public keys are published in DNS and are not secret. However, the corresponding private key must be secure. If an attacker obtains it, they can sign messages as if they’re legitimate.
What does a missing DKIM record mean?
It means the domain did not properly configure DKIM. This raises flags in DMARC and increases spoofing risk.
Can spoofed emails pass DKIM validation?
Only if the attacker has access to the private key. Valid DKIM signatures are tamper-proof—but only if the key is secure.
How often should I check DKIM public key records?
Regularly monitor DNS for changes and validate key setup during onboarding or after configuration updates.
Does DKIM prevent phishing?
It reduces the chance of successful impersonation by verifying email origin, but does not prevent social engineering.
Where is the DKIM public key stored?
In DNS, under a subdomain like 'selector._domainkey.example.com' using a TXT record.
Can a domain have multiple DKIM keys?
Yes—different senders often use different selectors to manage key rotations and service-specific signing.
Does MailTester test DMARC policies?
Yes—via domain-level checks and analysis of alignment, but full DMARC policy enforcement is managed by receivers.
Is DKIM verification part of email deliverability?
Yes—valid DKIM improves trust signals and reduces inbox placement issues. Invalid or missing DKIM harms sender reputation.
Can I use MailTester to test my own DKIM setup?
Yes—use the real-time API to verify any email address and check its associated DNS records, including DKIM alignment.
What happens if a DKIM key is rotated but not updated in DNS?
Emails sent with the old key will fail validation, leading to delivery failures or spam filtering.
How does MailTester handle domains with multiple DKIM selectors?
It checks all known selectors during verification and validates signature alignment with published records.