Skip to content
DFY Inbox Setup

SPF, DKIM and DMARC Setup for Cold Email

The exact records for Google Workspace and Microsoft 365, where to add them at GoDaddy, Namecheap, Cloudflare and Porkbun, how to check they pass, and the mistakes that quietly break them.

Photo of Farhan MujahidBy Farhan MujahidFounder and CEO, DFY Inbox Setup

Updated · 11 min read

Authentication is how a receiving server knows an email really came from your domain. Since 2024, Google’s sender guidelines and Yahoo’s best practices require SPF, DKIM and DMARC from anyone sending in bulk, and Microsoft followed for Outlook.com in 2025. For cold email, where you send from new domains to people who do not know you yet, these records are the minimum.

What each record does

RecordWhat it doesWhere it goes
MXTells the world which server receives your email, so replies arriveRoot of the domain (@)
SPFLists the servers allowed to send email for your domainTXT record at @
DKIMSigns every email so receivers can confirm it was not changedTXT or CNAME at a selector
DMARCSays what to do when SPF or DKIM fail, and where to send reportsTXT record at _dmarc

DMARC only passes when SPF or DKIM passes and matches the domain in the From address. That match is called alignment, and it is why records copied from another domain do not work. For a deeper explanation, DMARC.org has a clear overview.

Google Workspace records

Add these at your domain registrar or DNS host, replacing the placeholders with your own values:

TypeHostValue
MX@smtp.google.com (priority 1)
TXT@v=spf1 include:_spf.google.com ~all
TXTgoogle._domainkeyv=DKIM1; k=rsa; p=(your public key)
TXT_dmarcv=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
  1. Add the MX and SPF records and wait for Google to verify the domain.
  2. In the Google Admin console, go to Apps, Google Workspace, Gmail, Authenticate email. Generate a 2048-bit DKIM key, copy the TXT record into your DNS, wait a little, then click Start authentication. Google’s DKIM help page shows each screen.
  3. Add the DMARC record last.
Google Admin console Authenticate email page showing the google._domainkey DKIM record to add
Google Admin, Authenticate email: copy this TXT record into your DNS, then click Start authentication. Domain and key hidden.

Using IMAP and SMTP with a sending tool? See the server settings on our Google Workspace inboxes page.

Microsoft 365 records

Microsoft gives you the exact values in the Microsoft 365 admin center when you add a domain. They follow this pattern, where yourdomain-com is your domain with dots replaced by dashes:

TypeHostValue
MX@yourdomain-com.mail.protection.outlook.com (priority 0)
TXT@v=spf1 include:spf.protection.outlook.com -all
CNAMEselector1._domainkeyselector1-yourdomain-com._domainkey.(your tenant).(letter)-v1.dkim.mail.microsoft
CNAMEselector2._domainkeyselector2-yourdomain-com._domainkey.(your tenant).(letter)-v1.dkim.mail.microsoft
TXT_dmarcv=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
CNAMEautodiscoverautodiscover.outlook.com

After the CNAME records are live, turn on DKIM signing for the domain in the Microsoft Defender portal under Email authentication settings. Microsoft’s DKIM configuration guide has the details. Domains added to Microsoft 365 since May 2025 get the newer target shown above, ending in dkim.mail.microsoft. Domains added before then still end in onmicrosoft.com. Either way, copy the values from your own portal rather than typing them by hand: one wrong dash leaves DKIM off.

Microsoft Defender DKIM panel showing signing disabled and the two selector CNAME records to publish
Microsoft Defender, DKIM: publish the two CNAME records it lists, wait for them to sync, then switch signing on. Domain and values hidden.

More on Outlook inboxes for cold email on our Microsoft 365 inboxes page.

Adding records at your registrar

First, find out where your DNS lives. Records must be added wherever your nameservers point, which is not always where you bought the domain. If you bought a domain at Namecheap but moved its nameservers to Cloudflare, add every record in Cloudflare. A lookup on MXToolbox with the DNS lookup option shows your current nameservers.

One rule applies everywhere: most DNS hosts add your domain to the host name for you. Type _dmarc, not _dmarc.yourdomain.com, or you end up with _dmarc.yourdomain.com.yourdomain.com and the record never works.

GoDaddy

  1. Sign in, open your domain list, and choose the domain. Open DNS (shown as Manage DNS on some accounts).
  2. Click Add New Record, pick the type, and enter @ as the name for the root or _dmarc for DMARC.
  3. GoDaddy often adds its own SPF record or forwarding records. Edit the existing SPF record instead of adding a second one, and delete old MX records that point at GoDaddy email.
GoDaddy DNS page with MX, SPF, DKIM and DMARC records for Google Workspace
A finished Google Workspace setup in GoDaddy: MX, one SPF record, DKIM at google._domainkey and DMARC at _dmarc. Values hidden.

Namecheap

  1. Open Domain List, click Manage next to the domain, then open the Advanced DNS tab.
  2. Under Host Records, click Add New Record. Use @ for the root.
  3. MX records live in the Mail Settings section further down. Switch it to Custom MX before adding the Google or Microsoft MX record, or Namecheap keeps its own email forwarding in place.

Cloudflare

  1. Select the domain, then open DNS and Records, and click Add record.
  2. Use @ or the bare domain for root records. Cloudflare shows the full name once saved.
  3. Set every CNAME record (Microsoft DKIM selectors and autodiscover) to DNS only, the grey cloud. Proxied records break DKIM and mail client setup.

Porkbun

  1. Open Domain Management, find the domain, and open its DNS records.
  2. Leave the host field empty for root records such as MX and SPF. Porkbun treats an empty host as the root. Enter _dmarc for DMARC.
  3. Remove the default parking records if you are pointing the domain somewhere new.
Porkbun default DNS records: parking ALIAS and CNAME, forwarding MX records and a Porkbun SPF record
What a new Porkbun domain starts with: parking records, forwarding MX and Porkbun's own SPF. Delete these before adding Google or Microsoft records, or you end up with two SPF records.

This is also how we handle customers who keep DNS with their own registrar. Instead of asking for a login, the order page lists every record for every domain in exactly this format, with a Check DNS button that looks each one up live, so nobody has to guess whether a record went in correctly.

The records for one sending domain on a DFY Inbox Setup order page: an MX record, an SPF record, a DKIM record at google._domainkey and a DMARC record at _dmarc, each with a copy button and a Check DNS button.
The records for one Google Workspace domain, as customers see them on an order (demo data, DKIM key shortened).

Do you need DMARC for cold email?

Yes. Some guides still call DMARC optional, but that changed in 2024. Gmail and Yahoo require a DMARC record from anyone sending 5,000 or more emails a day to their users, and Outlook.com added the same rule for high volume senders in 2025. Even below those volumes, a domain with SPF, DKIM and DMARC looks more trustworthy than one without.

For cold email domains, start with p=none. It meets the requirement, blocks nothing, and sends you reports showing which servers are sending as your domain. Cold email domains rarely need a stricter policy, because nothing else sends from them. You can move to p=quarantine once your reports show SPF and DKIM passing every time.

Choosing a DMARC policy

PolicyWhat happens to failing emailWhen to use it
p=noneDelivered as normal, reported to youNew domains and the first weeks of sending
p=quarantineSent to spamOnce SPF and DKIM pass consistently
p=rejectRefused outrightMature domains with no other services sending

Always include a rua address so you receive reports. Reading the raw reports is hard, so a free tool such as Learn DMARC helps you see what a DMARC check looks like step by step.

How to check your records pass

  1. Run the domain through our free email deliverability checker, which checks MX, SPF, DKIM and DMARC at once, or the SPF, DKIM and DMARC checkers one by one. The Google Admin Toolbox Check MX works too.
  2. Send an email from the new inbox to a Gmail address, open it, and choose Show original. You want to see SPF: PASS, DKIM: PASS and DMARC: PASS. Paste the headers into our email header analyzer to read them at a glance.
  3. Send a test to Mail Tester for a score that also checks content and blocklists.

What a failing result means

ResultUsual causeFix
SPF: FAIL or PERMERRORTwo SPF records, a typo, or more than 10 lookupsMerge into one record and remove unused includes
SPF: NONERecord missing or added to the wrong hostAdd a TXT record at @ that starts with v=spf1
DKIM: NONESigning not switched on yetStart authentication in Google Admin or turn on DKIM in Microsoft Defender
DKIM: FAILWrong or truncated key, or a proxied CNAMECopy the record again in full; set CNAMEs to DNS only
DMARC: FAILSPF and DKIM pass, but for a different domainSend from an address on the domain you authenticated
DMARC: NONENo record at _dmarcAdd the DMARC TXT record at _dmarc
Found in the Show original view in Gmail, or the Authentication-Results line of any email header.

After a fix, wait for the change to spread (usually minutes, up to 48 hours), then send a fresh test. Old emails keep their old results.

Common mistakes that break authentication

  • Two SPF records. A domain can only have one. Two records make SPF fail entirely, so merge them into one. Our SPF checker flags this straight away.
  • Too many SPF lookups. SPF allows at most 10 DNS lookups. Every include counts, so remove services you no longer use.
  • DKIM added but not switched on. The record alone does nothing until signing is started in Google Admin or Microsoft Defender.
  • DMARC on the wrong host. It must sit at _dmarc, not at the root of the domain.
  • Proxied DNS records. On Cloudflare, DKIM CNAME records must be set to DNS only, not proxied.
  • Copying records between domains. DKIM keys are unique to each domain and tenant. Copied keys fail.

Authentication is one part of deliverability. Our deliverability guide covers volume, warm-up and list quality, and our step-by-step guide shows how the whole setup fits together.

Frequently asked questions

Do I need SPF, DKIM and DMARC for cold email?

Yes. Google and Yahoo require all three for bulk senders since 2024, and Microsoft requires them for high volume senders to Outlook.com. Without them, cold email is far more likely to land in spam or be rejected.

How long do DNS records take to work?

Often a few minutes, but changes can take up to 48 hours to reach every server. Check with a lookup tool before you start warm-up.

Which DMARC policy should I use for cold email domains?

Start with p=none and a reporting address so you can see results without blocking anything. Once SPF and DKIM pass consistently, you can move to quarantine.

Do I need DMARC for cold email if I already have SPF and DKIM?

Yes. Gmail and Yahoo require a DMARC record from bulk senders, and Outlook.com requires one from high volume senders. A p=none record is enough to meet the requirement and costs nothing.

In what order should I set up SPF, DKIM and DMARC?

Add MX and SPF first, then publish the DKIM record and switch on signing in Google Admin or Microsoft Defender, then add DMARC last. DMARC depends on the other two, so adding it first only produces failing reports.

Should SPF end in ~all or -all?

Both work. ~all (soft fail) asks receivers to treat unlisted senders with suspicion, while -all (hard fail) asks them to reject. Google suggests ~all, Microsoft suggests -all, and with DMARC in place the difference is small. What matters more is having exactly one SPF record.

How do I combine two services in one SPF record?

Put every include in a single record, for example v=spf1 include:_spf.google.com include:sendgrid.net ~all. Never publish a second SPF record for the new service, because two records make SPF fail.

Where do I add the records if my domain uses Cloudflare nameservers?

Add them wherever your nameservers point. If the domain was bought at GoDaddy or Namecheap but uses Cloudflare nameservers, records added at the registrar are ignored; add them in Cloudflare instead.

Can someone set up SPF, DKIM and DMARC for me?

Yes. A setup service can add and verify the records for you. We do it on every domain in every inbox order, and we check each one by hand before the inboxes are handed over.

Your next campaign could be sending by the end of the week.

Create a free account, build your order in a few minutes and request a quote. You only pay when you are happy with it.