Deliverability

SPF, DKIM and DMARC Explained: Set Them Up Right

Three DNS records prove your emails are really yours. A plain explanation of each and a safe order to set them up.

23 May 20266 min read
SPF, DKIM and DMARC Explained: Set Them Up Right

SPF, DKIM and DMARC are three DNS-based checks that tell receiving servers your mail is legitimate. Together they are the foundation of deliverability.

SPF: who may send

An SPF record lists the servers allowed to send mail for your domain. A receiving server compares the sending IP with that list. Keep it to one record and stay under the 10 DNS lookup limit.

DKIM: was it altered

DKIM adds a cryptographic signature to each message. The public key sits in your DNS. If the signature checks out, the message is proven to come from your domain and to be unchanged.

DMARC: what to do on failure

DMARC ties the two together. It tells receivers what to do when SPF and DKIM fail to align with your From domain (none, quarantine or reject) and where to send reports.

A safe setup order

  1. Publish SPF for every service that sends your mail.
  2. Enable DKIM in each sending service.
  3. Add DMARC with p=none and a reporting address.
  4. Read the reports for a few weeks and fix unaligned senders.
  5. Move to quarantine, then reject, when reports are clean.

Check your work

Send a test to a Gmail address and read the original message headers. SPF, DKIM and DMARC should show PASS.

Example records

These are illustrative; replace names with your own provider's values.

  • SPF (a TXT record on the domain): `v=spf1 include:_spf.your-provider.example ~all` says which servers may send as your domain. Keep to a single SPF record, and stay under 10 DNS lookups or the record fails.
  • DKIM (a TXT record on `selector._domainkey.yourdomain`): holds a public key. Your sending tool signs each message with the matching private key. Use 2048-bit keys where the tool allows.
  • DMARC (a TXT record on `_dmarc.yourdomain`): `v=DMARC1; p=none; rua=mailto:reports@yourdomain` starts in monitoring mode and sends you aggregate reports.

Common mistakes

  • Two SPF records on one domain. Only one is allowed, so merge them.
  • Forgetting a sending source (the CRM, the helpdesk, the invoicing tool) and then failing DMARC for its mail.
  • Jumping straight to `p=reject` before reading reports, which can block your own legitimate mail.

How to confirm it works

Send a test message to a Gmail address, open the message menu and choose Show original. Look for SPF, DKIM and DMARC all marked PASS. Free tools such as our SPF and DMARC checker also read the records from the outside.

Authentication does not replace list quality: after you set it up, keep addresses clean with the bulk verifier.

Alignment in plain words

SPF and DKIM can pass and DMARC can still fail. DMARC requires that the domain in the visible From address matches the domain that passed SPF or DKIM. If your newsletter tool signs with its own domain and your From address uses yours, you must configure a custom signing domain in the tool. This single detail causes most "but my records are correct" support questions.

Rolling out DMARC without breaking mail

Start with a policy of none and a reporting address, and read the reports for two to four weeks. They list every source that sends as your domain, including ones you forgot. Authenticate or retire each source, then move to quarantine, and finally to reject once the reports are clean. Moving too fast is the usual way to block your own invoices.

When records change

Any time you add a sending service, update SPF and publish its DKIM key before the first send. Keep a short document listing every service that sends as your domain and who owns it.

Keep the records tidy

Every year, review your DNS: remove old services from SPF, rotate DKIM keys where your provider supports it and check that your DMARC reporting address still works. Untidy records are a quiet source of failures and of security risk.

A worked rollout plan for a small sender

Most teams read about SPF, DKIM and DMARC and then stall because the work looks like one big task. It is easier as five small ones spread over a few weeks, and each step has a clear way to check that it worked.

  1. Inventory every system that sends as your domain. Your website, billing tool, helpdesk, newsletter platform and your own mailboxes all count. Write them in a list. Forgotten senders are the number one reason a strict policy later blocks real mail.
  2. Publish one SPF record that covers the whole list. A domain may have only one SPF record, so combine the includes instead of adding a second record. Count the DNS lookups; SPF allows ten, and every include uses some of them.
  3. Turn on DKIM signing in each platform and publish the keys it gives you. Send yourself a message from every system and confirm the header shows a DKIM pass for your own domain, not only for the provider's domain.
  4. Publish DMARC with p=none and a reporting address. This changes nothing for delivery. It starts the reports that show who sends as you and which of them fail.
  5. Tighten slowly. After two or three weeks of clean reports move to quarantine for a small percentage of mail, then raise the percentage, and only later consider reject.

Reading a DMARC report without a tool

An aggregate report is an XML file, and you do not need special software to learn from it. Open it and look at three things: the source IP address, the number of messages, and the SPF and DKIM results next to the policy that was applied. A known sender that fails alignment is a fix you must make before tightening. An unknown source with a handful of messages is usually a forwarder or a mistake. An unknown source with thousands of messages that all fail is somebody impersonating you, which is exactly what the policy is for.

Why a pass is not always a pass

DMARC passes only when SPF or DKIM passes and the passing domain matches the domain in the visible From address. A mail can show SPF pass and still fail DMARC because the bounce domain belongs to the sending service, not to you. The usual cure is to set up the custom return-path or branded sending domain that your provider offers. If you only check whether SPF says pass, you will miss this.

Where verification fits

Authentication proves that you are who you say you are. It says nothing about whether the people you send to still exist. A perfectly authenticated message to a dead mailbox still bounces and still hurts your reputation. That is why list quality and authentication are two halves of the same job: first make sure the sender is trusted, then make sure the recipients are real. With Mailbite you can check a batch of addresses before a send; the free allowance of 100 verifications each month is enough to test a sample of your list.

Mailbite Editorial TeamPractical guides on email verification and deliverability.