SPF, DKIM, and DMARC Setup Guide: Secure Website Email and Troubleshoot Delivery Problems
SPFDKIMDMARCemail securityDNSemail deliverability

SPF, DKIM, and DMARC Setup Guide: Secure Website Email and Troubleshoot Delivery Problems

wwebs.page Editorial Team
2026-11-18
7 min read

A practical SPF, DKIM, and DMARC setup checklist covering DNS records, alignment, forwarding failures, testing, and safe policy changes.

SPF, DKIM, and DMARC work together to help receiving mail systems verify that messages claiming to come from your domain are authorized. This reusable setup checklist explains what each record does, how to publish the DNS records, how to test alignment, and how to troubleshoot forwarding, failed authentication, spoofing, and quarantine reports.

Overview

Email authentication is configured in DNS, but the records describe different parts of the sending process. SPF identifies the servers or services permitted to send mail for your domain. DKIM adds a cryptographic signature to outgoing messages so the receiving system can verify that the message was signed by an authorized service and was not altered in transit. DMARC tells receiving systems how to evaluate SPF and DKIM together, whether the authenticated domain aligns with the visible From address, and where to send aggregate or forensic reports when supported.

These controls are related but not interchangeable. An SPF record does not sign messages, DKIM does not define a handling policy by itself, and DMARC cannot fix an incorrectly configured sending service. Begin by creating an inventory of every system that sends mail using your domain, including business inboxes, website forms, marketing platforms, support tools, billing systems, monitoring services, and application infrastructure.

Use a DNS management interface controlled by your domain or hosting provider. Before changing records, note the DNS provider, the authoritative nameservers, the current TTL values, and any existing TXT records. If DNS is managed separately from web hosting, make the changes in the DNS provider's dashboard rather than assuming the web host controls them. For background on verifying DNS changes, see the DNS propagation troubleshooting workflow.

Checklist by scenario

1. Set up SPF for all authorized senders

  1. List the services that send mail for the domain.
  2. Ask each provider for its current SPF include, authorized IP range, or other required DNS value. Do not copy a value from an unrelated domain or guess the provider's syntax.
  3. Create one SPF TXT record at the root of the domain, commonly represented by @ in a DNS control panel.
  4. Combine the authorized sources into that single record when possible. A domain should not be configured with several competing SPF policies.
  5. Finish with an SPF mechanism that reflects your intended policy, such as a neutral, soft-fail, or hard-fail setting recommended by your email administrator or provider.
  6. Save the record and verify that the published result contains every legitimate sender.

A representative SPF record might look like v=spf1 include:mail.example.net ip4:192.0.2.10 ~all. This is an example format only; replace the include and IP address with values supplied for your systems. Remove an old sender only after confirming that no active workflow depends on it.

2. Enable DKIM for each sending platform

  1. Open the sending provider's domain-authentication settings and add the domain you use in the visible From address.
  2. Record the selector name and the DNS record type the provider requests. DKIM is commonly published as a TXT record, although some platforms use a CNAME that points to provider-managed keys.
  3. Create the record at the selector hostname, such as selector1._domainkey, using the exact value supplied by the provider.
  4. Keep the key value intact. Line wrapping in a dashboard or documentation does not necessarily mean that spaces should be inserted into the DNS value.
  5. Return to the provider and select its verification or authentication check.
  6. Send a test message and inspect the authentication results in the receiving mailbox.

A simplified DKIM TXT example is selector1._domainkey.example.com TXT "v=DKIM1; k=rsa; p=PUBLIC_KEY". Do not invent a key or reuse a selector without checking the provider's instructions. If several services send mail, use the selectors assigned by those services and keep an inventory of them.

3. Publish DMARC in monitoring mode first

  1. Confirm that at least one legitimate sending service passes SPF or DKIM.
  2. Choose a mailbox or reporting service that can receive DMARC aggregate reports. Use a dedicated address if reports may become numerous.
  3. Create a TXT record at _dmarc on the domain.
  4. Start with a monitoring policy while you identify legitimate sources and correct failures.
  5. Specify the organizational or reporting addresses recommended by your mail administrator, and set alignment options only when you understand how they affect subdomains and third-party senders.
  6. Review reports, fix known senders, and then consider a stricter policy in stages.

A basic monitoring example is v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com. This example does not instruct receiving systems to quarantine or reject messages. A stricter policy should be introduced only after reports show that legitimate traffic is authenticating and aligning as intended. The exact syntax and available options should follow the documentation for the receiving and reporting systems you use.

Provider comparison checklist

Sending sourceRecords to requestVerification to perform
Business mailbox providerSPF authorization and DKIM selectorSend from a normal mailbox and inspect SPF, DKIM, and DMARC results
Marketing or newsletter platformSPF include, DKIM CNAME or TXT values, and any return-path guidanceVerify the authenticated domain and test a campaign or preview message
Website or applicationSMTP credentials, relay authorization, or approved sending IP detailsSubmit a form, trigger a notification, and check the received message headers
Support, billing, or monitoring toolDomain verification records and the provider's sending identity requirementsTrigger a real notification and confirm alignment with the visible From domain

What to double-check

Alignment, not just authentication

DMARC evaluates whether the domain authenticated by SPF or DKIM aligns with the domain shown in the message's From address. A message can pass an underlying SPF or DKIM check and still fail DMARC alignment if a different domain is used. When testing, inspect the full message headers and compare the visible From domain with the SPF domain and the DKIM signing domain.

Forwarding and mailing lists

Forwarded messages may no longer come from an SPF-authorized server, so forwarding can cause SPF failures. Message transformations by mailing lists can also affect DKIM. This is one reason to examine reports and real headers rather than treating a single failed test as proof that the original sender is misconfigured. Where appropriate, preserve DKIM signatures and use provider-supported forwarding or routing options.

DNS syntax and record location

Check that the record is published under the intended domain, selector, and record type. Avoid adding quotation marks unless the DNS interface requires them, and do not place a DKIM record at the root when the provider supplied a selector hostname. Confirm that there is only one effective SPF policy and that a DMARC record is located at _dmarc.example.com.

Website forms and application mail

Website forms should generally send through an authenticated mailbox or transactional relay rather than attempting to impersonate arbitrary visitor addresses. Use a controlled From address on your domain and place the visitor's address in Reply-To when the application supports it. After changing hosting, SMTP credentials, or form software, submit several test forms and check both delivery and authentication results.

Common mistakes

  • Publishing multiple SPF records: combine authorized mechanisms into one policy instead of adding a second v=spf1 TXT record.
  • Forgetting a sending service: audit application alerts, receipts, password resets, and low-volume automated mail, not only newsletters and employee mailboxes.
  • Copying DKIM values incorrectly: preserve the provider's selector and public key or CNAME target exactly.
  • Moving directly to a reject policy: monitor first and use reports to identify legitimate traffic before enforcement.
  • Ignoring subdomains: document whether services send from the root domain or a subdomain and confirm which DMARC policy applies.
  • Testing only the message body: inspect headers in the receiving mailbox; the body and the authentication result answer different questions.
  • Changing DNS and assuming it failed: allow for DNS caching and verify the published record from an independent lookup. The DNS propagation guide provides a practical verification workflow.

When to revisit

Review SPF, DKIM, and DMARC before seasonal planning cycles, after adding or removing a marketing or transactional provider, when changing web hosting or website forms, and whenever business email is migrated. Also revisit the records after a domain transfer, DNS provider change, application deployment, or security incident. Domain ownership and renewal controls matter here too; use the domain expiration prevention checklist to reduce the risk of losing control of the DNS zone.

Make the review routine: maintain a sender inventory, check DMARC reports on a defined schedule, remove retired services, rotate or retire DKIM selectors according to provider guidance, and record who approved each DNS change. Before enforcing a stricter DMARC policy, test every important mail path, including forwarding and website-generated messages. After the change, monitor delivery and authentication results, then document the final records so the next hosting, DNS, or email-platform change starts with an accurate baseline.

Related Topics

#SPF#DKIM#DMARC#email security#DNS#email deliverability
w

webs.page Editorial Team

Technical Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.