How to Set Up SPF, DKIM and DMARC (and Stop Email Going to Spam)

Set up SPF, DKIM and DMARC in plain English, with copy-paste DNS records, the mistakes that break them, and how to check your domain in seconds.

SPF, DKIM and DMARC Setup – Techono guide cover

Quick answer: Add three TXT records to your domain’s DNS. SPF lists the servers allowed to send your email. DKIM publishes a key so receivers can check your email was not changed. DMARC tells receivers what to do when a message fails. Start DMARC with p=none, read the reports for a few weeks, then move to p=quarantine.

Why this matters now

Big mailbox providers now check these records before they accept your email. Since February 2024, Gmail and Yahoo require bulk senders (more than 5,000 messages a day to Gmail) to use SPF, DKIM and DMARC. Microsoft started the same rules for Outlook.com, Hotmail and Live addresses on May 5, 2025.

Smaller senders are affected too. Google asks every sender to pass at least SPF or DKIM. That includes your contact form, password reset emails and WooCommerce receipts. If these land in spam, you lose messages from real customers.

Step 1: Add an SPF record

SPF is one TXT record at the root of your domain. It lists the servers and services that may send email as you@yourdomain.com.

Type: TXT
Host: @
Value: v=spf1 ip4:203.0.113.10 include:_spf.google.com ~all

Change it to match your setup:

  • ip4:203.0.113.10 is your web server’s IP address. Your website sends form emails from here.
  • include:_spf.google.com is for Google Workspace. Microsoft 365 uses include:spf.protection.outlook.com. Your newsletter service tells you its own include.
  • ~all means “anything else is suspicious”. It is the safe choice while you set things up.

Two rules people often break:

  • Only one SPF record. Two records starting with v=spf1 make SPF fail. Merge them into one.
  • No more than 10 DNS lookups. Every include, a, mx and redirect counts, including the ones inside each include. Over 10, SPF fails for everyone. Our Email Checker counts them for you.

Step 2: Turn on DKIM

DKIM adds a digital signature to each email. You do not write this record yourself. Your email provider creates the key and shows you the record to add.

  • cPanel: go to Email → Email Deliverability. It shows the DKIM record and can install it if cPanel runs your DNS. The selector is usually default.
  • Google Workspace: Admin console → Apps → Gmail → Authenticate email. The selector is usually google.
  • Microsoft 365: Defender portal → Email authentication → DKIM. It gives you two CNAME records.

The record lives at selector._domainkey.yourdomain.com. Use a 2048-bit key if you can choose.

Step 3: Add a DMARC record

DMARC ties SPF and DKIM to the address people see in the From line. It also asks receivers to send you reports.

Type: TXT
Host: _dmarc
Value: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
  • p=none only watches. Nothing is blocked yet.
  • rua= is where daily reports go. Use a mailbox you check, or a free DMARC report service.

After two to four weeks, read the reports. When all your real email passes, change to p=quarantine (failing mail goes to spam). Later you can use p=reject (failing mail is refused). This stops other people from sending fake email in your name.

What “alignment” means

DMARC passes only when SPF or DKIM passes for the same domain as the From address. If your newsletter tool signs with its own domain, DMARC can still fail. Most services let you set up “custom domain authentication” to fix this.

Common problems and fixes

  • Website emails go to spam. WordPress sends from your server. Add the server IP to SPF, or send through your mailbox with an SMTP plugin.
  • Forwarded email fails SPF. This is normal. DKIM survives forwarding, so make sure DKIM is on.
  • “Too many DNS lookups”. Remove services you no longer use, or replace an include with the IP addresses it covers.
  • Changes do not show. DNS can take up to the record’s TTL to update, often one hour.

Check it with our free tools: Email Checker (SPF, DKIM, DMARC) · DNS Lookup

Sources

Jonathan

More from the SimpliCloud Blog

DNS Records Explained: A, CNAME, MX, TXT and More

DNS Records Explained: A, CNAME, MX, TXT and More

What each DNS record does in plain English, real examples you can copy, and the rules that cause most DNS mistakes.

How to Set Up SPF, DKIM and DMARC (and Stop Email Going to Spam)

How to Set Up SPF, DKIM and DMARC (and Stop Email Going to Spam)

Set up SPF, DKIM and DMARC in plain English, with copy-paste DNS records, the mistakes that break them, and how to check your domain in seconds.

Need a Tool We Don’t Have?

Tell us what you check on your sites every week. The most-requested tools get built first.