SPF, DKIM and DMARC are three DNS records that prove your email really comes from your domain. Without them, your mail is far more likely to land in spam, and anyone can send fake email that looks like it came from you. Setting them up takes about fifteen minutes, and you only have to do it once. This guide explains what each record does and how to add it.
What SPF, DKIM and DMARC actually do
SPF (Sender Policy Framework) is a list, published in your domain's DNS, of the servers allowed to send email for your domain. When a receiving server gets a message claiming to be from you, it checks the sending server against your SPF record. If the server is not on the list, the message is treated as suspicious.
DKIM (DomainKeys Identified Mail) adds a digital signature to every outgoing message. The receiving server checks the signature against a public key published in your DNS. If the signature matches, the message has not been tampered with since it left your mail server.
DMARC ties the two together. It tells receiving servers what to do when a message fails SPF or DKIM — ignore it, quarantine it, or reject it outright — and it tells them where to send you reports about mail claiming to be from your domain.
You need all three. SPF alone can be bypassed when mail is forwarded, DKIM alone does not say which servers may send, and without DMARC nobody enforces either of them.
Step 1: Add the SPF record
SPF is a single TXT record on your domain, at the root (the host is usually @ or left blank, depending on your DNS panel). Your email provider gives you the exact value — it always starts with v=spf1 and ends with an ending mechanism such as ~all or -all. Typical values:
- Microsoft 365:
v=spf1 include:spf.protection.outlook.com -all - Google Workspace:
v=spf1 include:_spf.google.com ~all - Zoho Mail:
v=spf1 include:zoho.com ~all
There can only be one SPF record per domain. If you send mail from two services — say Microsoft 365 and a newsletter tool — you must combine their includes into a single record, for example v=spf1 include:spf.protection.outlook.com include:sendgrid.net ~all. Two separate SPF records will break SPF entirely, and most DNS panels will not warn you about it.
SPF has a limit of 10 DNS lookups. Each include: counts, and includes can contain further includes, so a long chain of services can silently exceed the limit. If your SPF stops working after adding a new service, too many lookups is the first thing to check.
Step 2: Add the DKIM record
DKIM needs two things: a key pair generated by your email provider, and a DNS record publishing the public key.
- In your provider's admin panel, turn on DKIM signing for your domain and generate the key. Microsoft 365 does this in the Defender portal under Email authentication; Google Workspace does it in the Admin console under Apps > Google Workspace > Gmail > Authenticate email; Zoho does it in the Mail admin panel under Domains.
- The provider will show you a TXT record to add. The host looks like
selector._domainkey— for example, Microsoft 365 uses a selector such asselector1._domainkey— and the value starts withv=DKIM1; k=rsa; p=followed by a long public key. - Add that TXT record in your DNS, then go back to the provider's panel and confirm the record is found. Signing starts once the provider verifies the key.
DKIM records are long, and some DNS panels split them or add line breaks when you paste. If verification fails, check that the full key was pasted with no spaces or line breaks added by the panel.
Step 3: Add the DMARC record
DMARC is a TXT record at the host _dmarc on your domain. Start with a monitoring-only policy so you can see what is happening before you start rejecting mail:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
The p=none policy means receivers take no action on failures but send you aggregate reports at the address in rua. Leave this running for one to two weeks and read the reports — they show every server sending mail as your domain, including any legitimate service you forgot about.
Once the reports show only your real senders passing, tighten the policy in stages:
p=quarantine— failing mail goes to the recipient's spam folder.p=reject— failing mail is refused outright. This is the end state you want.
Never jump straight to p=reject. A single forgotten service — a website contact form, an invoicing tool, a CRM — will have its mail silently refused, and you will only find out when a customer tells you they never got your invoice.
Step 4: Check that it all works
After adding the records, allow up to 24 hours for DNS to propagate, though it is usually much faster. Then check each record with a free tool such as MXToolbox's SPF, DKIM and DMARC checkers, or send a test message to a Gmail address and open "Show original" — Gmail shows SPF, DKIM and DMARC as PASS or FAIL at the top.
Also send a test to a colleague on a different provider and ask them to confirm the message arrived in the inbox, not spam. If anything fails, check the usual suspects first: a second SPF record, a DKIM key pasted with line breaks, or a DMARC record at the wrong host (it must be _dmarc, not the root).
Common mistakes
- Two SPF records. Only one is allowed — merge them into a single record.
- SPF with too many lookups. Ten is the limit; flatten includes or remove services you no longer use.
- DMARC at p=reject on day one. Always start at p=none and read the reports first.
- Forgetting the website and other tools. Contact forms, invoicing software and CRMs also send mail as your domain — their servers need to be in SPF and, where possible, signing with DKIM.
- Setting the records and never checking. A typo in a DNS record fails silently. Verify with a checker after every change.
Need help?
HostMinute sets up SPF, DKIM and DMARC free of charge with every business email plan — Microsoft 365, Google Workspace and Zoho Mail — and verifies all three records pass before we hand the mailboxes over. If your mail is landing in spam, talk to us on WhatsApp and we will check your records for you. Our business email plans are listed on our business email page.