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
- Wait for DNS to update. It often takes minutes, sometimes a few hours.
- Send a message to a mailbox at a large provider and open the message headers. Look for
spf=pass,dkim=passanddmarc=pass. - 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=rejecton 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