How To

The Everyday User's Guide to Stopping Email Spoofing: Setting Up SPF, DKIM & DMARC

December 17, 2025
8 min read
Back to Hub
The Everyday User's Guide to Stopping Email Spoofing: Setting Up SPF, DKIM & DMARC
Intelligence Brief

Email remains the lifeblood of business communication, but it’s also the primary vector for some of the most damaging cyberattacks. We’ve seen a stark rise in Business Email Compromise (BEC) scams, where attackers impersonate executives or trusted partners to trick employees into making fraudulent p...

Email remains the lifeblood of business communication, but it’s also the primary vector for some of the most damaging cyberattacks. We’ve seen a stark rise in Business Email Compromise (BEC) scams, where attackers impersonate executives or trusted partners to trick employees into making fraudulent payments or divulging sensitive information. The FBI reported over $2.7 billion in losses from BEC and email account compromise in 2022 alone. This isn't just a problem for large corporations; small and medium-sized businesses are often softer targets. Protecting your domain from being used for these nefarious purposes isn't just good practice; it's an absolute necessity for safeguarding your reputation, your finances, and your customers' trust. Fortunately, the tools to combat email spoofing are available to everyone: SPF, DKIM, and DMARC. These aren't esoteric technologies reserved for enterprise-level security teams. With a clear understanding and a methodical approach, any business owner or IT manager can implement them effectively.

Understanding the Threat: When Your Email Pretends to Be Someone Else

Before we dive into the solutions, it's crucial to grasp what email spoofing entails. Imagine receiving an email that looks like it came from your CEO, your bank, or a major vendor, asking you to transfer funds or click a suspicious link. The "From" address appears legitimate, but the email itself is a fake, designed to deceive. This is email spoofing in action. Attackers manipulate the visible "From" address (the one you see in your email client) to impersonate a trusted sender. Without proper authentication mechanisms, a receiving email server has no reliable way to verify if the sender is truly authorized to use that domain. The consequences can be devastating: financial losses, compromised accounts, intellectual property theft, and severe damage to your brand's reputation. SPF, DKIM, and DMARC work together to provide that crucial verification, allowing recipient mail servers to confidently identify legitimate emails and reject or quarantine fakes.

Laying the Groundwork with SPF (Sender Policy Framework)

Think of SPF as a guest list for your domain's email. When an email server receives a message, it checks the SPF record to see if the sending IP address is on your authorized list. If the IP address isn't listed, the email server knows the sender is likely not legitimate.

How SPF Works

Your SPF record is a special type of text record (TXT record) published in your domain's DNS settings. It lists all the IP addresses and authorized domains that are permitted to send email on behalf of your domain.

Setting Up Your SPF Record

1. Identify All Your Email Senders: This is the most critical step. Don't just think about your primary email provider (e.g., Microsoft 365, Google Workspace). Consider: * Your main email server (e.g., `smtp.office365.com`, `_spf.google.com`). * Marketing automation platforms (e.g., Mailchimp, HubSpot, SendGrid). * CRM systems (e.g., Salesforce). * Transactional email services (e.g., Stripe, Shopify notification emails). * Any other third-party service that sends emails using your domain. * *Tip:* Check your email headers for "Received" lines from your various services to identify their sending IPs or `include:` mechanisms.

2. Construct Your SPF Record: An SPF record always starts with `v=spf1`. After that, you'll list your authorized senders using various mechanisms: * `ip4:` or `ip6:`: To specify individual IP addresses or ranges (e.g., `ip4:192.0.2.1`). * `include:`: To reference another domain's SPF record, which is common for third-party services (e.g., `include:_spf.google.com`, `include:spf.protection.outlook.com`, `include:servers.mcsv.net` for Mailchimp). This is the most frequently used mechanism. * `a`: Authorizes the A records for your domain. * `mx`: Authorizes the MX records for your domain. * `exists`: A more advanced mechanism. * The All Mechanism (`-all` or `~all`): This is crucial and goes at the end of your record. * `-all` (Fail): Tells receiving servers that any email from an unauthorized sender should be *rejected*. This is the strongest enforcement. * `~all` (SoftFail): Tells receiving servers that unauthorized emails *might* be rejected or marked as spam. It's a softer approach, often used during initial setup. * `?all` (Neutral): Treat unauthorized senders as neutral; rarely recommended as it offers little protection.

* Example SPF Record: `v=spf1 include:_spf.google.com include:servers.mcsv.net ip4:198.51.100.12 -all` This record authorizes Google Workspace, Mailchimp, and a specific IP address to send email for your domain, and explicitly rejects all others.

3. Add the SPF Record to Your DNS: * Log in to your domain registrar or DNS hosting provider (e.g., GoDaddy, Cloudflare, Namecheap). * Navigate to your DNS management section. * Add a new TXT record. * For the "Host" or "Name," use `@` or your domain name (e.g., `yourdomain.com`). Some providers might require leaving it blank. * For the "Value" or "Text," paste your entire SPF record string. * Set the TTL (Time To Live) to a reasonable value, perhaps 3600 seconds (1 hour).

Common SPF Mistakes to Avoid

* Forgetting Senders: Missing an `include` statement for a legitimate service will cause its emails to fail SPF checks, potentially landing them in spam folders or being rejected. * Multiple SPF Records: A domain *must* only have one SPF TXT record. If you have more, mail servers will ignore them, rendering SPF useless. Combine all your `include` statements and IP addresses into a single record. * Incorrect Syntax: A single typo can invalidate the entire record. Use an SPF validation tool (like MXToolbox's SPF checker) to verify your record after creation. * Going Straight to `-all`: If you're unsure if you've identified all senders, start with `~all` and monitor your email delivery for a week or two. Then, once confident, switch to `-all` for stronger protection.

Signing Off Authentically with DKIM (DomainKeys Identified Mail)

While SPF verifies *who* is allowed to send email from your domain, DKIM verifies that the email *itself* hasn't been tampered with in transit. It's like a tamper-evident seal on your email.

How DKIM Works

When an email leaves your server, a digital signature is added to its header. This signature is generated using a private key known only to your sending server. A corresponding public key is published in your domain's DNS as a TXT record. When a receiving server gets your email, it uses the public key from your DNS to decrypt the signature in the email header. If the signature matches the email content, it confirms two things: 1. The email genuinely originated from your domain.

2. The email hasn't been altered since it was signed.

Setting Up Your DKIM Record

Unlike SPF, which you largely construct yourself, DKIM keys are usually generated by your email service provider.

1. Generate DKIM Keys from Your Email Service Provider: * Google Workspace: Go to `Admin console > Apps > Google Workspace > Gmail > Authenticate email (DKIM)`. You'll generate a DNS Host name (selector) and a TXT record value. * Microsoft 365: DKIM setup is typically managed through the Microsoft 365 Defender portal or PowerShell. It often involves enabling DKIM for your domain and then adding CNAME records to your DNS that point to Microsoft's DKIM infrastructure. * Other Services (Mailchimp, HubSpot, etc.): Most reputable email marketing or transactional email services will have a dedicated section in their settings (often under "Domains" or "Sending Settings") where you can generate DKIM records. These usually provide a CNAME or TXT record that you need to add to your DNS.

2. Add the DKIM Record(s) to Your DNS: * Log back into your domain registrar or DNS hosting provider. * Add a new TXT record (or CNAME record, as provided by your service). * For the "Host" or "Name," use the selector provided by your email service (e.g., `google._domainkey` for Google Workspace, or `selector1._domainkey` and `selector2._domainkey` for Microsoft 365, or a specific CNAME for marketing platforms). * For the "Value" or "Text," paste the entire public key string provided. * Set the TTL.

3. Enable DKIM Signing: After adding the DNS records, return to your email service provider's settings and ensure that DKIM signing is enabled for your domain. It often requires a confirmation step.

Common DKIM Mistakes to Avoid

* Not Enabling Signing: Adding the DNS record isn't enough; you must also activate DKIM signing within your email service's control panel. * Incorrect DNS Entry: DKIM records are often long and complex. Copy and paste *exactly* what your provider gives you, ensuring no extra spaces or characters. * Using Default DKIM: If you use a shared email service, they might have a default DKIM setup. While better than nothing, configuring DKIM specifically for *your* domain provides stronger authentication and better control. * Forgetting Subdomains: If you send email from subdomains (e.g., `newsletter.yourdomain.com`), you might need separate DKIM records for them.

Enforcing the Rules with DMARC (Domain-based Message Authentication, Reporting, & Conformance)

By meticulously implementing SPF and DKIM, and then layering on DMARC for enforcement and reporting, you're not just adding technical security; you're actively building a trusted digital identity for your domain. This trifecta of authentication mechanisms works in concert to significantly reduce the risk of email spoofing, protect your organization from devastating BEC attacks, and preserve the integrity of your brand. While the initial setup might seem daunting, the long-term benefits of enhanced security, reduced fraud, and increased customer confidence far outweigh the effort. Take the proactive step today to secure your email communications and ensure that every message sent from your domain is genuinely yours.

#how-to#cybersecurity#education#security-tips#online-safety#password-security#email-security#privacy