SPF, DKIM and DMARC are three DNS records that prove your emails really come from your domain. SPF lists the servers allowed to send for you, DKIM signs every message, and DMARC tells Gmail, Outlook and Yahoo what to do when a check fails — and sends you reports. Without them, your emails are far more likely to land in spam, and since 2024 Gmail and Yahoo require all three for bulk senders.
This tutorial gives you copy-paste records for Google Workspace, Microsoft 365 and Hostinger email, the order to publish them in, and how to verify everything passes. Plan for about 20 minutes plus DNS propagation time.
Before you start: list every service that sends email as your domain — your mailbox provider, newsletter tool, CRM, invoicing app, website contact form. Each one must be covered by SPF and/or DKIM, or DMARC will fail for it.
How SPF, DKIM and DMARC work together
| Record | What it proves | Where it lives | Typical value |
|---|---|---|---|
| SPF | The sending server is allowed to send for your domain | TXT on yourdomain.com | v=spf1 include:... ~all |
| DKIM | The message was signed by your domain and not altered | TXT or CNAME on selector._domainkey.yourdomain.com | A public key from your provider |
| DMARC | The visible From domain matches SPF or DKIM ("alignment") + your policy | TXT on _dmarc.yourdomain.com | v=DMARC1; p=none; rua=... |
DMARC passes if either SPF or DKIM passes and matches the domain in the From address. DKIM is the more robust of the two, because SPF breaks when emails are forwarded.
Step 1: Find where your DNS is managed
Your DNS is usually managed where your domain's nameservers point: your registrar (Namecheap, GoDaddy), your host (Hostinger), or a DNS provider such as Cloudflare. Log in there and open the DNS records for your domain.
Tip: If you're not sure, our SPF/DKIM/DMARC checker shows what's published right now — useful before and after your changes.
Step 2: Create your SPF record
You may only have one SPF record per domain. Combine every sender into it.
Google Workspace:
v=spf1 include:_spf.google.com ~all
Microsoft 365:
v=spf1 include:spf.protection.outlook.com ~all
Hostinger email:
v=spf1 include:_spf.mail.hostinger.com ~all
Several senders (e.g. Google Workspace + a newsletter tool):
v=spf1 include:_spf.google.com include:sendgrid.net ~all
Add it as a TXT record with host/name @ (the root domain). Your newsletter or CRM tool lists its own include: value in its documentation.
Rules to remember:
- Only one
v=spf1record. If you already have one, edit it instead of adding another. - Maximum 10 DNS lookups (each
include:counts, and the includes inside it too). Too many → "permerror" and SPF fails. - End with
~all(soft fail) while you set things up. Move to-allonly when you're sure every sender is listed.
Don't want to write it by hand? Use the free SPF record generator.
Step 3: Turn on DKIM
DKIM is enabled inside your email provider, which then gives you a DNS record to publish.
Google Workspace
- Go to Admin console → Apps → Google Workspace → Gmail → Authenticate email.
- Select your domain and click Generate new record (choose 2048-bit if your DNS supports it).
- Copy the TXT record name (usually
google._domainkey) and its value. - Add it in your DNS as a TXT record.
- Wait for DNS to update, then come back and click Start authentication.
Microsoft 365
- Open the Microsoft Defender portal → Email & collaboration → Policies & rules → Threat policies → Email authentication settings → DKIM.
- Select your domain. Microsoft shows two CNAME records (
selector1._domainkeyandselector2._domainkey). - Add both CNAMEs in your DNS exactly as shown.
- Back in Defender, switch Sign messages for this domain with DKIM signatures on.
Hostinger email
- In hPanel, open your domain's email settings and find the DKIM / DNS records section.
- If your DNS is managed by Hostinger, the records are usually added for you — check they're present.
- If your DNS is elsewhere (e.g. Cloudflare), copy the DKIM record(s) Hostinger shows into your DNS.
Other sending tools
Newsletter platforms, CRMs and Trackify Sender connected to your own mailbox each sign with a key. In those tools look for "domain authentication" or "custom DKIM" and publish the records they give you — otherwise their emails fail DMARC alignment.
Step 4: Publish a DMARC record
Start in monitoring mode so nothing gets blocked while you check results:
Name: _dmarc
Type: TXT
Value: v=DMARC1; p=none; rua=mailto:[email protected]; fo=1
p=none— only monitor, don't block anything yet.rua=— where daily aggregate reports are sent (XML files from Google, Microsoft, Yahoo…).fo=1— ask for failure details when any check fails.
Generate yours with the DMARC record generator. Those XML reports are hard to read by hand — upload them to the free DMARC report analyzer, or let Trackify's DMARC monitoring collect and summarise them automatically.
Step 5: Test everything
- Wait for propagation (often minutes, sometimes up to 24–48 hours).
- Run the SPF/DKIM/DMARC checker on your domain — all three should be found and valid.
- Send a real email to the inbox placement test. The report shows
spf=pass,dkim=pass,dmarc=passfrom the receiving server's point of view. - In Gmail you can also open a received email → ⋮ → Show original and look for the same three "PASS" lines.
Step 6: Tighten your DMARC policy (after 2–4 weeks)
Once reports show that all your legitimate sources pass:
v=DMARC1; p=quarantine; pct=25; rua=mailto:[email protected]
Increase pct to 100 over a few weeks, then consider p=reject for full protection against spoofing. Don't jump straight to reject — a forgotten sender (like your invoicing tool) would have its emails blocked.
Common errors and how to fix them
| Error | What it means | Fix |
|---|---|---|
| Multiple SPF records | Two v=spf1 TXT records exist | Merge them into one |
| SPF permerror / too many lookups | More than 10 DNS lookups | Remove unused includes, or flatten the record |
| DKIM "no key for signature" | DNS record missing or wrong selector | Re-copy the record name and value from your provider |
| DMARC fail with SPF pass | SPF passed for a different domain (no alignment) | Enable DKIM with your domain in that sending tool |
Bounces like 550 5.7.26 at Gmail | Unauthenticated email rejected | Fix SPF/DKIM so at least one passes and aligns |
Look up any other bounce code in our SMTP error code guide.
FAQ
Do I need SPF, DKIM and DMARC?
Yes. Gmail and Yahoo require SPF and DKIM for everyone and DMARC for bulk senders, and Outlook has introduced similar rules. Even if you send few emails, they noticeably improve inbox placement and stop others spoofing your domain.
Which DMARC policy should I use?
Start with p=none to monitor. After reports show that all legitimate senders pass, move to p=quarantine, then p=reject.
Can I have two SPF records?
No. Multiple SPF records make SPF fail. Combine all senders into a single record.
How long does it take for SPF, DKIM and DMARC to work?
Usually minutes to a few hours after you publish the records, depending on your DNS provider; allow up to 48 hours.
What is DMARC alignment?
It means the domain in the visible From address matches the domain that passed SPF or DKIM. Without alignment, DMARC fails even when SPF or DKIM technically pass.
Monitor your domain automatically: with a free Trackify account you can run spam tests, check authentication and collect DMARC reports in one dashboard. Get started free.
