opalmail Book a demo
Guide

How to set up SPF, DKIM and DMARC.

SPF, DKIM and DMARC are three DNS records that prove your business email really comes from you. Set up all three and other providers trust your mail. Miss one and your messages are more likely to land in spam.

What each record does

  • SPF lists the servers that are allowed to send mail for your domain.
  • DKIM adds a signature to every message, so the receiver can check that it was not changed on the way.
  • DMARC tells receivers what to do when a message fails SPF or DKIM, and where to send reports.

All three are TXT records that you add where your domain's DNS is managed, usually your domain registrar or DNS host.

Step 1: add SPF

Add one TXT record on the domain itself (often shown as @):

v=spf1 mx -all

This says: the servers in my MX records may send, and nobody else. If another service also sends mail for you, such as a newsletter tool, add its include: before -all. Keep a single SPF record. Two SPF records on one domain break SPF.

Step 2: add DKIM

Your mail server creates a key pair and gives you the public part. You publish it as a TXT record under a selector name:

selector._domainkey.yourcompany.com   TXT   v=DKIM1; k=rsa; p=MIIBIjANBgkq...

The selector and the long value come from your mail server. Copy the value exactly. Some DNS hosts need a long key split into quoted parts, and they usually do that for you.

Step 3: add DMARC

Add a TXT record at _dmarc.yourcompany.com. Start by watching only:

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

After a few weeks of clean reports, move to p=quarantine, then p=reject. The full reasoning is in which DMARC policy to use.

Step 4: test your records

  1. Wait for DNS to update. It often takes minutes, sometimes a few hours.
  2. Send a message to a mailbox at a large provider and open the message headers. Look for spf=pass, dkim=pass and dmarc=pass.
  3. Check again after any change to who sends mail for your domain.

Opalmail does this check for you. The Domain and DNS screen in the admin area looks up MX, SPF, DKIM and DMARC the way the internet sees them and names anything that is missing.

Common mistakes

  • Two SPF records on the same domain.
  • More than ten DNS lookups inside one SPF record, which makes SPF fail.
  • A DKIM value pasted with a missing character or an extra space.
  • DMARC set to p=reject on day one, before you know every service that sends mail for you.
  • Forgetting the MX record, so mail cannot arrive at all.

Last updated 2026-11-21

Questions people ask.

Something else on your mind? Ask us by email or WhatsApp and you get a plain answer.

Ask us
Do I need all three of SPF, DKIM and DMARC?

Yes. SPF and DKIM each prove a different thing, and DMARC ties them together and tells receivers what to do on failure. Large providers expect all three from business senders.

How long do DNS changes take?

Usually a few minutes, sometimes a few hours, depending on the record's time to live and your DNS host.

What does v=spf1 mx -all mean?

It means the servers named in your domain's MX records are allowed to send mail for the domain, and mail from any other server should be treated as a failure.

Your mail. Your server. Ready when you are.

See it with your own domain in a short demo. We answer by email or WhatsApp.