The invoice that looked real
On Monday morning, Maya, a security analyst at fictional Northstar Retail, receives a report from the finance team. A message appears to come from the company’s finance director and asks an employee to review an updated supplier bank account. The name, signature, and logo look familiar. The message is suspicious, but the team cannot decide what happened just by looking at the display name.
Maya separates three questions. Did the message arrive through a system authorised to send for the claimed domain? Was a signing domain able to place a verifiable signature on the message? And does the authenticated identity line up with the domain the recipient sees in the visible From address? SPF, DKIM, and DMARC answer related but different parts of that investigation.
Throughout this guide, names such as northstar.example and mailvendor.example are fictional documentation examples. The .example suffix is reserved for examples. Do not copy the illustrative DNS values into a real domain; use the exact records supplied by your own email provider and confirm them with the domain administrator.
First, understand the three domain identities
Email can expose several domain identities that look similar but are not interchangeable. The visible From address is the identity a recipient normally sees. SPF usually evaluates the envelope sender domain (often represented by the Return-Path after delivery) or the HELO identity in particular cases. DKIM verifies a signature that contains a signing domain in its d= value and a selector in its s= value.
This distinction explains why a message can pass SPF but still be deceptive: the authorised sending system may belong to a domain different from the one shown in the visible From address. DMARC adds an alignment check between the visible From domain and an authenticated SPF or DKIM identity.
Maya records the visible From address, the envelope-sender domain, the DKIM signing domain, and the authentication results reported by the receiving mail system. Keeping these fields separate prevents the team from assuming that any single “pass” means the message is trustworthy.
SPF: which systems may send for a domain?
Sender Policy Framework (SPF) lets a domain publish a DNS policy describing which sending hosts are authorised for the relevant envelope-sender identity. A receiving system can compare the connecting mail server with that policy. This is useful for controlling which infrastructure should send mail using the domain in scope.
An illustrative SPF TXT value might resemble v=spf1 include:mailvendor.example -all. It is only a teaching example: the real domain owner must use the exact mechanisms and values documented by each legitimate sender. The include mechanism refers to another domain’s SPF policy; it is not a general wildcard for trusting every system owned by a vendor.
SPF has practical constraints. A domain should not publish multiple independent SPF records for the same name. SPF processing also limits DNS-query-causing mechanisms and modifiers, so a long chain of includes can cause a permanent error. Third-party sending services, marketing platforms, ticketing tools, invoicing systems, and application mailers must be inventoried before a policy is tightened.
SPF authenticates a particular mail-sending identity; it does not encrypt the message, verify the human author, or guarantee that a permitted sender account has not been compromised. Forwarding can also complicate SPF results because the final mail server may differ from the original authorised sender.
DKIM: verify a message signature
DomainKeys Identified Mail (DKIM) lets a sending system attach a cryptographic signature to an email. The signature covers selected headers and the message body under defined canonicalisation rules. A receiver retrieves the corresponding public key from DNS and checks whether the signature verifies and whether the signed content remains consistent.
The signing domain is shown in the signature’s d= field, and the selector in s= helps locate a DNS name such as selector1._domainkey.northstar.example. The selector allows organisations to operate and rotate keys without using one fixed public-key name for every sending system. A real provider may generate selectors and DNS values automatically.
The public key belongs in DNS; the corresponding private key must remain under the control of the mail-sending service or organisation. Protect access to that key, follow the provider’s key-rotation process, and remove obsolete keys only after confirming that no active sender still relies on them.
A valid DKIM signature shows that the signed content verifies under a signing domain. It does not prove that the message is safe, that the account was not compromised, or that the visible From domain is aligned with the signing domain. Some forwarding or message modifications can affect verification, depending on what changed and what the signature covers.
DMARC: connect authentication to the visible From domain
Domain-based Message Authentication, Reporting, and Conformance (DMARC) uses SPF and DKIM results and checks whether at least one passing mechanism aligns with the domain in the visible From address. This is the key extra layer: a message should not pass DMARC merely because some unrelated domain was authorised to send it.
A DMARC policy is published in a TXT record at a name such as _dmarc.northstar.example. Its tags can specify the version, policy, reporting addresses, and alignment behaviour. The policy choices are commonly p=none for monitoring, p=quarantine to request suspicious messages be treated as spam or quarantined, and p=reject to request rejection. Receiver implementations and local policy still affect final handling.
An illustrative monitoring policy may look like v=DMARC1; p=none; rua=mailto:dmarc-reports@northstar.example. This is not a ready-to-use record. The organisation must configure a real reporting mailbox or approved reporting service and follow the provider’s instructions. Aggregate reports can contain operational metadata, so route them to a monitored destination with appropriate access and retention practices.
DMARC can pass when aligned SPF passes or when aligned DKIM passes; both do not have to pass for DMARC to pass. Conversely, SPF and DKIM can each pass for domains that do not align with the visible From domain, leading to a DMARC failure. Maya uses the three results together instead of treating them as synonyms.
How Maya investigates the suspicious invoice
Maya asks the mail administrator to review the message headers and the receiving system’s authentication results. She confirms the visible From domain, envelope sender, DKIM signing domain and selector, SPF result, DKIM result, DMARC result, and any alignment explanation supplied by the mail system. She does not rely only on the sender display name or a screenshot of the message.
The evidence shows that the message’s visible From domain is Northstar’s, but neither passing SPF nor passing DKIM is aligned with that domain. That supports a DMARC failure for the message. It does not, by itself, establish who sent it or whether an account was compromised; the team follows its normal incident-handling process to investigate the sending path and message content.
After containment, Maya checks Northstar’s legitimate email sources: staff mailboxes, invoices, password-reset messages, customer-support software, marketing campaigns, the CRM, cloud alerts, and applications that send receipts. A source that the team forgot to include in SPF or configure for DKIM might be legitimate but poorly authenticated. The safe response is to identify its owner and correct the configuration—not to assume every failure is malicious.
For the DNS background needed to locate these policies, continue with DNS Records Explained. To understand how a receiver can obtain DNS answers and why results may be cached, see DNS Fundamentals and Name Resolution.
A safe rollout: monitor before enforcing
Northstar does not move straight to a strict rejection policy. Maya uses a staged rollout, coordinated with the mail administrator and the teams that own the sending applications. First, they inventory every legitimate sender and verify who manages it. Then they configure DKIM and SPF according to each provider’s current instructions, checking for duplicate SPF records, excessive DNS lookups, stale includes, missing selectors, and unexpected DNS changes.
Next, they publish a DMARC monitoring policy and review aggregate reports over a period long enough to capture ordinary business cycles. They identify unknown sources, investigate legitimate sources that fail authentication, and confirm alignment for the visible From domain. They compare report data with mail logs and provider dashboards rather than assuming each source IP is malicious or that every report is complete.
Only after legitimate senders are understood and corrected does Northstar gradually move toward quarantine and, if appropriate, rejection. The team communicates changes, tests important mail flows, watches delivery failures, and keeps a rollback plan. The pace depends on the domain’s real mail ecosystem; there is no universal number of days that guarantees a safe policy change.
Subdomains and outsourced senders need deliberate treatment. Some senders use their own authenticated domains; others need alignment with the organisation’s visible From domain. A domain owner should review applicable DMARC policy inheritance and provider-specific setup rather than assume one DNS change protects every possible sender.
Common mistakes and misconceptions
- Publishing a second SPF record. Merge legitimate mechanisms into the single intended SPF policy for that name, following current SPF guidance.
- Copying a provider example blindly. Use the exact values supplied for your tenant and sending setup, not the fictional examples in this guide.
- Assuming SPF or DKIM pass means the email is safe. A permitted or signed message can still be phishing, spam, or sent from a compromised account.
- Enforcing DMARC before inventorying senders. Legitimate billing, marketing, CRM, or application messages may fail and be rejected if the rollout is rushed.
- Ignoring alignment. A pass for a third-party domain is not the same as authenticating the domain a recipient sees in From.
- Confusing authentication with encryption. SPF, DKIM, and DMARC do not encrypt message contents. Transport TLS and end-to-end encryption serve different purposes.
Good email authentication reduces opportunities for direct domain spoofing, but it is one part of layered email security. Continue using phishing reporting, multi-factor authentication, account monitoring, safe payment-change verification, and incident response.
A practical email-authentication checklist
- Inventory senders. Include employee mail, marketing, help desk, billing, CRM, cloud notifications, and application-generated email.
- Inspect current DNS. Record SPF, DKIM selector, and DMARC TXT values and who owns each configuration.
- Configure SPF carefully. Publish one valid policy for the right identity, check lookup limits, and remove only senders confirmed to be obsolete.
- Enable DKIM. Follow each sender’s instructions, publish the correct public key, protect the private key, and verify signing results.
- Start DMARC in monitoring mode. Configure a real aggregate-report destination and review results with the responsible mail administrator.
- Fix legitimate failures. Correct sender setup and alignment before increasing enforcement.
- Increase policy gradually. Test important mail flows, review delivery impact, document the change, and maintain a rollback path.
For help with DNS caching during an approved record change, read DNS Caching, TTL, and Propagation. For broader external asset inventory and authorized discovery, see Subdomain Enumeration for Defensive Asset Discovery.
What Northstar learned
Northstar’s incident began with a convincing-looking invoice, but the useful investigation did not stop at the display name. SPF helped assess authorisation for the relevant sending identity. DKIM checked a cryptographic message signature. DMARC connected those authentication results to the domain in the visible From address and provided policy and reporting options.
Maya also learned that correct configuration requires an inventory of legitimate mail sources, alignment checks, and a staged rollout. The three mechanisms are complementary signals, not a guarantee that every authenticated message is trustworthy. People, accounts, mail systems, and payment workflows still need their own controls.
Use your organisation’s actual DNS and email-provider documentation when changing records. This guide is educational and is not a substitute for validating the intended domain, sender configuration, and delivery impact with the responsible administrator.
KNOWLEDGE CHECK / DNS
What does DMARC check beyond SPF or DKIM authentication?
Consider the role of the record or component described in this guide, then reveal the explanation.
Show answer
DMARC checks whether a passing SPF or DKIM identity aligns with the domain in the visible From address, then applies the domain's published policy.
CONTINUE LEARNING
Continue learning on CyberSurfaceMap
- Domains, Subdomains, DNS, and IP Addresses ExplainedStart with the core concepts and how these components fit together.
- DNS Fundamentals and Name ResolutionFollow a browser request through the DNS hierarchy and recursive resolution.
- DNS Records ExplainedLearn how address, alias, email, delegation, and policy records differ.
- DNS Caching, TTL, and PropagationUnderstand cached answers, record changes, and practical troubleshooting.
- What Is an External Attack Surface?Connect DNS findings to broader external asset inventory and risk assessment.
- External Attack Surface Assessment MethodologyUnderstand the platform's public DNS, passive subdomain, HTTP-header, and TLS checks and their limitations.
- Subdomain Enumeration for Defensive Asset DiscoveryFind and validate the subdomains associated with assets you own or are authorised to assess.
- SPF, DKIM, and DMARC ExplainedLearn how email authentication works and how to introduce policy safely.
Use DNS data only within an authorized scope. Names and records are clues to validate, not proof that a service is vulnerable.