Skip to main content
Cloud Hosting starting at $2.91/mo. Auto-scaling servers with a FREE domain included. Start Now →
Security

Email Security for Small Business: SPF, DKIM & DMARC Explained Simply

Your domain's email can be spoofed by anyone unless you set up SPF, DKIM, and DMARC. This guide explains what each one does, why you need all three, and how to configure them for your domain.

S

Serverlys Team

May 8, 2026 · 6 min read

Email is the most impersonated communication channel in business. Without proper authentication, anyone can send an email that appears to come from your domain. A scammer can send an invoice from "accounting@yourbusiness.com" to your clients, and without SPF, DKIM, and DMARC in place, the receiving mail server has no way to verify whether the email is legitimate.

In 2024, Google and Yahoo began requiring SPF, DKIM, and DMARC for all bulk email senders. By 2026, Microsoft and other major providers have followed suit. If your domain lacks these records, your legitimate emails are increasingly likely to land in spam folders or be rejected entirely. Setting up all three takes about 30 minutes and protects your brand, your customers, and your email deliverability.

The Problem: Email Spoofing

The email protocol (SMTP) was designed in the 1980s without any built-in authentication. Anyone can set the "From" address on an email to any value they want, just like writing any return address on a physical envelope. SPF, DKIM, and DMARC were created to solve this fundamental design flaw.

Without these protections, attackers can:

SPF (Sender Policy Framework)

What It Does

SPF tells receiving mail servers which IP addresses and mail servers are authorized to send email on behalf of your domain. When an email arrives claiming to be from your domain, the receiving server checks your SPF record to verify the sending server is on the approved list.

How It Works

  1. You publish an SPF record in your domain's DNS (a TXT record).
  2. The record lists all servers authorized to send email for your domain.
  3. When a receiving server gets an email from your domain, it checks the sending server's IP against your SPF record.
  4. If the IP matches, the email passes SPF. If not, it fails.

Example SPF Record

v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.5 -all

This record says: "Emails from my domain can only come from Google Workspace servers, SendGrid servers, or the IP address 203.0.113.5. Reject anything else (-all)."

How to Set Up SPF

  1. Identify all services that send email from your domain (hosting mail server, Google Workspace, Microsoft 365, Mailchimp, SendGrid, transactional email services, etc.).
  2. Log in to your domain registrar or DNS provider.
  3. Add a TXT record for your domain with the SPF value.
  4. Use ~all (soft fail) while testing, then switch to -all (hard fail) once confirmed.

Serverlys Tip: If you host your email with Serverlys, your SPF record should include our mail server. Contact support and we will provide the exact SPF value for your account, or check your cPanel Email Deliverability section where we auto-generate the correct records.

DKIM (DomainKeys Identified Mail)

What It Does

DKIM adds a digital signature to every outgoing email. The receiving server uses a public key (published in your DNS) to verify the signature, confirming that the email was actually sent by an authorized server and that the message content has not been tampered with in transit.

How It Works

  1. Your mail server generates a pair of cryptographic keys: a private key (kept secret on the server) and a public key (published in DNS).
  2. When sending an email, your server uses the private key to create a digital signature of the email's headers and body.
  3. The signature is added to the email as a DKIM-Signature header.
  4. The receiving server retrieves your public key from DNS and uses it to verify the signature.
  5. If the signature is valid, the email passes DKIM. If it has been modified, it fails.

Example DKIM DNS Record

Record name: default._domainkey.yourdomain.com

Record type: TXT

Record value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQE... (your public key)

How to Set Up DKIM

  1. Generate DKIM keys through your email provider. In cPanel, go to Email Deliverability and DKIM is generated automatically. In Google Workspace, go to Admin → Apps → Google Workspace → Gmail → Authenticate Email.
  2. Add the DKIM public key as a TXT record in your DNS.
  3. Verify the setup by sending a test email and checking the headers for a "DKIM: pass" result.

DMARC (Domain-based Message Authentication, Reporting & Conformance)

What It Does

DMARC ties SPF and DKIM together and tells receiving servers what to do with emails that fail authentication. Without DMARC, servers may accept, reject, or quarantine failed emails at their own discretion. DMARC gives you explicit control over that decision and sends you reports about who is using your domain to send email.

How It Works

  1. You publish a DMARC record in your DNS (a TXT record at _dmarc.yourdomain.com).
  2. The record specifies your policy: none (monitor only), quarantine (send to spam), or reject (block entirely).
  3. When an email fails both SPF and DKIM, the receiving server follows your DMARC policy.
  4. The receiving server sends aggregate reports to your specified email address, showing who is sending email from your domain and whether it passed or failed authentication.

Example DMARC Record

Record name: _dmarc.yourdomain.com

Record type: TXT

Record value: v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@yourdomain.com; pct=100

DMARC Policies Explained

Policy Action When to Use
p=none Monitor only, deliver all emails Initial setup, gathering data
p=quarantine Send failing emails to spam After confirming legitimate senders pass
p=reject Block failing emails entirely Maximum protection, after thorough testing

Recommended DMARC Rollout

  1. Week 1–4: Start with p=none to collect reports without affecting email delivery. Analyze reports to identify all legitimate email sources.
  2. Week 5–8: Move to p=quarantine with pct=25 (apply to 25% of failing emails). Monitor for false positives.
  3. Week 9–12: Increase to pct=100. If no legitimate emails are being affected, you are ready for the final step.
  4. Week 13+: Move to p=reject for maximum protection. Continue monitoring reports.

How SPF, DKIM, and DMARC Work Together

"Think of SPF as a guest list (who is allowed to send), DKIM as a tamper-proof seal (proof the email is genuine and unmodified), and DMARC as the policy enforcement (what to do with gatcrashers). You need all three for comprehensive email security."

Here is the flow when an email arrives at a receiving server:

  1. Server checks SPF: Is the sending server authorized? Pass or fail.
  2. Server checks DKIM: Is the email digitally signed and unmodified? Pass or fail.
  3. Server checks DMARC: Does SPF or DKIM pass, AND does the domain align? If both fail, apply the DMARC policy (none/quarantine/reject).
  4. Server sends a DMARC report to the domain owner with the results.

Tools for Setup and Testing

Common Mistakes

Serverlys Tip: All Serverlys hosting plans include email hosting with automatic SPF and DKIM configuration via cPanel's Email Deliverability tool. We recommend adding a DMARC record as well — our support team can help you set one up correctly for your domain.

Frequently Asked Questions

Do I need all three (SPF, DKIM, and DMARC)?

Yes. Each one serves a different purpose: SPF verifies the sending server, DKIM verifies the message integrity, and DMARC enforces policy and provides reporting. Missing any one of them leaves a gap in your email security. Major providers like Google and Yahoo require all three for bulk senders.

Will setting up SPF/DKIM/DMARC stop all spam from my domain?

It will prevent unauthorized parties from sending emails that pass authentication checks for your domain. However, if an attacker sends spoofed emails and the receiving server does not check DMARC (some older or poorly configured servers), the email may still be delivered. The good news is that all major email providers (Gmail, Outlook, Yahoo) fully support DMARC enforcement.

Can I set these up myself or do I need a developer?

You can set them up yourself. All three are DNS TXT records that you add through your domain registrar or hosting provider's DNS management. If you are comfortable editing DNS records, it takes about 30 minutes. If not, your hosting provider's support team or a developer can do it in minutes.

How long does it take for SPF/DKIM/DMARC to take effect?

DNS changes typically propagate within 1–24 hours (usually much faster). After adding the records, test with MXToolbox or mail-tester.com to confirm they are active. DMARC reports take 24–48 hours to start arriving since they are sent daily by receiving servers.

What happens if I only have SPF but not DKIM or DMARC?

SPF alone provides basic sender verification, but without DKIM, there is no way to verify the email content has not been modified. Without DMARC, receiving servers have no enforcement policy and may handle failures inconsistently. Google and Yahoo now require all three for senders sending more than 5,000 emails per day, and this requirement is expanding to all senders.

Related Articles

Email hosting with built-in security

Serverlys hosting includes email accounts with automatic SPF and DKIM configuration, plus one-click DMARC setup assistance.