Skip to content

DKIM SPF DMARC explained: the three records that decide whether your mail arrives

Published Updated 8 min readBy the Rasket team

Three interlocking rings suspended above a single envelope, drawn as white and violet outlines on black.

What the three records do

Email authentication is the set of DNS records that let a receiving server decide whether a message claiming to come from your domain really did. There are three of them, they were designed at different times to solve different halves of the problem, and they only work as a set. Here is DKIM SPF DMARC explained in one paragraph each, before the detail.

  • SPF is a list of who may send. You publish the servers allowed to send mail for your domain, and a receiver checks the connecting server against that list.
  • DKIM is a signature. Your sending service signs each message with a private key and publishes the public half in DNS, so a receiver can check that the message it is holding is the one that was signed.
  • DMARC is the policy and the feedback loop. It says what a receiver should do when neither check passes in a way that lines up with your From address, and it asks receivers to report what they saw.

None of the three says a message is wanted. They say it is not forged. That is the floor rather than the ceiling, and the deliverability guide covers what decides placement once you are over it.

SPF: who is allowed to send

An SPF record is a single TXT record at your domain listing the sources permitted to send mail for it. A receiving server takes the domain from the envelope sender, looks up that record, and checks the connecting IP address against it.

acme.example.        TXT   "v=spf1 include:_spf.example.net -all"

The terms are read left to right. include: pulls in another domain’s record, which is how you authorise a sending service without knowing its addresses. The last term is the catch-all: -all means anything not matched so far fails, and ~all means it soft-fails. Prefer -all once you are confident the record is complete, because a soft fail is an instruction to accept the message anyway.

One record, not two

RFC 7208 says a domain publishes one SPF record. A second one does not merge with the first — it makes the check fail with a permanent error. If you send through several services, every one of them goes inside that single record as another include term.

Why SPF breaks on forwarding

SPF checks the connection, and forwarding changes the connection. When somebody auto-forwards your message, the forwarding server relays it from an address your record has never heard of, and the check fails at the final destination through no fault of yours. That is not a bug in SPF so much as the limit of what checking a connection can prove, and it is the reason DKIM exists.

The lookup limit

Evaluating a record may perform at most ten DNS lookups. Every include, a, mx and redirect term counts, and so does everything they pull in recursively. Exceeding it makes the whole check fail permanently, which is a failure mode worth knowing about because it arrives slowly: you add a fourth vendor to a record that already had three, and mail that has passed for years starts failing.

DKIM: a signature that survives forwarding

DKIM puts a cryptographic signature in the message headers. Your sending service holds a private key; the public half lives in a TXT record under a selector, which is just a label so that a domain can hold several keys at once. Every domain you add to Rasket gets its own 2048-bit key, published under the rasket selector.

rasket._domainkey.acme.example.   TXT   "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQ..."

The signature itself rides along with the message. It names the domain, the selector and the headers it covers, plus a hash of the body.

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;  d=acme.example; s=rasket; h=from:to:subject:date:message-id;  bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=;  b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSb...

A receiver reads d= and s=, fetches the public key at selector._domainkey.domain, recomputes the hashes over the signed headers and the body, and compares. If they agree, the message arrived exactly as it was signed, by somebody holding your key. Because none of that depends on who is connecting, a DKIM signature usually survives a forwarding hop that SPF does not.

Publish 2048 bits. RFC 8301 raised the floor from 1024, and the only practical cost is that the value is long enough that some DNS panels split it into two quoted strings, which is normal and resolves correctly. Rotating a key means publishing a second record under a new selector, signing with it, and removing the old record once nothing still in flight refers to it.

DMARC: the policy and the reports

SPF and DKIM each produce a result. Neither says what a receiver should do with it, and neither tells you what happened. A DMARC policy is the record that does both.

_dmarc.acme.example.   TXT   "v=DMARC1; p=none; rua=mailto:dmarc@acme.example; adkim=s; aspf=s"
The three DMARC policies
PolicyWhat a receiver doesWhen to publish it
p=noneNothing different. Delivers as it would have anyway and sends you reports.First, always. It is how you find the streams you had forgotten about.
p=quarantineTreats a failing message as suspicious, usually meaning the spam folder.Once the reports show every legitimate stream passing with alignment.
p=rejectRefuses the message at the door. The recipient never sees it.Once quarantine has run for a while and produced no surprises.

rua is where aggregate reports are sent: a daily XML summary from each receiver saying how much mail it saw claiming your domain, from where, and whether it passed. Those reports are the entire value of p=none. Reading them by hand is unpleasant, and several services will parse them for you, but do read them — the usual discovery is a marketing tool or an old invoicing system nobody remembered was sending as you.

pct lets you apply a policy to a fraction of your mail, which is a gentler way into quarantine than switching everything at once. And a subdomain policy tag lets a strict parent domain coexist with a subdomain you are still working on.

Alignment, which is the part people miss

This is the concept that makes DMARC more than a wrapper. A DMARC pass needs SPF or DKIM to pass and the domain that passed to line up with the domain in the visible From header. A message can pass SPF perfectly and still fail DMARC, because the domain that passed was the sending service’s rather than yours.

  • SPF alignment compares the envelope sender’s domain with the From domain. This is why a sending service gives you a return path on your own subdomain rather than using its own: without it, SPF passes and aligns with nothing.
  • DKIM alignment compares the d= domain in the signature with the From domain. Signing with your domain rather than the service’s is what makes this work.

Strict mode (adkim=s, aspf=s) requires an exact match; relaxed mode, the default, accepts a subdomain of the same organisational domain. Relaxed is the right starting point, because it lets send.acme.example align with acme.example and that is the shape most senders actually have. Only one of the two has to align for DMARC to pass, which is why publishing both records is worth the effort: each covers a case the other loses.

What the large mailbox providers require

This stopped being optional. Google’s sender guidelines require authentication for everybody who sends to Gmail, with more asked of bulk senders: SPF and DKIM on the sending domain, a DMARC record on the organisational domain, alignment on at least one of the two, a valid forward and reverse DNS record for the sending host, TLS in transit, and one-click unsubscribe on subscribed mail. Microsoft publishes its own requirements for senders to Outlook.com along similar lines.

Two consequences follow for anyone building a product that sends. First, there is no volume small enough to skip this: the baseline applies to every sender, and the extra requirements start at a threshold a growing product will cross without noticing. Second, the requirements are checked continuously rather than once, so a record that gets dropped during a DNS migration is a deliverability incident rather than a tidy-up task.

Publishing the records for a sending domain

Adding a domain generates the set it needs: the DKIM key to publish as TXT, and the two records at the sending subdomain that give it its own return path — which is what makes SPF align and what makes bounces come back to us rather than to your mail server. Each record is checked as soon as you add the domain and re-checked on a schedule, so nothing has to poll, and a record that verified and later stopped resolving is reported as drifted rather than quietly ignored.

DMARC is the one record nobody generates for you, and that is deliberate: it is a policy about your whole domain, not about one sending service, and publishing it on your behalf would be making a decision that is yours. Add it yourself at p=none, read the reports, and tighten from there.

One warning if your domain already publishes a strict policy: publish the new records and let verification pass before you start sending from it, or mail can be rejected in the window where the records exist but alignment does not. The domain verification walkthrough has the step-by-step, including the panel behaviour that catches nearly everybody, and the domains reference documents every field the API returns for a record.

Frequently asked questions

Do I need all three records?

You need SPF and DKIM to pass a modern inbox check, and you want DMARC on top of them. SPF and DKIM each prove something narrow on their own; DMARC is what turns the pair into a policy a receiver can act on and a report you can read. Publishing two of the three leaves you unable to see what is happening.

Can I have more than one SPF record?

No. RFC 7208 says a domain publishes one SPF record, and a second one makes the check fail with a permanent error rather than merging the two. If you send through several services, put every one of them inside the single record as an additional include term.

Why does SPF break when mail is forwarded?

Because forwarding changes who is connecting. The forwarding server relays your message from its own address, which your SPF record has never heard of, so the check fails at the final destination. DKIM survives that hop, since the signature travels with the message rather than with the connection, which is one reason both records exist.

What does p=none actually do?

Nothing to the mail, which is the point of it. It asks receivers to treat failures exactly as they would have anyway and to send you aggregate reports about what they saw. It is the setting you publish first, so that you learn which of your sending streams fail before a stricter policy starts costing you real messages.

How long should I stay on p=none?

Until the reports show every legitimate stream passing with alignment, which for most senders is a few weeks rather than a few days. Move to quarantine next, watch again, and only then to reject. The order matters because each step converts a reporting problem you can read about into mail that disappears.

What key size should DKIM use?

2048 bits. RFC 8301 raised the floor from 1024, and every large mailbox provider verifies a 2048-bit key without complaint. The value is long enough that some DNS panels split it into two quoted strings, which is normal and resolves correctly.

Does a subdomain inherit the parent's records?

DMARC yes, SPF and DKIM no. A DMARC policy at the organisational domain covers subdomains unless you publish a separate record or set the subdomain policy tag. SPF and DKIM are looked up on the exact domain in the message, so a subdomain that sends mail needs its own records.

Sources

  1. RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in EmailIETF, read 2026-09-16
  2. RFC 6376: DomainKeys Identified Mail (DKIM) SignaturesIETF, read 2026-09-16
  3. RFC 7489: Domain-based Message Authentication, Reporting, and Conformance (DMARC)IETF, read 2026-09-16
  4. RFC 8301: Cryptographic Algorithm and Key Usage Update to DKIMIETF, read 2026-09-16
  5. Email sender guidelinesGoogle, read 2026-09-16
  • DomainsAdd a domain, publish the generated record set and send from it. A 2048-bit DKIM key per domain, a custom return path, and verification that runs on its own.
  • DMARC policy: none vs quarantine vs rejectWhat p=none, p=quarantine and p=reject each ask a receiver to do, how pct, sp and rua shape the policy, how to read reports, and the safe order to move up.
  • Email glossaryPlain definitions of the words that turn up in email infrastructure: DKIM, SPF, DMARC, bounces, complaints, suppressions, idempotency, webhooks and more.
  • DomainsAdd a domain, publish its records, verify it.
  • Transactional vs marketing email: how to send eachWhat separates transactional email from marketing email — the trigger, consent, unsubscribe headers and reputation — and how to send both from one API.
  • SecurityHow Rasket protects your mail and your account: isolation enforced in the database, encrypted secrets, hashed keys, signed webhooks, MFA, SSO, an audit log.

Start sending this morning

Sign up, verify a domain and send your first email in minutes.