Email authentication

How to Set Up SPF and DKIM When Several Services Send Your Email

One domain, many senders: merge every service into one SPF record, stay within 10 DNS lookups, move bulk mail to a subdomain and give each tool its own DKIM selector.

On this page

When Google Workspace or Microsoft 365, an ESP, a CRM and a help desk all send mail as one domain, each authentication record follows a different rule. SPF is a single TXT record per host name that every sender shares, so each service's include gets merged into it and the whole record has to stay within 10 DNS lookups. DKIM works per service: each tool publishes its own key under its own selector, and nothing gets merged. DMARC is one record over both that asks every service to line up with the domain in the From address.

Most of the trouble sits in SPF, since it is the only one of the three that several teams end up editing.

Setting up SPF, DKIM and DMARC across several sending platforms

Setting up SPF, DKIM and DMARC for multiple sending platforms starts with an inventory of every system that sends with your domain in the From address, plus the domain each one uses behind the scenes.

RecordHow manyWhere it livesWhat a new sender changes
SPFOne per host nameTXT at example.com, and at each sending subdomainAdds an include: or ip4: term to the existing record
DKIMOne key per selector, usually one or two selectors per serviceselector._domainkey.example.comAdds its own TXT or CNAME records next to the others
DMARCOne per domainTXT at _dmarc.example.comNothing, provided the service passes alignment

Why a second SPF record breaks the first

When the help desk admin and the marketing ops lead each follow their own vendor's setup screen, the domain ends up with two v=spf1 records. RFC 7208, the SPF standard published by the IETF, is blunt about it: "A domain name MUST NOT have multiple records that would cause an authorization check to select more than one record." A receiver that finds more than one returns permerror. Zendesk states the practical result: "If you have multiple records, it may cause issues, and cause rejections of your email."

How do you combine several services into one SPF record?

To combine multiple services into a single SPF record, keep one v=spf1 at the start, place every service's include: or ip4: term after it, and close with one all qualifier. Zendesk's help center shows the merge for a domain that also runs Google Workspace, where two separate records become v=spf1 include:_spf.google.com include:mail.zendesk.com -all. HubSpot gives the same instruction for its CRM: with a record already in place, you "will need to add HubSpot to the existing record, rather than creating a new one," then "Verify that the SPF version and -all flag are only included once."

Three details decide whether the merged record works:

  • Zendesk wants its include written in your domain's own record, outside any nested include. In its words, "If you use include:mail.zendesk.com, then it must be in the first-layer lookup."
  • Pick one qualifier. Microsoft recommends -all for Microsoft 365 domains because it also recommends DKIM and DMARC, and notes that DMARC policy is effectively ignored for ~all failures when the message carries no DKIM signature.
  • Long records get split into strings. RFC 7208 says multiple strings in one TXT record are treated as "concatenated together without adding spaces," so the space between two terms has to sit inside one of the strings. The RFC also advises keeping the record small enough to fit a 512-octet DNS reply.

How the 10 DNS lookup limit is counted

RFC 7208 caps the terms that trigger DNS queries at 10 per evaluation: the include, a, mx, ptr and exists mechanisms plus the redirect modifier. The ip4, ip6 and all terms cost nothing, and going over returns permerror. Microsoft adds that an include: domain that doesn't resolve or has no SPF record also makes SPF return permerror, a risk with any retired vendor's leftover include.

Nesting is where counts go wrong. Every include points to another SPF record, and any include, a or mx inside it counts as well. In Microsoft's words, "having fewer than 10 include: statements doesn't guarantee fewer than 10 DNS lookups." Receivers also evaluate left to right and stop at the first match, so an over-limit record can pass for mail matched by early terms and fail for mail matched later, which looks like an intermittent problem with one tool.

To count your own record, query the TXT record behind each include (nslookup -type=TXT _spf.google.com, for example), add one for every include, a, mx, ptr, exists or redirect you find, and repeat for each nested include.

A worked lookup count (hypothetical)

Picture a hypothetical company on example.com whose root record has collected terms over the years. The nested counts are assumptions for this example; vendors change their published records, so count yours on the day you edit.

Term in the root SPF recordDirectNested (assumed)Running total
a101
mx102
include:_spf.google.com103
include:mail.zendesk.com104
include: the HubSpot value from its setup screen105
include: a retired newsletter tool139
include: a sales engagement tool1212
-all0012

Twelve is over the limit; deleting the retired tool's include brings the total to 8, and dropping a and mx, if the servers they point at never send mail as the domain, brings it to 6.

Moving a sender to a subdomain

When the merged record still doesn't fit, one of Microsoft's three fixes is a subdomain. For email services that aren't under your direct control, such as bulk email services, it recommends a subdomain like marketing.contoso.com so problems there don't touch the reputation of employee mail, and notes that "Each subdomain has its own 10 lookup budget." The price is one more record, because the parent's SPF record "doesn't cover marketing.contoso.com."

Some ESPs build this in. A troubleshooting article from Klaviyo says the NS or CNAME records added for a branded sending domain "connect it to the SPF records Klaviyo manages," and that "Klaviyo does not require you to add a mechanism to an existing SPF record." SPF is checked against the envelope sender, the MAIL FROM address, as Microsoft's SPF page explains, so with a branded sending domain that check lands on the subdomain. Our Klaviyo vs HubSpot comparison for a B2C brand with 200,000 contacts covers the rest of that platform decision.

Microsoft's other two fixes are cutting the number of services that send from the domain and flattening, which swaps an include for the IP ranges behind it, for vendors with stable, documented IPs. It rules this out for include:spf.protection.outlook.com because its own sending IP addresses change frequently, and asks for a review of flattened entries at least quarterly.

A DKIM selector for every service

DKIM never needs a merge. Each service signs with its own private key and publishes the public half under a selector, the label in front of ._domainkey, and the receiver finds the right key from the s= value in the DKIM-Signature header. Different selectors are different DNS names, so they sit side by side.

  • Google Workspace: the default prefix selector is google, published as a TXT record at google._domainkey. Google adds, "If your domain already uses a DKIM key with the prefix google, enter a different prefix in this field."
  • Microsoft 365: two CNAMEs at selector1._domainkey and selector2._domainkey. Microsoft requires both, since only one selector is active at a time and the other takes over after a key rotation.
  • Zendesk: two CNAMEs, zendesk1._domainkey and zendesk2._domainkey, pointing at Zendesk. Zendesk warns that enabling digital signatures "must be the final step in the configuration process," because switching it on before the CNAMEs exist causes delivery failures.
  • HubSpot: two CNAME records from its domain connection steps.

The full record set for the hypothetical company

After the cleanup, which in this example also drops the sales engagement tool, the same hypothetical company sends staff mail from Google Workspace, sales email from HubSpot, support replies from Zendesk, and marketing from Klaviyo on send.example.com.

HostTypeValueCovers
example.comTXTv=spf1 include:_spf.google.com include:mail.zendesk.com include:123456.spf03.hubspotemail.net -allWorkspace, Zendesk, HubSpot
google._domainkeyTXTthe key generated in the Google Admin consoleWorkspace
zendesk1._domainkeyCNAMEzendesk1._domainkey.zendesk.comZendesk
zendesk2._domainkeyCNAMEzendesk2._domainkey.zendesk.comZendesk
two HubSpot selectorsCNAMEvalues from HubSpot's setup screenHubSpot
sendNS (or CNAME)values from Klaviyo's setupKlaviyo, including its SPF
_dmarcTXTone DMARC policyEvery sender

Under the same assumptions as the count above, the root SPF record now costs 3 lookups. HubSpot's page uses include:123456.spf03.hubspotemail.net as its example value; use the string your own account shows.

DMARC sits over all of it

One DMARC record at _dmarc covers the domain, and Microsoft notes that subdomains, defined or not, inherit the parent's DMARC settings unless a subdomain overrides them. What DMARC asks of each sender is alignment: Microsoft's DKIM guidance says DKIM "passes DMARC validation only if the domain that DKIM signed the message and the domain in the From address align." In Microsoft's own example, a bulk mailer's Return-Path stays on the vendor's domain while the DKIM d= value matches the From subdomain, so the message can pass DMARC through DKIM. Policy values and the move from p=none to enforcement are covered in our DMARC explainer, and where authentication fits in inbox placement in our guide to email deliverability.

Keeping the setup clean as tools arrive

Every tool that sends adds a line to the inventory, including the AI layers teams connect to an ESP, which we compared in AI email tools that work on top of the ESP you already have. Before a new one goes live, three answers settle most of the work: the envelope domain it sends from, the selector it signs with, and the lookups its include costs. Which tab a message lands in after it authenticates is a separate question, covered in why emails land in Gmail Promotions.

Our free Email Deliverability Checker gives a second look at what a domain publishes. Teams that want the sender inventory and DNS cleanup handled inside a wider lifecycle program can work with our lifecycle and demand generation team.

Sources

  • IETF: RFC 7208, Sender Policy Framework (SPF), sections 3.2, 3.3, 3.4, 4.5 and 4.6.4
  • Microsoft: Set up SPF to identify valid email sources for your Microsoft 365 domain
  • Microsoft: How to use DKIM for email in your custom domain
  • Google: Set up DKIM, Google Workspace Help
  • Zendesk: Allowing Zendesk to send email on behalf of your email domain
  • Zendesk: Digitally signing your email with DKIM
  • HubSpot: Manage your email authentication (updated September 22, 2026)
  • Klaviyo: DNS and SPF setup troubleshooting in Klaviyo (updated October 20, 2026)

Frequently asked questions

Can a subdomain have its own SPF record?
Yes. The one-record rule applies per host name, so example.com and send.example.com can each carry one SPF record. Microsoft's guidance says each subdomain that sends mail needs its own SPF TXT record, because the parent's record doesn't cover it, and each subdomain gets its own 10-lookup budget. That is why moving a bulk sender to a subdomain frees room in the root record.
Does every sending service need an include in my root SPF record?
Only services that send with your domain as the envelope sender, the MAIL FROM address that SPF checks. A Klaviyo branded sending domain, for example, connects a subdomain to SPF records Klaviyo manages, and Klaviyo says it does not require a mechanism in your existing record. Read each vendor's setup page before adding an include, because an unneeded one still costs a lookup.
What happens when an SPF record goes over 10 DNS lookups?
RFC 7208 says the check must return permerror. Microsoft says the destination system rejects the message with a non-delivery report, such as one saying it required too many lookups. Because evaluation runs left to right and stops at the first match, mail from services listed early can keep passing while mail from services listed later fails, which makes the problem look intermittent.
Can two services share one DKIM selector?
Give each service its own. A selector is one DNS name under _domainkey that should hold one service's public key. The vendors default to distinct names: google for Google Workspace, selector1 and selector2 for Microsoft 365, zendesk1 and zendesk2 for Zendesk. Google's setup page tells you to enter a different prefix if your domain already uses a key with the prefix google.
Should the merged SPF record end in -all or ~all?
Use one qualifier, once. Microsoft recommends -all for Microsoft 365 domains because it also recommends DKIM and DMARC, and it notes that DMARC policy is effectively ignored for ~all failures on messages without a DKIM signature. HubSpot's setup page asks you to verify that the SPF version and the -all flag appear only once after you add its include.

Free tools for this topic

FREE TOOLEmail Deliverability CheckerSPF, DKIM, DMARC and the 2026 inbox rules — graded.CALCULATOREmail Revenue CalculatorWhat is your list really worth per send — and per year?PLAYBOOKThe Lifecycle & Retention PlaybookEmail and SMS flows that compound revenue on autopilot.

Keep reading

GlossaryWhat Is Email Deliverability? Inbox Placement, ExplainedRead →GuidesWhy Emails Land in Gmail Promotions and What You Can ChangeRead →ComparisonsKlaviyo vs HubSpot for a B2C Brand With 200,000 ContactsRead →
CATALIST NEWSLETTER

Monthly dose of growth marketing.

Get marketing tips, narratives, guides, and playbooks delivered to your inbox.

Protected by reCAPTCHA — Google's Privacy Policy and Terms of Service apply.