SPF, DKIM, and DMARC Configuration in 30 Minutes – Step-by-Step Guide
Checking and correcting SPF, DKIM, and DMARC configuration takes less time than rebuilding domain reputation after filters block it.
Your domain is less secure today than it will be after the changes you fear – and checking this takes 5 minutes without logging into the DNS panel. I know this scenario from dozens of AGAPE implementations: outbound campaign ready, database validated, sequences written – but no one has touched the SPF record since migrating to Microsoft 365 three years ago, because someone external set it up back then and email has worked ever since.
91% of cyberattacks start with a phishing email – Infraforge and Microsoft Learn cite this number as a starting point for discussions about system security, not just “email settings.” Enforcing a DMARC policy reduces phishing attempts impersonating a domain by about 90% – Warmforge documented this effect in an analysis of hundreds of configurations. Google and Yahoo require mass senders to have at least a DMARC p=none policy, with clear pressure to move to p=quarantine and p=reject – Yahoo Sender Best Practices and Valimail reiterate this in official guidelines. Microsoft explicitly states that messages without proper authentication may be rejected entirely – Defender for Office 365 documentation leaves no doubt here.
The absence of a published DMARC makes providers treat all correspondence from the domain as suspicious – Google Workspace Admin and Warmforge confirm this mechanism. Having more than one SPF record or leaving the +all mechanism allows any server in the world to send mail on behalf of the domain – MXToolbox and Warmforge indicate these errors as the most common causes of technical chaos.
Cost of Inaction versus Cost of Action
Rebuilding the reputation of a burned domain takes weeks and freezes the entire outbound pipeline – Infraforge compares this cost to 30-60 minutes of work on a few DNS records. Every day of delay means lost sales meetings, because the campaign cannot run at full throttle until the domain is authenticated.
SPF, DKIM, and DMARC – Three Layers of Protection
| Mechanism | What it does | Record Type | Common Error | How to Verify | |-----------|--------------|-------------|--------------------|-------------------| | SPF | List of authorized servers | TXT with v=spf1 | Exceeding 10 DNS lookups or duplicate record | MXToolbox SPF Check | | DKIM | Cryptographic signature of messages | TXT or CNAME under _domainkey | Key shorter than 1024 bits or lack of alignment | dkim=pass header | | DMARC | Overarching policy and alignment | TXT under _dmarc | Missing rua or p=reject without observation phase | DMARC reports |
SPF is a list of authorized servers sending mail on behalf of the domain. The TXT record starting with v=spf1 must contain include mechanisms for email providers – for example, include:spf.protection.outlook.com for Microsoft 365 or include:_spf.google.com for Google Workspace – as well as IP addresses of your own servers, and end with an all mechanism set to ~all during the testing phase. Exceeding the strict limit of 10 DNS lookups automatically causes SPF to fail on recipient servers – MXToolbox and Infraforge emphasize this parameter as absolutely rigid.
DKIM is a cryptographic signature guaranteeing that the message has not been altered in transit. Microsoft 365 requires two CNAME records named selector1._domainkey and selector2._domainkey. Google Workspace generates one TXT record with a public key under the name selector._domainkey.domain.com. Keys should have a recommended length of 2048 bits and be rotated every few months – Microsoft Learn and Yahoo state these values as standard.
DMARC is an overarching policy that relies on SPF and DKIM results and checks domain alignment. DMARC checks the alignment of the domain in the From header with the domain authenticated by SPF or DKIM – and it is this condition that most often disrupts sending from external systems where the DKIM signature is correct but issued for the tool provider's domain, not yours – Warmforge and Yahoo Sender Best Practices document this mechanism. The adkim and aspf parameters determine relaxed (r) or strict (s) alignment – I recommend starting with r in environments with many external senders, as s rejects everything coming from subdomains and third-party platforms – Warmforge and Valimail provide this recommendation.
Secure Audit Path in Five Minutes
External testers such as MXToolbox and the Polish tool HitMe.pl work exclusively with public DNS data. Simply enter the domain name to get a full picture of SPF, DKIM, and DMARC status in a few minutes without any risk to your active email. Animails is another Polish source with similar functionality. These tools indicate whether there is more than one SPF record, whether the +all mechanism leaves the domain open to any server in the world, whether DKIM keys are at least 1024 bits, and whether a DMARC policy has been published.
Minutes 0-5: Inventory of Sending Sources
Before touching any DNS record, list all systems sending mail on behalf of your domain. Your main mail server (Google Workspace or Microsoft 365), CRM, marketing automation system, invoicing system and transactional emails, website forms, cold email tool, and ticketing systems – omitting one legitimate source will result in it being blocked by SPF and DMARC. An SPF record that does not include the invoicing server will send customer invoices to the spam folder if a p=quarantine policy is in place.
Minutes 5-15: SPF and the 10 DNS Lookup Limit
Copy your current TXT records as a backup. Verify that there is no more than one SPF record. Ensure the all mechanism is set to ~all. Add missing includes for providers and IP addresses of servers from your inventory. After making changes, send a test message and check the header for spf=pass.
Minutes 15-25: DKIM
Microsoft 365 generates two CNAME records – selector1._domainkey and selector2._domainkey – which only need to be added in the DNS panel and signing enabled in the security portal. Google Workspace generates a public key under the p= tag in the TXT record. Ensure the key is at least 1024 bits, preferably 2048 bits. After adding the records, enable DKIM in your provider's console and verify the dkim=pass header.
Minutes 25-30: DMARC p=none
Create a TXT record on the host _dmarc.domain.com with the tags v=DMARC1, rua=mailto:reports@yourdomain.com, pct=100, and adkim=r aspf=r. The p=none policy operates in observational mode and does not affect deliverability. After a few days or weeks of report analysis, transition to p=quarantine, and eventually to p=reject – Valimail and Microsoft Learn indicate this path as standard.
Why DMARC Enabled Before SPF and DKIM Harms Deliverability
Enabling DMARC before proper SPF and DKIM configuration actively harms deliverability, because the policy begins to enforce rules on messages that do not yet pass authentication – Google Workspace Admin and Microsoft Learn warn against this order.
Why the Main Domain Doesn't Send Cold Emails – Secondary Domains and 40 Email Limit Per Mailbox
The practice of protecting the corporate domain in cold email is based on secondary domains with 2-3 mailboxes per domain and a limit of about 40 messages per day per account. Safe sending of 10,000 cold emails per month requires several additional domains – Instantly and Allegrow provide these parameters as standard. Microsoft recommends separating mass marketing communication from transactional communication at the subdomain level, for example m.domain.com and t.domain.com, so that a high Spam Rate from campaigns does not destroy the main domain's reputation.
Dedicated versus Shared IP
A dedicated IP address offers greater control over reputation, but its level depends solely on list quality and recipient engagement. A shared IP benefits from the reputation of a pool of many senders, and in a well-managed provider ecosystem, it can be more advantageous for low volume – Oppora and Yahoo compare these two models. A dedicated IP address alone does not solve deliverability problems when the domain is poorly authenticated or generates many spam complaints – the foundation remains free DNS records.
Email Warm-up and List Hygiene
Warm-up tools generate synthetic, positive signals – opens and replies within a controlled network of mailboxes – and only in conjunction with correct SPF, DKIM, and DMARC do they build the reputation of a new domain – Allegrow describes this mechanism. List hygiene – double opt-in, a visible and functional unsubscribe link, periodic removal of inactive addresses – maintains a low Spam Rate – Yahoo Sender Best Practices, SARE, and rejestracjadomen.pl list these practices as a condition for survival.
What to Do if Deliverability Drops After Changes
Analyze the Authentication-Results header in your test message. Identify the mechanism that failed. If spf=fail, check if the new record covers all sources from your inventory. If dkim=fail, verify the key on the signing server matches the key published in DNS. If dmarc=fail with passing SPF or DKIM, the problem is in domain alignment. Temporarily revert the policy to p=none as a safety valve. All three mechanisms are DNS records, so each step is reversible within propagation time – from several to several dozen minutes – Infraforge and MXToolbox confirm this reversibility.
Email Forwarding and the ARC Mechanism
Email forwarding breaks SPF results because the intermediary server sends the message from its own IP, which is not in your SPF record. Some legitimate emails start failing for recipients who have redirects set up, which with p=reject means they are rejected. Yahoo recommends implementing the ARC mechanism in forwarding environments, which preserves information about original authentication – Yahoo Sender Best Practices provides this recommendation. The DKIM signature passes forwarding, SPF does not – which is why DKIM is more important for alignment survival.
30-Minute Checklist – Summary
Step zero: create a backup copy of your current TXT records. Step one: perform an audit with MXToolbox, HitMe.pl, and Animails tools. Step two: inventory all sending sources. Step three: verify and correct the SPF record while maintaining the 10 DNS lookup limit. Step four: add DKIM records generated by Microsoft 365 or Google Workspace. Step five: introduce the DMARC record with a p=none policy, rua, and pct=100. After making changes, send a few test messages to Gmail, Yahoo, and Outlook mailboxes and check headers for pass values for SPF, DKIM, and DMARC.
Do you know the current status of your domain's SPF, DKIM, and DMARC configuration? Let us know in the comments when you last checked it.
Key takeaways
- Before making DNS changes, conduct a full inventory of all systems sending email on behalf of your domain.
- The SPF record must adhere to the strict limit of 10 DNS lookups and end with a ~all mechanism during the testing phase.
- DMARC implementation should start with a p=none policy to observe reports before transitioning to p=quarantine or p=reject.
- Cold email campaigns should be conducted from secondary domains, maintaining a limit of up to 40 messages per mailbox daily.
Frequently asked questions (FAQ)
- How to avoid the 10 DNS lookup limit in an SPF record?
- Exceeding the 10 DNS lookup limit in SPF results from an excessive number of include mechanisms. To resolve this, remove unused entries, consolidate provider declarations, or replace include mechanisms with direct IP addresses of your own servers.
- Why do emails go to spam after enabling DMARC?
- Enabling DMARC before properly configuring SPF and DKIM causes messages to be rejected by recipient servers. A common error is also a lack of alignment when the DKIM signature is issued for the tool provider's domain instead of your sender domain.
- What is the correct order for implementing SPF, DKIM, and DMARC?
- The process should start with an inventory of sources and setting up the SPF record and DKIM keys of 2048 bits. After confirming dkim=pass and spf=pass headers, the DMARC record with a p=none policy is published, and after analyzing reports, you transition to p=quarantine and p=reject.
- Can cold emails be sent from the main company domain?
- No, sending mass outbound communication from the main domain jeopardizes its business reputation. For cold emails, use secondary domains with a limit of 2-3 mailboxes per domain and about 40 messages per day from one account.
- What is the difference between DMARC p=none and p=reject policy?
- The p=none policy operates solely in observational mode, collecting email traffic reports without affecting deliverability. The p=reject policy instructs recipient servers to completely reject messages that do not successfully pass SPF/DKIM authentication and the alignment test.
Do you know the current status of your domain's SPF, DKIM, and DMARC configuration? Let us know in the comments when you last checked it.