Free, independent guides since 2010

Hosting & domains

SPF, DKIM and DMARC: protect email from your domain

Why SPF, DKIM and DMARC decide whether your emails land in the inbox, what Gmail, Yahoo and Outlook require from senders and how to set the three records up step by step.

<guide section="Hosting & domains" type="article" read="2 min"/>

You set up a contact form, a newsletter or an online shop, and the emails end up in spam – or don’t arrive at all. Very often the cause is missing email authentication. Three DNS records, called SPF, DKIM and DMARC, tell receiving mail servers that a message really comes from you. They are added as TXT records, so it helps to read DNS records explained first.

Why this suddenly matters more

In February 2024 Gmail and Yahoo started enforcing stricter rules for senders. Every sender needs SPF or DKIM, and bulk senders (around 5,000 messages a day or more to Gmail) need SPF, DKIM and DMARC, plus an easy one-click unsubscribe for marketing mail. Microsoft followed for Outlook.com in May 2025. Messages that do not meet the rules are increasingly rejected rather than just filed as spam. Google’s requirements are described in its email sender guidelines.

SPF: who may send

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

Plain text
example.com.  TXT  "v=spf1 include:_spf.mailprovider.net include:servers.newsletter-tool.com -all"
  • Add an include: for every service that sends mail as you: your mailbox provider, newsletter tool, webshop, CRM.
  • End with -all (reject others) or ~all (soft fail) once you are sure the list is complete.
  • SPF allows at most ten DNS lookups; too many includes break it.

DKIM: a signature on every message

DKIM (DomainKeys Identified Mail) adds a digital signature to each email. The public key is published in your DNS under a selector, for example s1._domainkey.example.com. Your email provider generates the key for you; you only copy the record into your DNS. Repeat this for each service that sends on your behalf.

DMARC: the policy and the reports

DMARC ties SPF and DKIM to the address people actually see in the “From” field, tells receivers what to do with messages that fail, and sends you reports.

Plain text
_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"
  1. Start with p=none: nothing is blocked, but you receive reports about who sends mail as your domain.
  2. Fix any legitimate service that fails (usually a missing include or DKIM key).
  3. Move to p=quarantine (to spam) and finally p=reject (refuse) to stop spoofing completely.

Quick checklist

  • One SPF record containing all your sending services.
  • DKIM enabled at every service that sends as your domain.
  • A DMARC record with a reporting address, moving towards p=reject.
  • For domains that never send email: v=spf1 -all and p=reject, so nobody can abuse them.

Frequently asked questions

Does a small website need DMARC?

Yes. Even if you send few emails, scammers can send phishing in your name. A DMARC record, even one that starts with p=none, protects your domain and shows you who is using it.

Can I have two SPF records?

No. A domain may have only one SPF record. Combine all your senders in one record with several include: mechanisms.