How to add SPF, DKIM and DMARC records to a Shopify domain
Updated · 8 min read
In short
- Only Shopify-managed domains can be edited in Shopify, and their TXT values stop at 255 characters, with no splitting.
- Microsoft 365's DKIM CNAMEs fit. Google Workspace's 2048-bit key does not: a 1024-bit key is a stopgap, and moving the DNS elsewhere is the lasting fix.
- Shopify inserts a p=none DMARC record. Edit it to add a reporting address, then move to p=quarantine; never delete it or add a second one.
On this page
- Which domains you can change in Shopify
- Adding a record, and the 255-character limit
- What Shopify already publishes
- SPF for the mail you send from elsewhere
- DKIM: CNAMEs fit, a 2048-bit TXT key does not
- DMARC: Shopify's p=none is where to start, not where to stop
- How to confirm it worked
- What commonly goes wrong on Shopify
- Sources, and how current this guide is
Shopify can edit DNS only for a domain it manages: one bought through Shopify or transferred to it. For those domains its DNS editor has a limit that decides how you publish DKIM. A TXT value can be at most 255 characters, and Shopify says a longer one cannot be split into several strings, so a 2048-bit DKIM key like the one Google Workspace recommends does not fit.
This guide covers what Shopify publishes for you, what you add for Google Workspace, Microsoft 365 or another mail service, and the honest choices when a key is too long.
Checked against Shopify help, 2026-11-19. Shopify can rename a menu or move a button without notice, so treat the labels below as a dated snapshot: where your screen differs, look for the field each step describes. The pages we read are listed at the end, and where they say nothing, this guide says so rather than guessing.
Check yours now
Which domains you can change in Shopify
Shopify's DNS editor is for Shopify-managed domains. A store still on its myshopify.com address has to add a custom domain first. A domain bought elsewhere and only connected to Shopify keeps its DNS at that provider, and Shopify says its support can't log in to your account there for you, even with your explicit permission.
So for a connected domain, follow the guide for whoever hosts its DNS; the lookup below names them.
dig +short NS example.comAdding a record, and the 255-character limit
From your Shopify admin, go to Settings, then Domains, and select the domain. In the DNS settings section select Manage, then Add custom record, choose the record type, enter the details and select Confirm. Existing records are changed or deleted from Actions, with Edit or Remove. The editor offers A, AAAA, CNAME, MX, TXT and SRV records.
- Name: @ for the domain itself and _dmarc for DMARC, as Shopify's email articles show. Shopify's DNS page also says not to edit the name field when adding an MX or TXT record. Read that as applying to records at the domain itself: DMARC has to be at _dmarc, as Shopify's own DMARC steps show.
- TXT value: at most 255 characters. A longer value is refused with “Value is too long (maximum is 255 characters)”, and Shopify says it cannot be split into multiple strings or wrapped in quotation marks.
- CNAME: you can have several, each with a name of its own.
- TTL: Shopify's DNS help does not mention a TTL setting.
One more thing to know before you start: the Reset option on that page deletes every record except the A, AAAA and CNAME records it points back at Shopify. A reset takes your SPF, DMARC, MX and any DKIM key published as text with it.
Type TXT Name @
Value: v=spf1 include:spf.protection.outlook.com ~all
Type CNAME Name selector1._domainkey
Value: copied from the Microsoft Defender portal
Type CNAME Name selector2._domainkey
Value: copied from the Microsoft Defender portal
Type TXT Name _dmarc
Value: v=DMARC1; p=quarantine; rua=mailto:dmarc@example.comWhat Shopify already publishes
If you bought the domain through Shopify, Shopify says email authentication is configured automatically, including DKIM, SPF and DMARC, and that it inserts a DMARC record of v=DMARC1; p=none if the domain has none. For the mail Shopify sends on your behalf, its CNAME records take care of SPF and DKIM, so no separate SPF TXT record is needed for that mail.
You can see the state of it under Settings, then Notifications, in the Sender email section. Email domain authentication shows Propagating while records spread, Authenticated once all of them are found, and Update recommended when records are missing or new ones are available. Shopify warns that removing the CNAME records it added can cause bounces.
SPF for the mail you send from elsewhere
Mail from your own mailbox — Google Workspace, Microsoft 365 or anything else — needs an SPF record at @ naming that service: v=spf1 include:_spf.google.com ~all for Google Workspace, v=spf1 include:spf.protection.outlook.com ~all for Microsoft 365.
Shopify's email forwarding has an SPF value of its own, which Shopify asks you to add as a TXT record at @: v=spf1 include:_spf.hostedemail.com ~all. Its forwarding steps do not mention merging, so watch for this: forwarding and a mailbox service each adding an SPF record leaves the domain with two, and receivers then honour neither. Shopify also says forwarding is affected once another mail service's MX records are added, so when your mail moves to a mailbox provider, drop the forwarding include rather than keeping both.
Keep the record short as well as single. The 255-character limit applies to SPF too, and so does the ten-lookup limit on the whole record.
Those values, Shopify's forwarding one included, end in ~all. Treat that ending as where you start: once DMARC reports show every service that sends as you passing, change it to -all. Microsoft's SPF documentation says why it is worth doing, since DMARC can do little with a soft fail on a message that has no DKIM signature.
DKIM: CNAMEs fit, a 2048-bit TXT key does not
If your mail provider publishes DKIM as CNAME records, length is not a problem. Microsoft 365 uses two, named selector1._domainkey and selector2._domainkey, with targets from Microsoft's Defender portal: add each as a CNAME, then turn on signing in Defender.
Google Workspace publishes DKIM as a TXT record named google._domainkey, and its 2048-bit key is about 410 characters, too long for Shopify. Shopify's help names three ways out: generate a 1024-bit key instead, which fits; ask the email service for a value of 255 characters or fewer; or transfer the domain to a provider that supports longer TXT records.
They are not equally good. A 1024-bit key is what Google offers for hosts that cannot hold a longer one, and mail signed with it still verifies, but 2048 bits is the current recommendation and our DKIM checker reports a 1024-bit key as a warning. If you take that route, treat it as a stopgap with a date on it. Moving the domain to a DNS host that stores a 2048-bit key whole is the lasting fix.
Do not split the key across two TXT records to get round the limit. Two records each holding half a key are two invalid keys, and DKIM then fails for every message.
DMARC: Shopify's p=none is where to start, not where to stop
Shopify requires at least v=DMARC1; p=none and inserts that record on a domain it manages if there is none. Two rules from Shopify's help matter here. First, the domain must have only one DMARC record: with several, validation fails and Shopify rewrites your sender address to a shopifyemail.com address. Second, removing or reverting the record has the same effect. So edit the record Shopify created, in the domain's DNS settings, rather than adding a second one or deleting it.
What to change: p=none asks receivers to take no action on mail that fails, so on its own it protects nothing, and Shopify's record has no rua address, so nobody receives reports. Add a reporting address first, making the record v=DMARC1; p=none; rua=mailto:dmarc@example.com with a mailbox at your own domain. Once the reports show Shopify and every other service that sends as you passing SPF or DKIM for your domain, change p=none to p=quarantine, and later to reject. Shopify notes that a record already using strict alignment needs no change for its purposes.
The 255-character limit applies to this record as well, so keep the list of reporting addresses short.
How to confirm it worked
Shopify's DNS page says changes can take up to 24 hours to take effect, and its email setup page allows up to 48 hours. Shopify also advises against making further DNS changes while one is still propagating, because that can restart the wait.
The Email domain authentication status covers Shopify's own sending. For everything else, read the records back: one v=spf1 line, the DKIM records your mail provider needs, and one DMARC record. Then run the SPF checker, the DKIM checker with your selector, and the DMARC checker, which states the policy receivers will apply, and send a message to an outside mailbox: spf=pass, dkim=pass and dmarc=pass in its Authentication-Results header is the result to look for.
# exactly one line, starting v=spf1
dig +short TXT example.com | grep spf1
# Microsoft 365
dig +short CNAME selector1._domainkey.example.com
# Google Workspace, if the key fitted
dig +short TXT google._domainkey.example.com
# exactly one v=DMARC1 record
dig +short TXT _dmarc.example.comWhat commonly goes wrong on Shopify
- A 2048-bit key pasted into the TXT value, refused as too long, and then split across two records.
- Shopify's DMARC record deleted, which makes Shopify rewrite your sender address.
- A second DMARC record added instead of an edit to the one Shopify created.
- The forwarding SPF record kept after a mailbox provider's SPF record was added beside it.
- Reset used on the DNS settings page, removing SPF, DMARC and MX records along with everything else that is not an A, AAAA or CNAME record.
- Looking in Shopify for the DNS settings of a domain registered elsewhere.
Sources, and how current this guide is
We read every page below on 2026-11-19 and wrote this guide from what they say, without screenshots, which go out of date faster than the text beside them.
From Shopify's own help:
- Editing the DNS settings for your Shopify-managed domain (help.shopify.com)
- Displaying your store's sending email (help.shopify.com)
- Setting up your email (help.shopify.com)
- Setting up email forwarding for a Shopify-managed custom domain (help.shopify.com)
- Setting up email hosting for a Shopify-managed domain or a third-party domain (help.shopify.com)
- Troubleshooting issues with domains connected to Shopify (help.shopify.com)
- Considerations for using a third-party domain for your online store (help.shopify.com)
- Building and maintaining your email deliverability (help.shopify.com)
From Google's and Microsoft's documentation, read the same day, for the steps that depend on the mail provider:
- Google Workspace Admin Help, Set up SPF (knowledge.workspace.google.com)
- Google Workspace Admin Help, Set up DKIM (knowledge.workspace.google.com)
- Microsoft Learn, Set up SPF to identify valid email sources for your Microsoft 365 domain (learn.microsoft.com)
- Microsoft Learn, How to use DKIM for email in your custom domain (learn.microsoft.com)
- Google Workspace Admin Help, Troubleshoot DKIM issues (knowledge.workspace.google.com)
Check your domain with the SPF checker