SPF, DKIM, and DMARC are DNS-based controls that help business domains prove which systems may send email and how receiving providers should handle messages that fail authentication. This guide explains what each record does, how to set it up, which values to request from your email providers, and how to maintain the configuration when systems or vendors change.
Overview
Email authentication is a domain management task as much as an email task. The records live in the DNS zone for your domain, so an incomplete DNS change, an old provider record, or an overlooked marketing platform can affect legitimate delivery and leave the domain open to spoofing.
The three controls have different jobs:
| Record | What it proves or controls | Where it is published | Typical maintenance task |
|---|---|---|---|
| SPF | Lists servers and services authorized to send mail for the domain | DNS as a TXT record at the domain or subdomain | Keep every approved sender in one valid SPF record |
| DKIM | Uses a cryptographic signature to associate a message with a sending domain | DNS as a TXT or provider-directed record at a selector host | Publish the selector and rotate keys when the provider requires it |
| DMARC | Defines how receivers should evaluate alignment and handle authentication failures | DNS as a TXT record at _dmarc | Review reports, then adjust the policy as confidence improves |
These records work together but do not replace one another. SPF validates the sending path, DKIM validates a signed message, and DMARC checks whether an authenticated result aligns with the visible From domain. A message can pass SPF or DKIM and still fail DMARC if the authenticated domain does not align with the domain recipients see.
Before editing DNS, create an inventory of every service that sends mail using your domain. Include employee mailboxes, contact forms, transactional applications, customer relationship systems, billing tools, support platforms, newsletters, recruiting tools, and website plugins. For each sender, record the provider, sending domain, setup instructions, owner, and whether it sends from the main domain or a subdomain.
For broader DNS context, see DNS Records Explained: A Practical Guide to A, AAAA, CNAME, MX, TXT, and CAA Records.
Checklist by scenario
1. Setting up SPF for business email
- Confirm which provider sends normal mailbox email for your users.
- Copy the provider's current SPF include or authorization value from its administration console.
- Open the authoritative DNS provider for the domain and add a TXT record at the root, often represented by
@. - Use a value similar to
v=spf1 include:mail.example-provider.test -all, replacing the placeholder with the exact value supplied by your provider. - Add the authorization mechanisms for every legitimate sender, using the syntax each provider documents.
- Check that only one SPF TXT record exists for the same domain. Combine authorized mechanisms into one record instead of publishing separate SPF records.
- Test mail from each important sending system and confirm the receiving message shows the expected SPF result.
Do not copy an SPF example unchanged into production. Provider-specific include domains, IP addresses, and recommended failure handling can change. The DNS host field also varies by control panel: the root may be shown as @, the full domain, or a blank field.
2. Enabling DKIM with an email provider
- Open the provider's domain authentication or email security settings and generate a DKIM key.
- Note the selector, which is the label identifying the key. It may look like
selector1or be a provider-generated string. - Create the DNS record exactly as instructed. A typical host is
selector1._domainkey, and the value may resemblev=DKIM1; k=rsa; p=PUBLIC_KEY supplied by the provider. - If the provider requests a CNAME instead of a TXT record, use the CNAME target exactly as provided. Do not convert one record type into the other.
- Wait for the provider to detect the record, then enable signing in the provider dashboard if that is a separate step.
- Send a test message and inspect its authentication results or the provider's verification status.
The private DKIM key should remain inside the sending provider or application. Only the public key belongs in DNS. If a provider uses multiple selectors, publish each requested record and retain a change record showing which service owns each selector.
3. Introducing DMARC safely
- Start with a reporting address controlled by your organization. A basic reporting record may look like
v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com. - Publish it as a TXT record at
_dmarcfor the domain. In many DNS panels, the host field is_dmarc, not the complete domain name. - Allow time to collect reports and compare the reported sources with your sender inventory.
- Investigate legitimate sources that fail SPF, DKIM, or alignment. Update the relevant provider configuration rather than adding unknown senders automatically.
- After testing, consider moving to a stricter policy such as quarantine or reject when your organization is confident that important senders authenticate correctly.
The p=none setting is useful for observation because it requests reporting without asking receivers to block or quarantine failures. A stricter policy should be introduced deliberately, especially when the domain supports invoices, password resets, support replies, or other operational email.
4. Adding a new sender or changing providers
- Assign an owner for the new service before it goes live.
- Ask whether the service supports DKIM signing with your visible From domain.
- Record the exact SPF, DKIM, and any custom return-path or tracking-domain instructions.
- Update DNS during a planned change window and test both ordinary and automated messages.
- Keep the old sender documented until its traffic has stopped, then remove obsolete SPF entries and DKIM records according to the provider's offboarding guidance.
- Review DMARC reports after the change for unexpected sources or alignment failures.
What to double-check
Alignment, not just authentication
DMARC alignment compares the authenticated domain with the domain in the visible From address. For SPF, the return-path or envelope-from domain must align according to the configured mode. For DKIM, the domain in the signature's d= value must align with the From domain. A provider can report that SPF or DKIM passed while DMARC still fails because the domains do not match closely enough.
Ask each provider these questions before launch:
- Can it sign with the business domain rather than only its own domain?
- What domain appears in the visible From address?
- What domain is used for the return path?
- Does it require a custom tracking or bounce domain?
- Which selector and DNS record type does it use?
DNS syntax and record visibility
Check the record type, host name, value, and quotation handling. Most DNS systems accept TXT values without manually adding quotation marks, while some long DKIM keys are displayed in multiple quoted segments. Do not insert line breaks or spaces into a public key unless the DNS provider's instructions require them.
Use a DNS lookup tool or propagation checker to confirm that public resolvers can see the record. A local control panel showing a saved record does not necessarily prove that the authoritative nameservers publish the intended value. If the domain recently moved between DNS hosting providers, verify which nameservers are authoritative before making changes. The DNS Propagation Explained guide covers practical checks for DNS changes and delays.
Reporting and data handling
DMARC aggregate reports can reveal sending services, authentication results, and alignment patterns. Decide who reviews them, where they are stored, and how long the organization needs them for operational review. If reports are sent to a different domain, the receiving domain may need an additional authorization record. Follow the reporting service's current instructions rather than assuming every mailbox can receive or interpret aggregate reports.
Website and infrastructure changes
When a website, cloud host, contact form, or application is migrated, email behavior can change even if mailbox hosting remains the same. Include SPF, DKIM, DMARC, MX, and related DNS records in the migration plan. For a broader process, use the website hosting migration checklist alongside the email provider's instructions.
Common mistakes
- Publishing multiple SPF records: SPF is evaluated as a single policy for a domain. Consolidate authorized mechanisms into one record instead of creating one record per vendor.
- Authorizing every unknown sender: A DMARC report may show a source, but that does not make it legitimate. Confirm ownership and business need first.
- Copying a provider's full hostname into the wrong field: Some control panels append the domain automatically. Adding the domain twice creates a name that does not match the provider's instructions.
- Using a DKIM private key in DNS: DNS should contain only the public key. Treat private keys as confidential credentials.
- Moving directly to a strict DMARC policy: If an overlooked application sends legitimate mail, a sudden enforcement change can disrupt delivery. Observe, fix, test, and then tighten deliberately.
- Ignoring subdomains: A separate subdomain may send invoices, campaigns, or application notifications. Document its authentication policy and determine whether the organizational DMARC policy should apply.
- Forgetting non-mail DNS changes: A nameserver, hosting, or domain migration can remove authentication records even when the email provider has not changed.
- Testing only internal messages: Send test messages to more than one external mailbox or test environment where permitted, and inspect the complete authentication results.
When to revisit
Make email authentication part of normal business website operations rather than a one-time DNS task. Revisit the checklist before seasonal planning cycles, during annual domain and vendor reviews, and whenever workflows or tools change.
Run an additional review when the business:
- Changes its mailbox or web hosting provider.
- Adds a newsletter, support, billing, recruiting, or marketing platform.
- Moves a website contact form or application to new cloud hosting.
- Changes the visible From domain, return-path domain, or email subdomain.
- Receives spoofing complaints, unexpected DMARC failures, or unexplained delivery problems.
- Transfers domain management or DNS hosting to a new provider.
- Retires an application or vendor that previously sent email.
For each review, export or record the current SPF, DKIM, and DMARC values; compare them with the sender inventory; inspect recent authentication results; and assign owners to unresolved findings. Keep a dated change log so the next administrator can distinguish an intentional policy decision from an obsolete DNS entry.
A practical final checklist is: inventory senders, publish one correct SPF record, enable DKIM for each provider, start DMARC reporting, verify alignment, test real message paths, review reports, and tighten enforcement only after legitimate traffic is accounted for. This process protects the domain while reducing the risk that a routine provider or hosting change interrupts important business email.