Trackify.email

How to Set Up SPF, DKIM and DMARC: Step-by-Step for Google Workspace, Microsoft 365 and Hostinger

Set up SPF, DKIM and DMARC correctly in 20 minutes. Copy-paste DNS records for Google Workspace, Microsoft 365 and Hostinger, plus how to test and fix errors.

SPF, DKIM and DMARC DNS records with all three checks passing

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

RecordWhat it provesWhere it livesTypical value
SPFThe sending server is allowed to send for your domainTXT on yourdomain.comv=spf1 include:... ~all
DKIMThe message was signed by your domain and not alteredTXT or CNAME on selector._domainkey.yourdomain.comA public key from your provider
DMARCThe visible From domain matches SPF or DKIM ("alignment") + your policyTXT on _dmarc.yourdomain.comv=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=spf1 record. 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 -all only 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

  1. Go to Admin console → Apps → Google Workspace → Gmail → Authenticate email.
  2. Select your domain and click Generate new record (choose 2048-bit if your DNS supports it).
  3. Copy the TXT record name (usually google._domainkey) and its value.
  4. Add it in your DNS as a TXT record.
  5. Wait for DNS to update, then come back and click Start authentication.

Microsoft 365

  1. Open the Microsoft Defender portal → Email & collaboration → Policies & rules → Threat policies → Email authentication settings → DKIM.
  2. Select your domain. Microsoft shows two CNAME records (selector1._domainkey and selector2._domainkey).
  3. Add both CNAMEs in your DNS exactly as shown.
  4. Back in Defender, switch Sign messages for this domain with DKIM signatures on.

Hostinger email

  1. In hPanel, open your domain's email settings and find the DKIM / DNS records section.
  2. If your DNS is managed by Hostinger, the records are usually added for you — check they're present.
  3. 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

  1. Wait for propagation (often minutes, sometimes up to 24–48 hours).
  2. Run the SPF/DKIM/DMARC checker on your domain — all three should be found and valid.
  3. Send a real email to the inbox placement test. The report shows spf=pass, dkim=pass, dmarc=pass from the receiving server's point of view.
  4. 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

ErrorWhat it meansFix
Multiple SPF recordsTwo v=spf1 TXT records existMerge them into one
SPF permerror / too many lookupsMore than 10 DNS lookupsRemove unused includes, or flatten the record
DKIM "no key for signature"DNS record missing or wrong selectorRe-copy the record name and value from your provider
DMARC fail with SPF passSPF passed for a different domain (no alignment)Enable DKIM with your domain in that sending tool
Bounces like 550 5.7.26 at GmailUnauthenticated email rejectedFix 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.

More from the Trackify blog

Start tracking emails free