A small-business owner working on a laptop at home

Blog  /  Email

SPF, DKIM and DMARC explained in plain English

Three DNS records decide whether mail from your domain is trusted or treated as a forgery. None is complicated on its own. The trouble starts when one is missing, duplicated or typed on the wrong name.

Why your domain needs them

Email was designed without any check on who is sending. Anyone can put your domain in the From line. SPF, DKIM and DMARC are three DNS records that let a receiving mail server tell your real messages from forgeries.

Without them, your own mail is more likely to land in spam, and the big mailbox providers have become strict about it. Gmail and Yahoo have required all three from bulk senders since 2024, and expect at least SPF or DKIM from everyone.

All three are about mail you send. Receiving mail is the job of your MX records, which are a separate thing. Every one of them is on the record types page.

SPF: who is allowed to send

SPF is a single TXT record on your root domain that lists the services allowed to send mail for it. A domain that sends through Google Workspace has:

v=spf1 include:_spf.google.com ~all

Each include: authorises one sending service. The ending covers everyone else: ~all (soft fail) marks other senders as suspicious, -all (fail) says they are not authorised at all.

  • One SPF record only. Two records starting v=spf1 is an error, and SPF stops working. If you send through two services, merge them into one record: v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all
  • No more than ten lookups. Each include: costs at least one DNS lookup, and the limit is ten in total. Remove services you no longer use.
  • Use the TXT type. Some panels still list a record type called "SPF". It is obsolete. Receivers look for the TXT record.

DKIM: a signature on every message

With DKIM, your mail service signs each outgoing message with a private key. The matching public key sits in your DNS, and receivers use it to confirm that the message was signed by your service and was not altered on the way.

You never write a DKIM record yourself. Your mail provider generates it and gives you a name and a value to copy. The name always has the shape selector._domainkey, where the selector is a label the provider chooses. Google Workspace gives you one TXT record at google._domainkey. Microsoft 365 gives you two CNAME records. Proton Mail gives you three.

  • Unlike SPF, several DKIM records are normal: one set for each service that sends for you, each with its own selector.
  • The value is long. Paste it whole and let the panel split it if it needs to.
  • On Cloudflare, DKIM CNAMEs must be set to DNS only, not proxied.
  • Publishing the record is half the job. Google Workspace and Microsoft 365 both need you to switch DKIM signing on in their admin console once the record is live.

DMARC: the policy and the reports

DMARC ties the other two to the address people actually see. A message passes DMARC if it passes SPF or DKIM and the domain that passed matches the domain in the From line. DMARC also tells receivers what to do with mail that fails, and where to send you reports. It is one TXT record on the name _dmarc:

v=DMARC1; p=none; rua=mailto:you@yourdomain.com

The p= tag is the policy. none means "deliver as normal, but tell me about it". quarantine asks receivers to treat failing mail as spam. reject asks them to refuse it. The rua address receives summary reports showing which servers are sending mail in your domain's name, and whether they pass.

Start with p=none and read the reports for a few weeks. They nearly always turn up a sender you forgot: the newsletter tool, the invoicing system, the website's contact form. Add each one to SPF or set up its DKIM, and only then move to quarantine and later reject. Going straight to reject is how genuine invoices disappear.

The order to set them up, and how to check

  1. MX and SPF when you connect the mail service. The Google Workspace and Microsoft 365 routes in the Route Planner write both in your panel's format.
  2. DKIM as soon as the provider gives you the record.
  3. DMARC at p=none, using the DMARC starter route.
  4. Tighten the DMARC policy once the reports are clean.

To see what is published, query each name:

dig TXT yourdomain.com +short
dig TXT google._domainkey.yourdomain.com +short
dig TXT _dmarc.yourdomain.com +short

Then send a message to a Gmail address, open it and choose "Show original". Gmail lists SPF, DKIM and DMARC with a pass or fail against each.

The most common fault is the Name field. Typing _dmarc.yourdomain.com into a panel that expects just _dmarc creates _dmarc.yourdomain.com.yourdomain.com, which nothing will ever look up. Your provider's guide shows what its form expects. And if a domain never sends email at all, lock it down so nobody can forge it: the no-mail route has the three records.

Keep reading

All posts