02Resources · How-To

How to set up SPF, DKIM and DMARC.

Three DNS records decide whether your invoices reach the inbox or the spam folder. Here is the order to add them in, and how to avoid the mistake that blocks your own mail.

How-To04 Aug 20265 min read
DNS management console showing a table of text records on a laptop
Steps
6 steps
Time needed
About 90 minutes, then 30 days of monitoring
Level
Intermediate
You will need
DNS access and your mail provider’s admin console

01Before you start

What this assumes.

You can edit DNS for the domain and you are an administrator on whatever sends your mail. If either is someone else’s job, get them in the room now rather than at step four.

What you need in place

  • Administrator access to your DNS, at the registrar or wherever the nameservers point
  • Admin access to your mail provider — Microsoft 365, Google Workspace or similar
  • A list of every other system that sends email as your domain
  • A mailbox or group address that can receive the daily DMARC reports

Who this is for

  • Anyone whose invoices or quotes keep landing in spam
  • Teams who have been told to “get DMARC in place” by a client or insurer
  • Businesses sending through more than one system — mail, CRM, invoicing, forms
  • Anyone who has just been spoofed and wants it to stop

02Step by step

The process.

Do these in order. The sequence matters more than the individual records — publishing an enforcing policy before you know who sends your mail is how organisations block their own invoices.

  1. Step 01

    List everything that sends as you

    30 minutes

    This is the step people skip and the reason most DMARC rollouts break something. Your mail provider is rarely the only sender. Anything that emails a customer on your behalf has to be accounted for before you tell the world to reject unauthorised mail.

    • Your mail provider — Microsoft 365, Google Workspace, or a mailbox at your host
    • Accounting and invoicing software that emails invoices directly
    • CRM and marketing platforms
    • Your website’s contact and enquiry forms
    • Booking, ticketing or support systems
    • Anything a supplier sends “from” your domain

    If you inherited the domain, assume the list is incomplete. The DMARC reports in step five will tell you what you missed — which is exactly why the first policy is p=none.

  2. Step 02

    Publish an SPF record

    20 minutes

    SPF names the servers allowed to send mail for your domain. It is a single TXT record at the root of the domain, and there must only ever be one — two SPF records is a configuration error that causes both to be ignored.

    Take the include: value from each provider’s documentation and combine them into one record. A Microsoft 365 domain that also sends through an invoicing tool looks roughly like this:

    • Type: TXT — Name: @ (the domain root)
    • Value: v=spf1 include:spf.protection.outlook.com include:your-invoicing-tool.com -all
    • End with -all once you are confident the list is complete; use ~all while you are still finding senders

    SPF allows a maximum of ten DNS lookups. Each include: usually costs one, and exceeding ten makes the whole record fail. If you are close to the limit, flattening or a subdomain strategy is the fix.

  3. Step 03

    Turn on DKIM signing

    20 minutes

    DKIM adds a cryptographic signature to every message, so a receiving server can prove the mail was not altered and genuinely came from you. Unlike SPF, it survives forwarding — which is why it does most of the real work.

    Your provider generates the key pair and gives you the records. In Microsoft 365 and Google Workspace this is two CNAME records or one TXT, published at a selector under _domainkey.

    • Generate the keys in your mail provider’s admin console
    • Publish the records exactly as given — a trailing dot or missing character breaks the signature
    • Return to the console and switch signing on, which is a separate action from publishing
    • Repeat for every sender that supports DKIM, not just your mailbox provider
  4. Step 04

    Publish DMARC in monitoring mode

    10 minutes

    DMARC ties the other two together and tells receiving servers what to do when a message fails. Crucially, it also asks them to send you reports.

    Start at p=none. It changes nothing about delivery and simply turns on reporting, which is what makes the rest of this safe.

    • Type: TXT — Name: _dmarc
    • Value: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.co.uk; fo=1
    • Use a mailbox or group that someone actually reads

    Do not start at p=reject because an article told you it is the goal. It is the destination, not the starting point, and going straight there will bounce legitimate mail you have not discovered yet.

  5. Step 05

    Read the reports for thirty days

    15 minutes a week

    Reports arrive daily as XML, which is unpleasant to read directly. Any DMARC report viewer will turn them into a list of sources with pass and fail counts.

    You are looking for one thing: sources sending as you that are failing. Each is either a legitimate system you missed in step one, or someone spoofing you. Legitimate senders get added to SPF and DKIM. Everything else is the reason you are doing this.

  6. Step 06

    Move to quarantine, then reject

    10 minutes, a month apart

    Once the reports show only your own systems passing, tighten the policy. Go to p=quarantine first and sit there for a few weeks — failing mail goes to spam rather than disappearing, so a mistake is recoverable.

    When quarantine has been quiet for a month, move to p=reject. That is the setting that actually stops someone invoicing your customers in your name.

    • v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.co.uk
    • Then, after a quiet month: v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.co.uk
    • Keep the reporting address live afterwards — new senders appear whenever someone buys new software

03Take it with you

The email authentication checklist.

Every record in this guide, with the exact syntax, the order to apply them in, and the DNS lookup limits that catch people out. Built to sit next to you while you work.

  • Sender inventory worksheet
  • SPF, DKIM and DMARC record syntax with worked examples
  • The staged rollout schedule — none, quarantine, reject
  • Common failure modes and what causes them

4 pages · PDF

In short

If you take three things from this

  1. 01

    Inventory your senders first — skipping this is what blocks legitimate mail.

  2. 02

    One SPF record, ten lookups maximum, and DKIM does the work that survives forwarding.

  3. 03

    Start DMARC at p=none, read the reports, and only then tighten to reject.