How do I set up SPF, DKIM and DMARC for my marketing emails?
What SPF, DKIM and DMARC do, the exact DNS records to add for each, how to check they work, and what Gmail and Yahoo expect from bulk senders.
Listen to this article
0:00 / 9:46
On this page
- Why do my emails go to spam even though they look fine?
- What are SPF, DKIM and DMARC, in plain words?
- What do I need before I start?
- How do I set up SPF?
- How do I set up DKIM?
- How do I set up DMARC?
- How do I check that it worked?
- What do Gmail and Yahoo require from bulk senders?
- What if it still goes to spam?
- What does Skrybe ask you to add?
Updated 24 November 2026. Google's and Yahoo's sender rules quoted here were checked on that date.
One reason your emails may land in spam is that your domain doesn't prove you're allowed to send from it. SPF, DKIM and DMARC are three DNS records that prove it: SPF lists who may send for your domain, DKIM signs each message, and DMARC tells receivers what to do when a message fails those checks. Gmail and Yahoo both require all three from bulk senders. This guide shows what to add, in what order, and how to check it worked.
Why do my emails go to spam even though they look fine?
A message can look perfect and still fail checks you never see. When your email arrives, the receiving provider checks whether your domain has authorised the server that sent it, whether the message carries a valid signature from your domain, and what the domain owner wants done if those checks fail.
Gmail says it requires all bulk email senders to add a DMARC record to their sending domain, and that without one, messages might be rejected or sent to spam.
What are SPF, DKIM and DMARC, in plain words?
- SPF (Sender Policy Framework): a list, published on your domain, of the servers allowed to send email for it.
- DKIM (DomainKeys Identified Mail): a digital signature on each message. Your sending service signs with a private key it keeps, and receivers check the signature against a public key published in your domain's DNS.
- DMARC (Domain-based Message Authentication, Reporting and Conformance): a policy that tells receivers what to do with mail that fails, and where to send reports about it.
DNS (Domain Name System) is the public set of settings for your domain. All three records are added there as TXT records, which are plain text entries.
What do I need before I start?
- A domain you own, such as
yourbusiness.com. All three records live in that domain's DNS. - Access to where your domain's DNS is managed. Log in there and find where its DNS records are edited.
- The records your sending service gives you. The service that sends your newsletters holds the private DKIM key, so it has to give you the matching public key to publish.
Do them in this order: SPF, then DKIM, then DMARC. DMARC builds on the other two, because it checks that SPF or DKIM passed for your From domain.
How do I set up SPF?
An SPF record is a TXT record that starts with v=spf1. It lists who may send for you, and it usually ends with an all mechanism, as in the examples in the SPF standard.
- In your DNS settings, check whether a TXT record starting with
v=spf1already exists on your domain. - If one exists, edit it. Don't add a second one. A domain must have only one SPF record; with more than one, the check returns an error (a "permerror").
- If none exists, add a TXT record on the domain itself.
- Add the value your sending service tells you to use.
Here is an illustrative record for the example domain example.com. The include: value is a placeholder; use the one your sending service gives you:
| Field | What to enter |
|---|---|
| Type | TXT |
| Name | example.com (the domain itself) |
| Value | v=spf1 include:_spf.your-sending-service.example ~all |
The ~all at the end is a "softfail": the SPF standard says mail from servers not on the list ought to be treated as somewhere between a fail and a neutral result.
Watch the 10-lookup limit. The SPF standard caps the number of DNS lookups a check may make at 10; go over it and SPF returns a permerror. Keep the record short and remove services you no longer use.
How do I set up DKIM?
DKIM uses a pair of keys. The private key stays with the server that sends your mail, and the public key is stored in a DNS TXT record on your domain.
- In your sending service, find its domain or DKIM settings and copy the record it gives you.
- In your DNS settings, add a TXT record with the exact name and value the service gave you.
- Wait, then test (see below).
The record's name includes a selector, a label that lets one domain have several keys at once. The key is looked up at <selector>._domainkey.<your domain>. In the DKIM standard's own example, the selector foo.bar on example.com is looked up at foo.bar._domainkey.example.com.
An illustrative DKIM record looks like this. The key value is a placeholder; always copy the exact record your sending service gives you:
| Field | What to enter |
|---|---|
| Type | TXT |
| Name | selector1._domainkey (full name: selector1._domainkey.example.com) |
| Value | v=DKIM1; k=rsa; p=MIIBIjANBgkq... (your public key) |
v=DKIM1 is the version and must come first if present, k=rsa is the key type (RSA is the default), and p= holds the public key. If a long key is split into several quoted strings, receivers join them back together with no spaces.
Google's setup guide says: "After adding a DKIM key, it can take up to 48 hours for DKIM authentication to start working." If your first test fails, wait and test again.
How do I set up DMARC?
A DMARC record is a TXT record on _dmarc.<your domain>, and it starts with v=DMARC1. The p= tag sets your policy:
p=none: the domain owner requests no specific action.p=quarantine: treat failing mail as suspicious.p=reject: reject failing mail.
The rua= tag sets where aggregate reports go, as a mailto: address.
Start with p=none. Yahoo's minimum for bulk senders is a valid DMARC policy of at least p=none. An illustrative starter record for example.com:
| Field | What to enter |
|---|---|
| Type | TXT |
| Name | _dmarc (full name: _dmarc.example.com) |
| Value | v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com |
Use a mailbox you actually read for rua.
Then tighten it in stages. Once your reports show your real sending services passing, move to p=quarantine, which dmarc.org describes as useful while testing. Move to p=reject last, when you're confident every service that sends for you is set up.
What "alignment" means. DMARC passes when SPF or DKIM passes for a domain that matches your From address. Only one of the two needs to pass and match.
How do I check that it worked?
- Wait for your records to take effect. Google says DKIM can take up to 48 hours to start working.
- Send a test campaign or email from your domain to a personal Gmail address you can open.
- Open the message. In Gmail, next to Reply, click More, then Show original.
- Read the full header that opens. If a record isn't working, recheck it: the exact name, the exact value, and that there's only one SPF record.
What do Gmail and Yahoo require from bulk senders?
As checked on 24 November 2026:
Gmail (from Google's email sender guidelines and FAQ):
- Bulk senders must authenticate with SPF and DKIM and add a DMARC record; without DMARC, messages might be rejected or sent to spam. This applies when sending to personal Gmail accounts.
- Marketing and subscribed messages must support one-click unsubscribe.
- Keep the spam rate reported in Google Postmaster Tools low. The page gives two figures: below 0.30% in one section, and "below 0.10% and avoid ever reaching a spam rate of 0.30% or higher" in another.
Yahoo (from Yahoo Sender Hub):
- Implement SPF and DKIM, and publish a valid DMARC policy of at least
p=none. - Support one-click unsubscribe and keep the spam rate below 0.3%.
These rules can change. Check Google's email sender guidelines and Yahoo's sender best practices before a big send.
What if it still goes to spam?
Authentication is one requirement among several: both Gmail and Yahoo also look at your spam rate and whether people can unsubscribe in one click. If all three records pass and mail still goes to spam, look at who you're sending to and whether they expect your email.
Common mistakes checklist:
- Two SPF records. A domain must have only one; merge them into one record.
- Over 10 lookups in SPF. The check returns a permerror; remove services you no longer use.
- A DKIM record copied wrongly. Copy the exact name and value; the key must sit at
<selector>._domainkey.<your domain>. - Jumping straight to
p=reject. Mail from any sender you forgot to set up can fail DMARC, and you'd be asking receivers to reject it. Start atp=noneand read your reports first. - Testing too soon. Google says DKIM can take up to 48 hours to start working.
What does Skrybe ask you to add?
Skrybe sends from your own domain; after signup, the welcome email gives you one DNS TXT record (DKIM) to add where you manage your domain, and Skrybe verifies it automatically. Skrybe doesn't ask for or check SPF or DMARC, so set those up yourself using the steps above.