LATYNEX Labs

GuideEditorial — Our editors' view, not vendor data.

Email sender domain setup: SPF, DKIM and DMARC explained

What each record does, what Gmail requires of bulk senders, the order to set them up in, and the mistakes that break delivery.

By Nikita LatyshevPublished Prices and specs update from our catalogue

The short answer

Three DNS records prove that mail claiming to come from your domain is really yours. SPF lists the servers allowed to send for the domain. DKIM adds a cryptographic signature to each message that receivers check against a public key you publish. DMARC tells receivers what to do when a message fails both checks and sends you reports. Gmail's published rules, in force from 1 February 2024, ask every sender to set up SPF or DKIM, and ask anyone who sends more than 5,000 messages a day to Gmail accounts to set up SPF, DKIM and DMARC, align the From domain with the SPF or DKIM domain, and support one-click unsubscribe in marketing mail.

For an online store the practical order is: set up the platform's own domain authentication for each tool that sends in your name (marketing platform, shop, helpdesk, transactional service), publish one SPF record that covers them, enable DKIM for each, and add DMARC at the monitoring policy first. The records are DNS entries, so the work is configuration and testing; check whether your DNS host or email tools charge for any part of it. For the platform side see our guides to moving between email platforms and email marketing pricing units.

Sources: [1], [2], [3], [4]

What each record does

SPF, DKIM and DMARC as the standards define them (RFCs and Gmail help read 3 November 2026)
RecordWhere it livesWhat it doesA fact worth knowing
SPFA TXT record on the domain, starting v=spf1Lists who may send for the domainAt most 10 DNS-lookup terms (include, a, mx, ptr, exists, redirect); only one SPF record per name
DKIMA TXT record at selector._domainkey.yourdomainPublishes the public key that verifies message signaturesThe signature covers the From header and a body hash; keys of 1024 bits or longer, 2048 recommended by Gmail
DMARCA TXT record at _dmarc.yourdomainSets the policy for failures and the report addressPolicy p= is none, quarantine or reject; rua= receives aggregate reports

Sources: [1], [2], [3], [4]

Two details cause most trouble. SPF allows at most ten DNS-lookup terms during evaluation (the standard counts include, a, mx, ptr and exists mechanisms and the redirect modifier, not ip4, ip6 or all); exceeding the limit produces a permanent error, so adding one "include" for every tool you try eventually breaks the record. And a domain must not publish more than one SPF record: the standard says multiple SPF records are not permitted for the same owner name, so a second tool's instructions must be merged into the existing record, not added as another.

Sources: [2]

SPF: who may send

How SPF qualifiers read (RFC 7208)
EndingResultWhat the standard says
-allfailAn explicit statement that the sender is not authorized to use the domain
~allsoftfailA weak statement that the host is probably not authorized; receivers should not reject on this result alone
?allneutralThe domain explicitly asserts nothing about whether the address is authorized
+allpass for everyoneThe all mechanism always matches, so +all authorizes every sender; this is our reading of the standard, not a sentence in it

Sources: [2]

DKIM: signing every message

A sender signs each message with a private key and publishes the matching public key in DNS at the name selector._domainkey.yourdomain, as a TXT record whose p= tag holds the key; an empty p= means the key has been revoked. The d= tag names the signing domain and the s= tag the selector, which lets a domain keep several keys at once, for example one per sending tool. The signature covers the From header, the other headers listed in h= and a hash of the body. RFC 6376 requires keys of at least 1024 bits for long-lived keys, and Gmail's help page says keys must be 1024 bits or longer and recommends 2048. In practice each sending platform gives you the selector and the record value to publish; you do not generate the signature yourself.

Sources: [4], [1]

DMARC: policy, reports and alignment

DMARC tags that matter first (RFC 7489, section 6.3)
TagValuesWhat it means
p=none, quarantine, rejectnone asks for no action; quarantine asks receivers to treat failing mail as suspicious; reject asks them to reject it
rua=mailto addressWhere aggregate reports are sent; without it receivers must not generate them
sp=same values as pPolicy for subdomains only; if absent, p applies to subdomains
pct=0 to 100, default 100Share of the mail stream the policy applies to
adkim= and aspf=r (relaxed) or s (strict), default relaxedHow closely the signing or SPF domain must match the From domain

Sources: [3]

DMARC passes when SPF or DKIM passes and the passing domain aligns with the domain in the visible From address. Under relaxed alignment the organizational domains must match; under strict alignment only an exact domain match counts. That is why a marketing tool that sends from its own domain but shows your address in From still fails DMARC unless it signs with your domain or uses an aligned return path. Gmail's page says the DMARC policy for bulk senders can be set to none, so a monitoring policy meets that requirement; moving to quarantine or reject later is your decision once the reports show every legitimate sender passes.

Sources: [3], [1]

What Gmail requires

Gmail sender requirements as its help page states them (read 3 November 2026; in force from 1 February 2024)
Applies toRequirement
All senders: authenticationSet up SPF or DKIM for sending domains; DKIM keys 1024 bits or longer, 2048 recommended
All senders: infrastructureValid forward and reverse DNS for sending IPs; use a TLS connection; follow RFC 5322 message format
All senders: conductKeep the spam rate below 0.3% in Postmaster Tools; do not impersonate Gmail From headers
More than 5,000 messages a day to Gmail accountsSet up SPF and DKIM; set up DMARC (the policy can be none); align the From domain with the SPF or DKIM domain
Marketing and subscribed messages from those sendersSupport one-click unsubscribe and include a clearly visible unsubscribe link in the body
MonitoringA stricter target of a spam rate below 0.10%, and avoid reaching 0.30% or higher

Sources: [1]

The page states a threshold of more than 5,000 messages a day to Gmail accounts and does not say that smaller senders may skip authentication: the all-senders list already asks for SPF or DKIM. It gives no timeframe for honouring an unsubscribe request, so we do not state one. Other mailbox providers publish their own rules, which we did not read.

Sources: [1]

A sensible order of work

Setup sequence for a store sending marketing and transactional email (editorial)
StepWhat to doHow to check
1 List sendersMarketing platform, shop, helpdesk, transactional service, invoicing, anything that sends in your nameOne written list
2 SPFPublish one v=spf1 record that includes each sender, ending -all or ~allCount lookup terms; confirm only one SPF record exists
3 DKIMEnable DKIM in each platform and publish the selector record it gives youEach platform shows the domain as verified; send a test and read the headers
4 DMARCPublish _dmarc with p=none and a rua addressReports arrive and list every legitimate sender as passing
5 AlignmentMake each sender sign with your domain or use an aligned return pathTest messages pass DMARC alignment in the headers
6 TightenMove p to quarantine, then reject, when reports are cleanWatch reports for a failed legitimate sender after each change

Editorial opinion

Common mistakes

Mistakes that break authentication (editorial, grounded in the standards above)
MistakeWhy it breaksFix
Two SPF recordsThe standard does not allow multiple SPF records for one nameMerge them into one record
More than 10 lookup termsEvaluation fails with a permanent errorRemove unused includes or use fewer senders
SPF with +allIt authorizes every senderUse -all or ~all
DKIM key under 1024 bitsBelow the minimum the standard and Gmail ask forUse 2048 bits where the platform allows
DMARC without a reachable rua addressNo reports, so you cannot see failuresPublish a monitored rua address
Tool sends with its own domain in the signatureDMARC alignment failsUse the tool's custom-domain authentication
Jumping straight to p=rejectA legitimate sender you forgot is rejectedStart at none and read the reports

Editorial opinion

Frequently asked questions

What are SPF, DKIM and DMARC?

SPF lists the servers allowed to send for your domain, DKIM signs each message so receivers can verify it against a public key in your DNS, and DMARC tells receivers what to do when a message fails both and where to send reports.

Do I need all three?

Gmail's help page asks every sender to set up SPF or DKIM, and senders of more than 5,000 messages a day to Gmail accounts to set up SPF, DKIM and DMARC, with the From domain aligned to the SPF or DKIM domain. Setting up all three is the safe course.

What DMARC policy should I start with?

Gmail's page says the DMARC policy for bulk senders can be set to none. Starting at none with a report address lets you see every sender before you move to quarantine or reject.

Why does my SPF record fail with many tools?

SPF allows at most ten DNS-lookup terms and only one SPF record per name, so each added include uses part of the budget and a second record is not allowed; merge the senders into one record.

Do transactional emails need unsubscribe links?

Gmail's page states the one-click unsubscribe requirement for marketing and subscribed messages and does not extend it to transactional mail; your platforms and local law may differ, so check them.

Sources: [1], [2], [3]

Sources and checks

Sources

  1. [1]Google: email sender guidelines (Gmail requirements) · cited · checked 3 Nov 2026
  2. [2]RFC 7208: Sender Policy Framework (SPF) · cited · checked 3 Nov 2026
  3. [3]RFC 7489: DMARC · cited · checked 3 Nov 2026
  4. [4]RFC 6376: DomainKeys Identified Mail (DKIM) signatures · cited · checked 3 Nov 2026

Nikita Latyshev

Founder, LATYNEX Labs

Nikita Latyshev is the founder of LATYNEX Labs, an independent publication about business software and infrastructure. LATYNEX Labs is published by Latynex Trade OÜ, Estonia. How the site checks facts, handles sponsorship and earns money is described on its methodology, editorial policy and affiliate disclosure pages.