Set up SPF, DKIM, and DMARC step by step

spf, dkim, dmarc, email authentication, setup · 0 found this helpful

These three DNS records prove your email is real. Set them up once, test, and leave them. This guide assumes your domain uses Barbrick's nameservers. If it does not, see the last section.

Before you start

  • Confirm your nameservers. Run dig +short NS example.ca. You should see gordon.barbrick.ca, hugh.barbrick.ca, douglas.barbrick.ca.
  • Make a list of every service that sends email as @example.ca. Typical ones are your mailboxes, your website forms, a newsletter tool, an invoicing tool, and Microsoft 365 or Google Workspace.

Step 1: Check what you have

  1. Go to Account → Hosting → your site → Email and open the Deliverability tab.
  2. Find the Sender authentication card for example.ca.
  3. Check the status for SPF, DKIM, and DMARC. Valid shows a green check.

If a row shows a problem, select Fix it. We add the correct record to DNS.

Sender authentication on the Deliverability tab. This domain doesn't point to Barbrick yet, so each check waits

See Check your setup with Deliverability.

Step 2: SPF

  1. If Fix it installed an SPF record, check it. It starts like this, followed by an include: for our outgoing mail relay. Keep that include.
example.ca.  3600  IN  TXT  "v=spf1 +a +mx +ip4:203.0.113.25 ~all"
  1. Add other senders by editing the same record. Do not add a second one. Examples:
Service Add to the record
Microsoft 365 include:spf.protection.outlook.com
Google Workspace include:_spf.google.com
Newsletter or invoicing tool The include: the tool gives you

Result for Barbrick mailboxes and Microsoft 365:

example.ca.  3600  IN  TXT  "v=spf1 +a +mx +ip4:203.0.113.25 include:spf.protection.outlook.com ~all"
  1. Save. Keep to 10 DNS lookups. See SPF.

Step 3: DKIM

  1. In Deliverability, find the card for your domain.
  2. Check DKIM shows a record. If not, select Fix it.
  3. For other services, follow their guide and add the CNAME or TXT records they give.

See DKIM.

Step 4: DMARC

  1. Open Account → Hosting → your site → DNS for example.ca.
  2. In Add a record, set Type to TXT.
  3. Set Name to _dmarc.
  4. Set the value to this:
v=DMARC1; p=none; rua=mailto:[email protected]
  1. Click Add record.
  2. Create the mailbox [email protected] to receive reports. See Create an email account.

Start with p=none. Move to quarantine and reject over several weeks. See DMARC.

Step 5: Test

  1. Send a message to a Gmail address you control.
  2. Open it. Choose the three dots, then Show original.
  3. Look at the top.
SPF:   PASS with IP 203.0.113.25
DKIM:  'PASS' with domain example.ca
DMARC: 'PASS'

All three should pass. Also test from each service that sends as your domain.

Command-line check:

dig +short TXT example.ca | grep spf
dig +short TXT default._domainkey.example.ca
dig +short TXT _dmarc.example.ca

Step 6: Add each new sender before it sends

Whenever you start a new service that sends as @example.ca, update SPF and set up its DKIM first.

If your DNS is not at Barbrick

Copy the records into your DNS provider. To get the DKIM value, open a request and we will send it, usually the same day. See Keep DNS somewhere else.

If something goes wrong

Symptom Fix
spf=permerror Two SPF records, or over 10 lookups
dkim=none DKIM not installed or message sent through another server
dmarc=fail SPF or DKIM passes but does not align with the From address
A record "conflicts" An existing record with the same name. Edit it.

Was this helpful?

Still stuck? Ask us and we'll walk you through it.