VisualNest Get your plan

Blog / Security

SPF, DKIM and DMARC: how to stop people faking your email

What SPF, DKIM and DMARC do, how to set them up step by step, and how to move to a DMARC policy that blocks fake email safely.

Anyone can send an email that claims to come from your domain. Without the right DNS records, the receiving mail server has no way to tell a fake invoice from a real one. Three records fix that: SPF, DKIM and DMARC. This guide explains each one in plain English and shows you how to set them up safely.

Why this matters for a small business

Payment-change scams are one of the most common frauds against small companies. A scammer emails your customer "from" your address, says your bank details have changed, and asks them to pay the next invoice into a new account. If your domain has no DMARC policy, nothing stops that email reaching the inbox.

Since 2024, Google and Yahoo also require bulk senders to publish SPF, DKIM and DMARC. Even if you only send a few hundred emails a day, mail without them is more likely to land in spam.

SPF: who is allowed to send

SPF (Sender Policy Framework) is a single TXT record on your domain that lists the servers allowed to send email for it. A typical record looks like this:

v=spf1 include:_spf.google.com include:_spf.mail.hostinger.com -all
  • include: adds the servers of a service you use, such as Google Workspace, Microsoft 365, your web host or your newsletter tool.
  • -all at the end tells receivers to reject anything else. ~all (soft fail) is a gentler option while you are testing.

Two rules catch people out. First, you may only have one SPF record; if you have two, SPF fails for every message. Second, SPF allows a maximum of 10 DNS lookups. Every include, a and mx counts, including the ones hidden inside other providers' records. Going over the limit breaks SPF without any warning.

DKIM: a signature on every message

DKIM (DomainKeys Identified Mail) adds a digital signature to each email you send. Your email provider holds a private key and you publish the matching public key in DNS, at a name like google._domainkey.yourdomain.com. Receivers check the signature to confirm the message really came from you and was not changed on the way.

You do not write DKIM records by hand. Your provider generates them:

  • Google Workspace: Admin console, Apps, Gmail, Authenticate email.
  • Microsoft 365: Defender portal, Email authentication settings, DKIM.
  • Hostinger email: hPanel, Emails, DNS settings for your domain.

Copy the record exactly, add it to your DNS, then switch signing on in the provider's settings.

DMARC: the rule that actually blocks fakes

SPF and DKIM only provide evidence. DMARC tells receiving servers what to do when a message fails both checks, and asks them to send you reports. It is a TXT record at _dmarc.yourdomain.com:

v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com

The p= value is the policy:

PolicyWhat happens to fake email
p=noneDelivered as normal. You only get reports.
p=quarantineSent to the spam folder.
p=rejectRefused completely.

A safe rollout plan

Moving straight to p=reject can block your own invoices or newsletters if one of your tools is not set up properly. Roll out in stages:

  1. Publish SPF and DKIM for every service that sends email for you.
  2. Add DMARC with p=none and a reporting address. Leave it for two to four weeks.
  3. Read the reports (a free DMARC report viewer makes this easier) and fix any real service that fails.
  4. Change to p=quarantine. Wait another two weeks.
  5. Change to p=reject.

Domains that never send email

Parked and unused domains are popular with scammers because nobody is watching them. Protect them with two records:

v=spf1 -all
v=DMARC1; p=reject

The first goes on the domain itself, the second at _dmarc. Together they tell the world the domain never sends email.

Check your domain now

Our free email security check reads your SPF, DKIM and DMARC records, explains what it finds and gives you the exact records to add. It takes a few seconds and needs no sign-up.

Chat on WhatsApp