Skip to content
Free website migration on every plan, done by our team.Learn more ›
Email

SPF, DKIM and DMARC: stop your emails landing in spam

What SPF, DKIM and DMARC records do, how they work together, example records and how to set them up step by step to improve email deliverability.

Short answer: SPF lists the servers allowed to send email for your domain, DKIM adds a cryptographic signature to each message, and DMARC tells receiving servers what to do when a message fails those checks. Together they prove your email is genuine, which keeps it out of spam and stops others from faking your domain. All three are DNS records you can add in a few minutes.

Email was designed decades ago with no way to prove who sent a message. Anyone could put your address in the "From" line. SPF, DKIM and DMARC fix that, and today the big providers expect every business domain to use them.

Why they matter now

Major email providers, including Gmail and Yahoo, now expect senders to authenticate their mail, and since 2024 bulk senders must use SPF, DKIM and DMARC. Without them, even ordinary business email is more likely to land in spam, and scammers can send convincing fake invoices "from" your domain to your customers.

How the three work together

RecordQuestion it answersWhere it lives
SPFIs this server allowed to send for this domain?A TXT record on your domain
DKIMWas this message really signed by this domain, and unchanged on the way?A TXT record at selector._domainkey.yourdomain
DMARCIf SPF or DKIM fails, what should the receiver do, and where should it send reports?A TXT record at _dmarc.yourdomain

DMARC also checks alignment: the domain in the visible "From" address must match the domain that passed SPF or DKIM. That is what stops look-alike spoofing.

SPF

A TXT record listing who may send mail for your domain. Example:

v=spf1 a mx include:yourprovider.example ~all

  • a and mx allow your website server and mail servers.
  • include: adds a service, such as Google Workspace, Microsoft 365 or your newsletter tool.
  • ~all (soft fail) tells receivers to treat other senders with suspicion; -all (hard fail) is stricter.

Rules to remember:

  • Only one SPF record per domain. Combine every source into one line. Two records break both.
  • Include every service that sends as you, such as your host, your shop and your newsletter tool.
  • Stay within 10 DNS lookups. Each include: counts. Too many and SPF fails.

DKIM

Your mail server signs each message with a private key, and a DNS TXT record publishes the matching public key. Receivers check the signature, which proves the message came from your domain and wasn't altered. cPanel can enable DKIM for your domain with a click; Google Workspace and Microsoft 365 give you their own DKIM records to add.

DMARC

A TXT record at _dmarc.yourdomain that sets your policy and where reports go. Start gently:

v=DMARC1; p=none; rua=mailto:dmarc@yourbusiness.com

PolicyWhat happens to failing mailWhen to use
p=noneDelivered normally; you get reportsThe first few weeks, while you check reports
p=quarantineSent to spamOnce all your legitimate mail passes
p=rejectRefusedFull protection against spoofing

Once reports show everything legitimate passes, move to p=quarantine and later p=reject. Our guide to reading DMARC reports shows how to read them without a headache.

Setting it up step by step

  1. List every service that sends email for you: your hosting mailboxes, website forms, shop, invoicing app, newsletter tool and helpdesk.
  2. Enable SPF and DKIM in cPanel's Email Deliverability page, or follow your email provider's instructions.
  3. Add the other senders to SPF in the same single record, and enable DKIM in each of those services.
  4. Add a DMARC record with p=none and an address for reports.
  5. Check your records with our free DNS lookup, which warns when SPF or DMARC is missing.
  6. Send test messages to Gmail and Outlook, open the full headers and look for SPF, DKIM and DMARC: PASS.
  7. After a few weeks of clean reports, tighten DMARC to quarantine, then reject.

See DNS records explained and TXT records for where these records live.

Common mistakes

  • Two SPF records, or SPF added as the wrong record type.
  • Forgetting a service that sends invoices or newsletters, so its mail fails after DMARC is tightened.
  • Website contact forms sending "from" the visitor's address. See why emails go to spam.
  • Jumping straight to p=reject without reading reports.
  • Leaving the DMARC report address pointing to a mailbox nobody reads.

Frequently asked questions

Do I need all three?

Yes. Each covers a different weakness, and providers increasingly expect all three.

Will DMARC block my own emails?

Not with p=none, which only reports. Tighten the policy only after checking reports.

How do I test my setup?

Send a test message to a mail-testing service or check the full headers in Gmail ("Show original") for SPF: PASS, DKIM: PASS and DMARC: PASS.

I only use my domain for a website. Do I still need these?

Yes, a simple version. Publish v=spf1 -all and a DMARC record with p=reject, which tells the world your domain never sends email, so scammers can't use it.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.