Skip to content

How to set up SPF, DKIM and DMARC for your business email

By Ash, Founder, HosteazePublished 5 min read

Add three DNS records in this order. First an SPF record listing who can send email for your domain, then a DKIM record your email provider generates, then, about 48 hours later, a DMARC record starting at p=none. Watch the DMARC reports for a few weeks before tightening the policy to quarantine.

Hands typing on a keyboard as email envelopes fly out
Credit: geralt via Pixabay

If your invoices and quotes keep ending up in clients' spam folders, missing email authentication is the most likely reason. Since 2024 Gmail and Yahoo have checked for it on every message, and from November 2025 Gmail has been rejecting more mail that fails. The fix is three DNS records, and the order you add them in matters.

Brass letterbox on a dark door labelled "No junk mail"
Credit: cattu via Pixabay

What do SPF, DKIM and DMARC actually do?

Diagram of how SPF, DKIM and DMARC work together when an email is received, from your mail server through the recipient's checks to inbox, spam, block or a report
Credit: Hosteaze

Each one answers a different question the receiving mail server asks:

RecordThe question it answersWhat it looks like
SPFIs this server allowed to send email for this domain?A TXT record listing your email services
DKIMWas this email really sent by the domain, and unchanged on the way?A public key in DNS that matches a signature on each email
DMARCIf SPF or DKIM fails, what should I do, and who do I tell?A TXT record at _dmarc.yourdomain.com with your policy

SPF and DKIM prove the email is genuine. DMARC tells receivers how strict to be and sends you reports, so you can see who is sending email using your name.

Before you start: list everything that sends email as you

This is the step people skip, and it's why their DMARC setup later blocks their own invoices. Write down every service that sends email from your domain:

Each of these needs to be covered by SPF, DKIM or ideally both. Most of them publish the exact include value or DKIM record in their help pages.

Step 1: Add one SPF record

Watch the 10-lookup limit. SPF allows at most 10 DNS lookups. Every include:, a, mx, exists and redirect counts, and so do the includes inside them. Go over and SPF fails for every email with a "permerror". If you use lots of services, use DKIM for some of them instead of adding more includes.

-all or ~all? Microsoft recommends -all (hard fail) once DKIM and DMARC are in place, because DMARC can then act on messages that fail SPF. Google's own examples use ~all. Either works with DMARC; we'd use ~all while you're still finding all your senders, then move to -all.

Step 2: Turn on DKIM

DKIM keys are generated by your email provider, so you copy their record into your DNS rather than writing your own.

Google Workspace

Microsoft 365

Do the same for any other service on your list that offers DKIM (most newsletter and invoicing tools do, usually as a "domain authentication" setting).

Step 3: Wait 48 hours, then add DMARC at p=none

Google recommends allowing 48 hours after SPF and DKIM before adding DMARC, so the first reports reflect your finished setup.

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

p=none means "don't block anything, just report". It's the minimum Gmail requires from bulk senders and the safe starting point for everyone.

Step 4: Read the reports, then tighten the policy

DMARC reports are XML files, which are hard to read on their own. A free report viewer (several DMARC services offer one) turns them into a list of every server sending as your domain and whether it passed.

v=DMARC1; p=quarantine; pct=25; rua=mailto:dmarc@yourdomain.com

How do I check it's all working?

Send an email from your domain to a Gmail address, open it, and choose Show original from the three-dot menu. You should see SPF: PASS, DKIM: PASS and DMARC: PASS. If any fail, the details on that page show which domain or record was checked, which usually points straight at the problem.

Common mistakes we see

Frequently asked questions

Do I need all three, or is SPF enough?

Set up all three. Gmail requires every sender to have at least SPF or DKIM, and anyone sending 5,000 or more emails a day to Gmail needs SPF, DKIM and DMARC. Even below that volume, SPF alone is easy to spoof and often isn't enough to keep you out of spam.

How long do the records take to work?

Most DNS changes are visible within an hour, though they can take up to 48 hours depending on the record's TTL. Google suggests waiting 48 hours after SPF and DKIM before adding DMARC.

Can I have two SPF records?

No. A domain must have exactly one SPF record. If you use several services, combine them into one record with multiple include statements.

Will DMARC p=reject block my own emails?

It can, if a service you use isn't covered by SPF or DKIM. That's why you start at p=none and read the reports first.

Sources

  1. Microsoft, Set up SPF to identify valid email sources
  2. Google Workspace, Set up DMARC
  3. RFC 7208, Sender Policy Framework
  4. RFC 7489, DMARC
  5. Red Sift, Gmail's enforcement ramps up

Want email on your own domain?

Hosteaze hosting plans let you set up mailboxes on your own domain. See what each plan includes.

See hosting plans