To set up email authentication, publish an SPF record that lists every service allowed to send for your domain, turn on DKIM signing for each of those services, then add a DMARC record at _dmarc.yourdomain.com starting with p=none. Read the reports for a few weeks, fix what fails, and only then move to quarantine and reject. This guide walks through each step for Microsoft 365 and Google Workspace, shows how to test the result, and explains the mistakes that most often break legitimate mail.
TL;DR
- SPF lists the servers allowed to send as your domain, DKIM signs each message, and DMARC tells receivers what to do when checks fail and sends you reports.
- Inventory every sender first (mail platform, billing, CRM, marketing, ticketing). A missed sender is the most common cause of valid mail failing DMARC.
- Publish exactly one SPF record, keep it under 10 DNS lookups, enable DKIM for every sender, then start DMARC at
p=nonewith a reporting address. - Verify with a test message and its Authentication-Results header, then tighten the policy gradually.
Table of Contents
- What SPF, DKIM and DMARC each do
- Before you touch DNS: build a sender inventory
- Step 1: Publish your SPF record
- Step 2: Enable DKIM signing
- Step 3: Add DMARC in monitoring mode
- Step 4: Verify that everything works
- Troubleshooting common failures
- Moving from monitoring to enforcement
- Our perspective
- Get it done without the guesswork
- FAQ
- Sources
What SPF, DKIM and DMARC each do
The three standards answer different questions about the same message.

SPF (Sender Policy Framework) is a DNS TXT record that lists the servers and IP addresses authorized to send email for a domain. The receiving server compares the sending IP to that list.
DKIM (DomainKeys Identified Mail) lets a domain owner sign outgoing messages with a private key. Receivers use the public key published in DNS to verify the signature, which shows the message was not altered in transit.
DMARC (Domain-based Message Authentication, Reporting and Conformance) ties the two together. It tells receiving servers what to do with mail that fails authentication: deliver it normally, quarantine it, or reject it. It also sends aggregate reports back to you.
Why SPF and DKIM alone are not enough
SPF only checks the MAIL FROM (envelope) domain. Microsoft documents that it does not consider the domain in the visible From address, so an attacker can pass SPF on their own domain while displaying yours. DMARC closes that gap by requiring alignment: the domain that passed SPF or DKIM must match the From address the recipient sees.
DMARC passes when either SPF or DKIM passes with alignment. It does not need both. You should still configure both, because SPF commonly fails on forwarded mail while DKIM can keep validating.
| Standard | What it checks | Where it lives in DNS | Survives forwarding? |
|---|---|---|---|
| SPF | Sending server is authorized for the envelope domain | TXT record at the domain root | Often not |
| DKIM | Message signature matches the published public key | TXT or CNAME at selector._domainkey | Usually, if the message body is unchanged |
| DMARC | SPF or DKIM passes and aligns with the From domain | TXT record at _dmarc | Depends on the underlying checks |
Before you touch DNS: build a sender inventory
The step that decides whether your rollout is smooth is a complete list of everything that sends email as your domain. Missing even one service can cause valid mail to fail DMARC, so spend time here.
Check these sources:
- Your main mailbox platform: Microsoft 365 or Google Workspace.
- Line-of-business software: accounting and invoicing, practice management, loan origination, patient portals, e-signature tools.
- Marketing and newsletter platforms.
- Help desk and CRM systems that send notifications from your address.
- Website forms and plugins, which often send through the web host.
- Devices: multifunction printers and scanners that scan to email.
- Vendors acting on your behalf, such as payroll providers or outsourced billing.
Ask each department which tools send mail to customers. Then confirm in DNS and in your mail logs. For each sender, record whether it can sign with your domain (DKIM) and what SPF include value it publishes.
Also make sure you can edit DNS. The records go wherever your domain's name servers are hosted, which may be your registrar, a DNS host, or a managed IT provider. Google also advises that you turn on SPF and/or DKIM first and allow about 48 hours before setting up DMARC.
Step 1: Publish your SPF record
An SPF record is a single TXT record at your domain root. A basic example for a domain that sends only through Google Workspace:
v=spf1 include:_spf.google.com ~all
For a domain that sends only through Microsoft 365, Microsoft's SPF guidance uses the spf.protection.outlook.com include, as shown in its SPF setup documentation:
v=spf1 include:spf.protection.outlook.com -all
If you also send through other services, add their include values to the same record, for example:
v=spf1 include:spf.protection.outlook.com include:servers.mcsv.net -all
Rules that prevent SPF failures
- One record only. Publishing multiple SPF records causes SPF checks to fail. If a second tool tells you to add its own SPF record, merge its include into your existing one instead.
- Stay within 10 DNS lookups. SPF evaluation is capped at 10 lookups, and exceeding the limit produces a PermError. The mechanisms that count are include, a, mx, ptr, exists and redirect. The ip4, ip6 and all mechanisms do not count.
- Choose the ending deliberately.
~allis a soft fail and-allis a hard fail. Either works. Move to-allonce you are confident every legitimate sender is listed. - Remove senders you no longer use. Old includes consume lookups and widen who can send as you.
If you have many senders and are close to the lookup limit, you will need to consolidate services, move some to subdomains, or use an SPF management approach. A record that is valid on paper but over the limit protects nothing, because receivers treat it as an error.
You can draft and sanity-check a record with our SPF and DMARC record generator.
Step 2: Enable DKIM signing
DKIM setup differs by platform because each provider generates its own keys. The principle is the same: publish the public key (or a CNAME pointing to it) in DNS, then switch signing on.
DKIM in Microsoft 365
Microsoft 365 generates two key pairs when you enable DKIM for a custom domain, and two CNAME records, called selectors, point to the public keys. The steps:
- In the Microsoft Defender portal, open the email authentication settings under Threat policies and select the DKIM tab.
- Select your domain and copy the two CNAME values shown. Use the values the portal gives you, not examples from documentation, because they are specific to your tenant.
- Create both CNAME records in your DNS host:
selector1._domainkeyandselector2._domainkey. - Wait for DNS to propagate, then turn on the signing toggle for the domain.
Repeat this for every custom domain and subdomain in the tenant that sends mail. Our Microsoft 365 email security guide covers where authentication fits among the other priority controls.
DKIM in Google Workspace
- In the Google Admin console, go to the Gmail settings and open the Authenticate email page.
- Select your domain and generate a new record, choosing a 2048-bit key length if your DNS host supports it.
- Copy the TXT record host name and value into your DNS.
- Return to the Admin console and click Start authentication once the record is live.
Google's DMARC documentation assumes SPF and/or DKIM is already running, so complete this step first. Our Google Workspace security checklist places this alongside the other admin settings worth reviewing.
DKIM for every other sender
Each third-party service that sends as your domain needs its own DKIM record, published at that provider's selector subdomain. Most platforms call this "domain authentication" or "sender authentication" and give you CNAME or TXT values to paste into DNS. Until you do this, the service signs with its own domain, which can pass DKIM but will not align with your From address.
Step 3: Add DMARC in monitoring mode
A DMARC record is a TXT record at _dmarc.yourdomain.com. Start with a policy of none, which monitors without affecting delivery:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com
The tags you will use most often are:
| Tag | Meaning |
|---|---|
v | Protocol version, must come first |
p | Policy for the domain: none, quarantine or reject |
rua | Address that receives aggregate XML reports |
adkim | DKIM alignment mode: relaxed (r) or strict (s) |
aspf | SPF alignment mode: relaxed (r) or strict (s) |
sp | Policy for subdomains |
These tags are described in this email authentication reference. Relaxed alignment is the default and suits most businesses, because it lets a subdomain such as mail.yourdomain.com align with your main domain.
Use a dedicated mailbox or a report-processing service for the rua address. Aggregate reports are XML files from many receivers, and they are unreadable at any volume without a tool that turns them into a list of sources and pass/fail results. For a small-business walkthrough of this stage, see our DMARC for small business guide.
Step 4: Verify that everything works
After publishing, check the records first and the behavior second.
- Confirm the records exist. Query DNS with
dig TXT yourdomain.com,dig TXT _dmarc.yourdomain.com, and the DKIM selector hosts. DNSimple's guide lists the exact commands. - Send a real test message from your domain to a Gmail address.
- Open the original message. In Gmail, choose Show original and read the Authentication-Results header. You want to see
spf=pass,dkim=passanddmarc=pass. - Repeat for every sender in your inventory, not only your mailbox platform. Send a test invoice, a form submission, a newsletter and a scan-to-email message.
If you would rather not read raw headers, paste one into our email header analyzer, which reports the SPF, DKIM and DMARC results in plain terms.
Troubleshooting common failures
SPF passes but DMARC fails. The domain that passed SPF is not the domain in the From address. This is typical of third-party senders using their own return path. Fix it by configuring the service to use your domain, or rely on aligned DKIM instead.
DKIM shows a pass but no alignment. DMARC Engine's documentation describes this case: the signature validated, but the d= domain does not match the From domain. The fix is either adjusting the DKIM alignment mode or having the sending platform sign with your domain instead of its own.
SPF PermError. You have likely crossed the lookup limit. The same troubleshooting reference calls this the most common SPF failure mode, especially when several services each add an include. Audit and remove unused senders first.
Forwarded mail fails. Forwarding changes the sending IP, which breaks SPF. If the forwarder also modifies the message, DKIM can break too. Microsoft notes that ARC can preserve the original authentication results of modified messages, which is one reason receivers look beyond a single failed check.
Legitimate mail appears in reports from unknown sources. Investigate before assuming abuse. It is often a forgotten tool, an old vendor or a department's own subscription. Add it properly or shut it down.
Moving from monitoring to enforcement
A p=none record produces reports but does not stop spoofed mail. Enforcement is the goal, and the way to reach it safely is gradual.
- Monitor at
p=nonefor several weeks, covering at least one full business cycle such as month-end billing. - Fix every legitimate source that fails alignment until your reports show only expected senders passing.
- Move to
p=quarantine. Failing mail goes to spam folders. Watch for complaints and missing messages. - Move to
p=reject. Failing mail is refused. This is the strongest protection against someone sending as your domain. - Set a subdomain policy with
spso unused subdomains cannot be abused.
No outcome is guaranteed by the record alone. Reject is only as accurate as your sender inventory, so a jump to enforcement without clean reports risks blocking real invoices and customer messages.
One more reason to finish the work: large mailbox providers set requirements for bulk senders. Reports describe Gmail and Yahoo as requiring SPF, DKIM and DMARC with alignment from senders of roughly 5,000 or more messages a day, along with one-click unsubscribe and a low spam complaint rate, per this deliverability checklist. Even if you send far less, the same records improve how your mail is judged.
Our perspective
Most authentication projects stall for the same reason: nobody owns the sender inventory. DNS gets edited once, the DMARC record sits at
p=nonefor two years, and the reports go to an inbox nobody reads.We treat email authentication as ongoing management, not a one-time ticket. That means a complete inventory up front, DKIM enabled per sender, reports reviewed on a schedule, and a planned move to enforcement. It also means re-checking when a new tool is added, because every new sender is a new way for legitimate mail to fail.
For regulated organizations such as healthcare practices, law firms, banks and mortgage companies, spoofed email is a direct risk to client trust and to compliance obligations. Proactive, preventative work is how we approach that, and it is why we pair authentication with monitoring and security reviews instead of leaving it as a stand-alone setting.
Alex
Get it done without the guesswork
If your team does not have the time to inventory senders, read reports and manage DNS changes, Secure Techies can run the process for you as part of our managed IT services. We handle Microsoft 365 and Google Workspace administration, and our cybersecurity solutions cover email protection alongside endpoint detection, incident response and risk assessment. Our work is built for small and mid-size businesses in Southern California, including organizations with HIPAA and other compliance requirements.

If compliance is driving the project, our compliance and security audits review how email controls fit your wider obligations. For a closer look at spoofing risks specifically, read our email spoofing protection guide.
FAQ
Do I need SPF, DKIM and DMARC, or is one enough?
Set up all three. DMARC passes if either SPF or DKIM passes with alignment, but SPF often breaks when mail is forwarded, and DKIM can fail when a service changes a message. Having both gives DMARC two chances to pass for legitimate mail.
Which should I set up first?
SPF and DKIM come first, then DMARC. Google recommends waiting about 48 hours after enabling SPF or DKIM before setting up DMARC. Start DMARC at p=none so you can see results before enforcing anything.
Can I have more than one SPF record?
No. A domain must have a single SPF TXT record, and publishing more than one causes SPF checks to fail. Combine all of your senders into one record by adding each include value, and keep the total under 10 DNS lookups.
How do I know my setup is working?
Send a message from your domain to a Gmail account, choose Show original, and look for spf=pass, dkim=pass and dmarc=pass in the Authentication-Results header. Then review your DMARC aggregate reports to confirm that every legitimate sender passes.
Is the free tool enough, or should I use a managed service?
A generator helps you draft correct records. The harder part is the ongoing work: finding every sender, reading reports and moving safely to enforcement. Organizations with limited IT time often hand that to a managed provider.
Sources
- Set up DMARC (Google Workspace)
- How email authentication works in Microsoft 365
- Set up SPF for your Microsoft 365 domain
- Set up DKIM to sign mail from your cloud domain
- Set Up Email Authentication (SPF, DKIM and DMARC), DNSimple
- SPF Record Syntax Guide: RFC 7208 Rules
- Troubleshooting, DMARC Engine
- SPF, DKIM and DMARC: Setup Guide
- What are DMARC, DKIM, and SPF?
- Email Authentication Setup: SPF, DKIM and DMARC Guide
- 2025 SES deliverability checklist
