Email is part of your public attack surface. Customers, employees, and suppliers see messages that appear to come from your domain, while receiving mail systems use DNS-published authentication records to help decide whether a sender is legitimate.
SPF, DKIM, and DMARC are three related controls that make domain impersonation harder and give domain owners useful feedback. They need careful setup: an overly strict policy can disrupt legitimate mail, while a monitoring-only policy does not ask receivers to reject unauthenticated messages.
This guide explains what each control does and how to roll them out in a way that fits a small or midsize organization. For a broader view of DNS and internet-facing assets, see my guide to External Attack Surface Management (EASM) and how to find and prevent subdomain takeover.
Why email domain authentication matters
An attacker can send a message that displays a familiar address or domain in the visible From field. Email authentication gives receiving systems signals they can use to check whether the sending infrastructure and message are authorized.
These controls help address direct domain spoofing. They do not stop every phishing attempt: lookalike domains, compromised mailboxes, and deceptive content still require other defenses. Treat authentication as one layer in an email security program.
SPF: identify authorized sending hosts
Sender Policy Framework (SPF) is a DNS policy that lists the hosts permitted to send mail for a domain. A receiving system can check the connecting sender against that policy.
Start by listing every service that sends mail using your domain: business email, support platforms, billing systems, marketing tools, website forms, and monitoring services. Ask each provider for its current SPF setup instructions, then consolidate the authorized sources into the domain's SPF record.
A domain should have one SPF record. Multiple records can cause evaluation problems. SPF also has a DNS lookup limit, so avoid blindly adding every provider's suggested text. Remove entries for services you no longer use, and retest after changes.
SPF authenticates the sending path; by itself, it does not guarantee that the visible From address is aligned with the authenticated domain. DMARC adds that alignment check.
DKIM: sign messages
DomainKeys Identified Mail (DKIM) lets a sending service attach a cryptographic signature to a message. The receiving system looks up the public key in DNS and checks whether the signed parts of the message still match.
Most hosted mail providers generate the DKIM keys and give you DNS records to publish. Enable signing for each legitimate sending service, verify the records, and confirm that messages are passing DKIM. Keep track of which provider owns each selector and follow its guidance when rotating keys or retiring a service.
DKIM can help preserve message integrity across forwarding in cases where SPF may fail, but it still needs to align with the visible From domain for DMARC to pass.
DMARC: set policy and receive reports
Domain-based Message Authentication, Reporting, and Conformance (DMARC) builds on SPF and DKIM. It checks whether at least one authentication result passes and aligns with the domain shown to the recipient. It also lets the domain owner publish a requested handling policy and receive reports from participating receivers.
A DMARC record is published in DNS under a name such as _dmarc.example.com. Common policy values are:
p=none: request no special handling; useful while collecting data and investigating senders.p=quarantine: ask receivers to treat failing messages as suspicious.p=reject: ask receivers to reject failing messages.
Receiver behavior can vary, so a published policy is a request under the protocol, not a guarantee of identical handling everywhere. The current DMARC specification is IETF RFC 9989. NIST's Trustworthy Email guidance also discusses SPF, DKIM, and DMARC as email authentication mechanisms.
A safe deployment sequence
1. Inventory every sender
Check mail provider consoles, vendor integrations, application settings, DNS records, and invoices. Record the service owner, sending domain, business purpose, SPF requirement, DKIM status, and a contact for changes. Include forgotten systems such as password-reset email, CRM campaigns, and website contact forms.
2. Configure SPF and DKIM with each provider
Use current provider documentation and account-specific values. Publish the required DNS records and verify them with the provider's own tools. Send test messages to mailboxes where you can inspect authentication results.
3. Publish DMARC in monitoring mode
Start with a monitoring policy and a report destination controlled by your organization or its chosen reporting provider. DMARC reports can contain operational details about sending sources, so decide who can access them and how long to retain them.
Review reports over a representative period. Identify legitimate services that fail SPF or DKIM alignment, then fix their configuration. Investigate unknown sources rather than assuming every failure is malicious; forwarding, third-party platforms, and configuration mistakes can produce failures.
4. Tighten policy in stages
After legitimate mail is consistently authenticating, move from monitoring toward quarantine and eventually reject if appropriate. Test important mail flows after each change. Keep a rollback plan and document who approved the DNS change.
5. Maintain the records
When adopting or retiring a mail provider, update DNS and the sender inventory together. Review SPF for obsolete entries, confirm DKIM keys remain current, and check DMARC reporting for unexpected changes. Domain records are part of the same asset lifecycle as subdomains and hosted services.
Common mistakes to avoid
- Publishing multiple SPF records for one domain.
- Copying vendor instructions without checking the domain's existing SPF record.
- Applying a strict DMARC policy before all legitimate senders are understood.
- Assuming a passing SPF result alone means DMARC alignment passes.
- Forgetting transactional or third-party senders.
- Treating DMARC as a complete phishing solution.
- Leaving old provider records in DNS after a service is retired.
Frequently asked questions
Does SPF stop someone from spoofing my domain?
SPF lets receivers check whether a sending host is authorized by the domain's policy. It is useful, but DMARC is needed to connect authentication results with the visible From domain and publish a handling policy.
Can a small business use DMARC?
Yes. Begin by identifying the services that send mail for the domain, configure SPF and DKIM with those providers, and monitor reports before tightening policy. The exact setup depends on your mail and DNS providers.
Will a DMARC reject policy block all phishing?
No. It asks receivers to reject messages that fail DMARC for your domain, but attackers can use lookalike domains, compromised accounts, or other tactics. Combine it with account security, reporting, filtering, and user awareness.
Key takeaways
- SPF lists authorized sending hosts; DKIM lets receivers verify a message signature; DMARC checks alignment, communicates a policy, and enables reporting.
- Inventory legitimate sending services before tightening policy.
- Monitor results and fix legitimate mail flows before moving to quarantine or reject.
- Keep email authentication records in your DNS and service retirement processes.
- These controls reduce some forms of domain spoofing but do not replace broader phishing defenses.