Try it free

MailSafe guides

SPF, DKIM and DMARC explained, with examples

Email authentication comes down to three DNS records. Each answers a different question. Together they let inboxes tell real email from you apart from fakes.

SPF: who is allowed to send?

SPF (Sender Policy Framework) is a TXT record listing the services allowed to send email for your domain.

v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all

  • include: adds a provider’s servers (here Google and Microsoft).
  • ~all means “anything else is suspicious”. -all means “anything else should fail”.

Common mistakes: two SPF records (only one is allowed); +all, which allows anyone; and too many includes, which breaks the 10-lookup limit (see SPF “too many DNS lookups”).

DKIM: was it really sent by you, unchanged?

DKIM (DomainKeys Identified Mail) signs each email with a private key held by your email provider. The matching public key lives in your DNS under a “selector”, for example:

google._domainkey.yourbusiness.co.uk TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq…"

You don’t write the key yourself: your provider generates it and tells you what to add. Every service that sends as you (newsletters, invoicing, booking) should have DKIM switched on. We show the steps for the two big providers in setting up DKIM.

DMARC: what should happen if it fails?

DMARC is a TXT record at _dmarc.yourbusiness.co.uk:

v=DMARC1; p=none; rua=mailto:reports@yourprovider.example; fo=1

  • p= is the policy: none, quarantine or reject.
  • rua= is where daily reports go.

DMARC passes when SPF or DKIM passes and lines up with the domain in the visible “From” address. That alignment is the clever bit: it stops someone passing SPF with their own domain while showing yours.

How they fit together

  1. An email arrives saying it’s from you@yourbusiness.co.uk.
  2. The inbox checks SPF (did it come from an allowed server?) and DKIM (is the signature valid?).
  3. DMARC checks one of them passed for yourbusiness.co.uk, then applies your policy.
  4. The inbox sends you a report about it the next day.

Check all three now

The free MailSafe check reads your SPF, looks for DKIM on the common selectors and reads your DMARC policy, then gives you the exact records to add, matched to your email provider.

Questions people ask

Can I have two SPF records?

No. A domain must have only one SPF record. Two records make SPF fail. Combine them into one with each service’s include.

Where do I add these records?

Wherever your domain’s DNS is managed: often your domain registrar, your website host or a service like Cloudflare.

How long do changes take?

Usually minutes, sometimes a few hours, depending on your DNS settings.

Sources

General information for UK small businesses, not legal or financial advice. Checked when published; rules change, so check the source before you act.