How to set up SPF, DKIM and DMARC: 6 steps in order

From the list of systems that send as your domain to one SPF record, from DKIM to DMARC in monitoring mode and on to reject: the order for setting up domain authentication without breaking delivery.

· 12 min readEmail

Short answer

Set up SPF, DKIM and DMARC in this order: list every system that sends mail as your domain, write one SPF record, turn on DKIM in each sending tool, publish DMARC with p=none and read the reports, then move to quarantine and reject in stages. A well-known mistake is adding a second SPF record.

A business sends its invoices from the accounting program, order notifications from the shop software, the newsletter from a separate tool and form notifications from the website’s server, all as name@example.com. When one of them has a missing record, only the messages from that stream may land in spam, and nobody works out why straight away. If you are looking up how to set up SPF, DKIM and DMARC, the real issue is an order: first know who sends mail, then write the records to match that list, and only at the end tighten the policy.

This article walks through six steps in order for someone who can manage DNS records. The newsletter list, consent and content side is in how to start email marketing; who holds the domain and its DNS is in how to choose a domain name and hosting. We do not repeat either here.

The six steps of setting up SPF, DKIM and DMARC: three identity records first, then three DMARC policiesIdentity recordsDMARC policy1Senderlist2One SPFrecord3DKIM ineach tool4p=none:monitor5quarantine:spam folder6reject:refuse The six steps of setting up SPF, DKIM and DMARC: three identity records first, then three DMARC policiesIdentity records1Sender list2One SPF record3DKIM in each tool4p=none: monitor5quarantine: spam folder6reject: refuseDMARC policy
Figure: A sender list, one SPF record and DKIM in each tool come first; then DMARC is monitored with p=none, moves to quarantine and only last to reject.

What the three records do

All three are published in your domain’s DNS as TXT records, and each answers a different question. The table below summarises what each record says and who Google’s sender guidelines ask to set it up.

Record In plain words Where it sits in DNS In Google’s guidelines
SPF A list of “these servers may send email on behalf of my domain” A TXT record on the domain itself, starting with v=spf1 All senders must set up SPF or DKIM
DKIM A signature added to the message; the receiver checks it with the public key in DNS A TXT record named selector._domainkey The same line; sending to personal Gmail accounts needs a key of 1,024 bits or longer
DMARC What the receiver should do if SPF or DKIM does not pass, and where to send reports A TXT record named _dmarc Senders of 5,000 or more messages a day must set up all three

What DMARC means by “pass” is this: SPF or DKIM must authenticate the message, and the authenticated domain must match the domain in the message’s “From:” header. That detail explains why messages a tool signs with its own domain may not pass DMARC. For a quick reminder of the terms, the glossary has entries for SPF, DMARC and DNS.

1. List every system that sends mail as your domain

Gmail’s guidelines ask that your SPF record includes all of your domain’s email senders; messages from third-party senders left out of the record are more likely to be marked as spam. To find everyone, including web servers, mail servers, forms and third-party services, make a list like this and put one responsible person against each line:

  • Staff mailboxes (Google Workspace, Microsoft 365 or your hosting company’s mailboxes)
  • Newsletter and automation tool, CRM
  • Shop software: order, shipping and password-reset messages
  • Website forms and plugins
  • Accounting, booking, support and appointment systems
  • An old tool or an agency account

There are two ways to complete the list. The first is to send a message from each system to your own address and look at the message source; Google’s DKIM document tells you to find the s value in the DKIM-Signature header, which is the selector. The second is DMARC reports (step 5). The IETF’s DMARC specification makes the same point: in complicated setups a server can be overlooked or a third-party sending arrangement can go unnoticed, which is why monitoring mode exists.

2. Write one SPF record

According to Google’s SPF document, a domain can have one SPF record, and that record can also authorise other servers and third parties. So you do not open a new record for each tool; you add an include: to the existing one. The record for a domain that sends only through Google Workspace is given in Google’s document as the first line below; the second line shows a second tool added:

example.com.  TXT  "v=spf1 include:_spf.google.com ~all"
example.com.  TXT  "v=spf1 include:_spf.google.com include:mailer.example.net ~all"

The second line replaces the first; do not publish both. In place of mailer.example.net goes the value your tool’s help page gives. The rules in the document are short:

  • v=spf1 must be the first tag in the record.
  • The all mechanism goes at the end of the list; anything after it is ignored.
  • ~all usually lets messages from senders not in the record through but marks them as suspicious. -all may cause those messages to be rejected, and if the record is wrong, more messages may go to spam. If you use -all, the document recommends using DMARC reports to find your senders.
  • The record should not include more than 10 references (lookups) to other domains or servers.

Add the record as a TXT record on the DNS management page of your domain provider; the steps differ by provider.

3. Turn on DKIM in each sending tool

DKIM has two keys: the private key on the sending server adds a signature to every message, and the public key you publish in DNS lets receivers check that signature. Each tool generates its own key, so this step is repeated tool by tool. In the Google Workspace example, the path in the English interface is:

  1. In the Admin console, go to Menu, Apps, Google Workspace, Gmail and open Authenticate email.
  2. In the Selected domain menu, pick the domain and click Generate New Record.
  3. Choose a 2048-bit key if your domain provider supports it, otherwise 1024 bits; the default prefix selector is google.
  4. Copy the DNS Host name and the TXT record value shown in the window and add them as a TXT record at your domain provider.
  5. Once the record is live, click Start authentication on the same page. The status changes to “Authenticating email with DKIM”.
google._domainkey.example.com.  TXT  "v=DKIM1; k=rsa; p=KEY"

Details from Google’s document: after you turn on Gmail for your organisation you must wait 24 to 72 hours before you can get the key. A key added to DNS can take up to 48 hours to start working, and each domain needs its own key. You cannot verify by sending a message to yourself; send to someone using Gmail or Google Workspace and look at the message headers. If you use an outbound gateway, make sure its settings do not interfere with DKIM; the document gives adding a footer to every message as one example.

We do not give interface names for tools outside Google here; every tool’s domain verification screen is different. Follow the steps in the tool’s help page and add the record it gives you on the same DNS page.

4. Publish DMARC in monitoring mode

Google asks you to set up SPF and DKIM at least 48 hours before DMARC. The IETF specification sets the same order: DMARC is published once SPF, DKIM and the reports mailbox are in place, and most domain owners start with p=none. Use a separate address for reports rather than your own mailbox, because reports arrive every day.

_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"

p=none asks the receiver to deliver messages as usual; according to Google there is no risk of messages being rejected or marked as spam. Gmail’s guidelines also say that for senders of 5,000 or more messages a day, the DMARC enforcement policy can be “none”. Stay on this step for a week.

5. Read the reports

Google recommends reviewing the reports every day in the first week, and says a week is usually enough for the data to represent all your mail streams. According to the IETF specification a person can read the reports, but their format means machine parsing is recommended, and it notes that many third-party services do this. For a small business the easiest route is to give one of those services your reports address.

As you read, ask the same three questions about each source:

  1. Do I recognise this source? If it is not on the list, find out who it is.
  2. If it is a tool I know, does at least one of SPF or DKIM pass with alignment?
  3. If not, why: is it missing from the SPF record, is DKIM off, is the “From:” domain different?

After each fix, look at the next version of the report. An unknown source that does not pass is exactly what you want blocked once you tighten.

6. Move to quarantine and reject in stages

Google’s recommendation: stay in monitoring mode for at least a week, and if you see no problems with outgoing mail, move to quarantine for a small percentage of messages, then raise the percentage to 100% over time. The example record in the document uses pct=5.

_dmarc.example.com.  TXT  "v=DMARC1; p=quarantine; pct=5; rua=mailto:dmarc-reports@example.com"

Under quarantine, messages that fail DMARC go to the recipient’s spam folder, where recipients can review them. reject means receiving servers refuse messages that fail and they are never delivered; Google flags this with a caution. So move to reject only after the reports have stayed clean during quarantine.

One update: RFC 9989, published in May 2026, removed the pct tag and introduced the t testing tag in its place, noting that pct values other than 0 and 100 were usually applied inaccurately and differently by different implementations. Google’s document still recommends the percentage-based move, so the record above is valid; but writing pct=5 does not mean every receiver will quarantine only 5% of messages. Move to quarantine once every source you recognise passes DMARC in the reports, and watch the result there. The same specification says domains whose users post to mailing lists should not publish reject; if they do, they should first use none for at least a month, then quarantine for an equal period.

Mistakes that break delivery

  • Two SPF records. According to Google’s SPF document, a domain has one SPF record. Opening a separate TXT record for a new tool breaks that rule; edit the existing record.
  • A new sender is not added to SPF. If you move to a new tool and do not update the record, messages from it are more likely to go to spam. Removing tools you no longer use is also a good habit. If you are planning a tool switch such as Klaviyo or HubSpot, the records are part of that plan.
  • Going over the limit of 10 references. Each include: is a reference to another domain; the more tools you add, the closer you get to the limit.
  • Hardening early with -all. If the record is missing something or wrong, legitimate messages may go to spam.
  • Turning on DMARC before SPF and DKIM. Google asks for SPF and DKIM to be set up at least 48 hours before DMARC.
  • Writing reject without reading reports. A legitimate sender you did not recognise gets blocked.
  • Sending reports to a personal mailbox. Reports arrive every day; in a personal mailbox they get lost and go unread.

Common questions

Does a small business need DMARC too?

Google’s guidelines ask everyone who sends to personal Gmail accounts to set up SPF or DKIM, and make DMARC mandatory for senders of 5,000 or more messages a day. Even so, Google recommends setting up all three for your domains. A DMARC record in monitoring mode does not touch your messages; it only brings reports.

Does setting up all three stop emails going to spam completely?

No. Messages that are not authenticated are more likely to be marked as spam or rejected, but Gmail’s guidelines list other conditions too, such as spam complaint rate, one-click unsubscribe and valid DNS records. Authentication is a necessary condition, not a sufficient one. With the records in place, the next jobs are complaint rate, list health and sending volume; our email deliverability guide walks through them.

How long do the records take to work?

Google says a DKIM key added to DNS can take up to 48 hours to start working, and that SPF and DKIM should be set up at least 48 hours before DMARC. Do not expect to see results right after you write a record.

One step you can take alone today

Write every system that sends mail as your domain into a table, and next to each one put the person responsible and whether DKIM is on. Then ask whoever manages DNS for the list of TXT records on your domain and count the ones that start with v=spf1; if there is more than one, merging them into a single record is your first job. These two checks decide in what order, and how fast, the remaining steps go.

Our email and CRM service includes SPF, DKIM, DMARC and sender reputation monitoring under deliverability; if we cannot get access to your domain’s DNS settings, we cannot fix deliverability. We also covered why these records need to be ready before flows are built in how to set up email automation.

Sources

This article is general information, not legal, financial or technical advice. Platforms, their rules and the law change over time, so some details may have changed since 11 November 2026 or contain small errors. Before you make a decision for your business, check the current official sources or write to us.

Tell us about
your project.

Fill in the form or write to us directly, and we will agree on a day to talk.

Your first meeting is with Deniz Sezer, founder of Detmore.

First meeting free · Reply within one working day · Written proposal in 2 to 3 days · NDA ready

What do you need? pick as many as you like

Name, email and phone are required.

Contact

We reply within one working day.