SPF, DKIM, and DMARC are DNS-based controls that help receiving mail systems verify whether messages claiming to come from your domain are legitimate. This guide explains what each record does, provides practical DNS examples, outlines a safe setup sequence, and gives you a recurring audit routine for keeping website and business email authentication accurate.
Overview
Email authentication is configured in the DNS management area for your domain. SPF identifies the servers allowed to send mail, DKIM adds a cryptographic signature to outgoing messages, and DMARC tells receiving systems what to do when a message fails authentication.
| Standard | What it verifies | DNS record | Primary maintenance task |
|---|---|---|---|
| SPF | Whether the sending server is authorized for the domain | TXT at the root domain | Keep every legitimate sender in one valid SPF record |
| DKIM | Whether a message has a valid signature associated with the domain | TXT or CNAME at a provider-specific selector | Publish the provider’s key and rotate it when required |
| DMARC | Whether SPF or DKIM passes with domain alignment | TXT at _dmarc | Review reports and gradually apply an enforcement policy |
These controls work together but are not interchangeable. SPF alone does not sign messages, DKIM alone does not identify every authorized sending server, and DMARC depends on alignment between the visible From domain and an authenticated SPF or DKIM domain. Correct DNS syntax also matters: a misplaced record, duplicate SPF record, or incorrect DKIM selector can prevent authentication from passing.
For background on record types and DNS management, see DNS Records Explained: A, CNAME, MX, TXT, and More.
What to track
SPF authorization
Start by listing every service that sends mail using your domain. This may include a mailbox provider, website contact forms, a newsletter platform, a help desk, monitoring software, or an application running on a VPS. Your SPF record should authorize only the services that genuinely send mail.
A simplified SPF record might look like this:
Type: TXT
Name: @
Value: v=spf1 include:mail.example.net include:news.example.net -all
The provider-specific include: values above are placeholders. Copy the exact value supplied by each provider. Do not create separate SPF records for separate services; combine the mechanisms into one record. Also check for obsolete includes after a service is retired. If the combined record becomes too complex for DNS evaluation, ask the providers about their supported configuration rather than adding arbitrary entries.
DKIM signing
DKIM normally uses a selector, which is a label that identifies the signing key. A provider may ask you to publish a TXT record or a CNAME record such as:
Type: CNAME
Name: selector1._domainkey
Value: selector1-domainkey.mail.example.net
This is an illustrative pattern, not a universal hostname. Use the exact selector and destination shown in your mail provider’s administration console. Some providers display a long public key instead:
Type: TXT
Name: selector1._domainkey
Value: v=DKIM1; k=rsa; p=PUBLIC_KEY_SUPPLIED_BY_PROVIDER
Keep a record of active selectors and their purpose. If you use more than one sending service, each may have its own selector. Never replace an existing selector until you know which service uses it.
DMARC policy and reports
A monitoring-only DMARC record commonly starts like this:
Type: TXT
Name: _dmarc
Value: v=DMARC1; p=none; rua=mailto:[email protected]; adkim=s; aspf=s
The rua address receives aggregate reports where supported. Use a monitored mailbox or a reporting service that you trust, and confirm that it can handle report volume and privacy requirements. The strict alignment tags adkim=s and aspf=s are shown as an example; choose alignment settings deliberately and test them against your sending services.
Cadence and checkpoints
Configure authentication in this order: inventory senders, publish SPF, enable DKIM, add DMARC in monitoring mode, review reports, and then increase enforcement. Make DNS changes in the control panel used for the domain’s authoritative nameservers, not necessarily the panel where the website is hosted.
Provider-specific verification steps
- Mailbox provider: Open the provider’s domain authentication or admin area, copy its SPF guidance and DKIM selector, publish the requested records, then use the provider’s verification button. Send a test message and inspect its authentication results.
- Microsoft 365-style setup: The administration portal typically supplies two DKIM CNAME records or equivalent instructions. Enable DKIM only after both provider-supplied records resolve correctly, and confirm that the visible From domain is the intended custom domain rather than a fallback address.
- Google Workspace-style setup: The administrator console provides a DKIM selector and public key. Publish the TXT record at the exact selector hostname, allow DNS time to update, then start authentication from the console and test a message.
- Transactional or marketing provider: Add the provider’s SPF authorization and DKIM records, preferably using a custom return-path or sending subdomain when offered. Verify the domain in that provider’s dashboard before sending a campaign or application notification.
- Website or VPS mail: Confirm that the server has a stable sending identity and that its mail software signs with DKIM. A hosting migration, IP change, or application rewrite can change the actual sender, so recheck both SPF and DKIM after deployment.
Use DNS lookup tools, your provider’s verification screen, and the authentication-results headers of a test message. Testing should cover normal mailbox messages, website forms, password resets, and automated notifications—not just one manually sent email.
DMARC rollout template
- Monitor: Begin with
p=noneand collect aggregate reports for a representative period. - Investigate: Identify legitimate senders, unknown infrastructure, SPF failures, DKIM failures, and alignment failures.
- Correct: Add missing provider records, fix From-domain alignment, remove unused services, and update website or application mail settings.
- Quarantine gradually: If reports show that legitimate mail passes reliably, consider a staged
p=quarantinepolicy, optionally with a percentage setting where supported. - Enforce: After further review, consider
p=reject. Keep monitoring reports because new services and configuration changes can reintroduce failures.
How to interpret changes
A sudden rise in SPF failures often follows the launch of a new form tool, newsletter system, or hosting platform. A DKIM failure may indicate a missing selector, an altered message after signing, an expired key, or a provider setting that was disabled. A DMARC failure does not always mean spoofing: it can also result from legitimate mail being sent through an unlisted service or from a mismatch between the visible From address and the authenticated domain.
Separate legitimate failures from suspicious sources by checking the reporting source, sending IP or provider, message volume, and whether the domain or subdomain is recognized. Do not approve an unfamiliar sender solely because it appears in a report. Confirm ownership and business need first.
Keep an authentication inventory with the domain, sender, SPF mechanism, DKIM selector, DMARC status, owner, and last verification date. This makes DNS changes safer during a domain transfer, hosting migration, or email-provider change. For related continuity planning, review How to Transfer a Domain Without Losing Email or Website Access.
When to revisit
Review SPF, DKIM, and DMARC monthly while a new configuration is being stabilized, then move to a quarterly audit if reports remain consistent. Revisit immediately after changing mailbox providers, adding a marketing or transactional service, moving website email to new web hosting, changing DNS nameservers, rotating DKIM keys, or modifying the domain used in application notifications.
Use this recurring checklist:
- Confirm there is one valid SPF record and remove retired includes.
- Check that every active sending provider has a working DKIM selector.
- Review DMARC aggregate reports for new sources and alignment failures.
- Verify that website forms, password resets, and automated alerts still authenticate.
- Confirm that the DMARC reporting mailbox or service is receiving and processing reports.
- Record DNS changes, owners, selectors, and the next review date.
Authentication is not a one-time DNS task. Treat it as part of domain and email operations: document each sender, test after every material change, and move from monitoring to enforcement only when the reports support that decision. That routine helps protect legitimate website email while reducing avoidable delivery failures.