Guides › Hosting, domain & email › Email problems

Emails Going to Spam: SPF, DKIM and DMARC Explained and Set Up

Mail from your domain lands in spam or is rejected. Add correct SPF, DKIM and DMARC records and avoid the common mistakes.

Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
Email problem

Mailbox providers check three DNS records to decide whether mail from your domain is genuine. Since 2024 Gmail and Yahoo require them from anyone who sends mail in volume, and they help everyone.

Your serversends an emailSPF: is this server allowed?DKIM: is the signature valid?DMARC: what to do if they fail?ReceivingserverdecidesInboxSpam orrejected
The three checks a receiving mail server runs before it decides inbox, spam or reject.

SPF: who may send

An SPF record is a DNS TXT record on your domain listing the servers allowed to send. It looks like:

v=spf1 include:_spf.google.com ~all

Use the value your mail provider tells you. Important: a domain may have only one SPF record. If you use two services, merge them into one record, for example v=spf1 include:service-one.com include:service-two.com ~all.

DKIM: a signature on each message

Your mail provider gives you a DKIM record, a long TXT record at a name like selector._domainkey.yourdomain.com. Add it exactly as shown, then turn DKIM signing on in the provider.

DMARC: what to do with failures

DMARC is a TXT record at _dmarc.yourdomain.com. A safe starting record that only monitors is:

v=DMARC1; p=none; rua=mailto:you@yourdomain.com

Later you can move to p=quarantine and then p=reject, once you are sure all your mail passes.

Where to add the records

In the DNS section of the place that controls your nameservers. That is your domain registrar or your host, or a service such as Cloudflare. Records added in the wrong place have no effect.

Test it

Send an email to a free test tool such as mail-tester.com, or look at the original message headers in Gmail and check that SPF, DKIM and DMARC show "pass".

Other causes

Free tool for this problem: Email DNS Checker · Email Header Analyzer · SPF Record Builder

Related guides

Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.

Last updated 2026-11-21.