How to Set Up SPF, DKIM and DMARC: Step-by-Step for Beginners

What Are SPF, DKIM, and DMARC?

Before configuring these records, it helps to understand what each one does.

1. What Is SPF?

SPF stands for Sender Policy Framework. It is an email authentication protocol that identifies which mail servers are authorised to send emails using your domain.

For example, if your company uses Google Workspace, you can publish an SPF record that authorises Google’s mail servers to send emails on your behalf.

When a receiving email server checks an incoming message, it compares the sending server against your published SPF record.

If the sender is authorised, SPF passes. If it is not authorised, SPF may fail.

2. What Is DKIM?

DKIM stands for DomainKeys Identified Mail. It uses digital signatures to help receiving servers verify that an email was signed by an authorised domain and that the signed parts of the message have not been altered.

When you enable DKIM, your email provider signs outgoing messages using a private cryptographic key.

The corresponding public key is published in your domain’s DNS records.

The receiving server uses this public key to verify the signature.

This helps protect your domain against email tampering and impersonation.

3. What Is DMARC?

DMARC stands for Domain-based Message Authentication, Reporting and Conformance.

It builds on SPF and DKIM by checking whether authenticated sending domains align with the domain shown in the visible From address.

DMARC also tells receiving email servers what to do with messages that fail its authentication requirements.

Its three main policies are:

  • None (p=none): Monitor authentication results without requesting quarantine or rejection.
  • Quarantine (p=quarantine): Ask receiving servers to treat failing messages as suspicious.
  • Reject (p=reject): Ask receiving servers to reject messages that fail DMARC.

DMARC also supports reporting, allowing domain owners to identify authentication failures and unauthorised email sources.

How SPF, DKIM, and DMARC Work Together

These three protocols perform different jobs, but they are most effective when configured together.

Consider a business that sends invoices using Google Workspace and marketing campaigns through Mailchimp.

SPF identifies the authorised sending services. DKIM signs outgoing messages, while DMARC checks whether the authentication results align with the company’s visible From domain.

<AsyncImage query=”SPF DKIM DMARC email authentication process flow diagram” aspectRatio=”16:9″ width=”100%” />

The process works as follows:

  1. Your business sends an email.
  2. The receiving server checks the sending source against SPF.
  3. It verifies the DKIM digital signature.
  4. DMARC checks whether SPF or DKIM passes with the required domain alignment.
  5. The receiving server applies the published DMARC policy.

A DMARC pass requires at least one aligned SPF or DKIM pass. Both do not have to pass.

What You Need Before Setting Up SPF, DKIM, and DMARC

Gather the following information before making changes to your DNS settings.

  • Your registered domain name.
  • Access to your domain registrar or DNS hosting account.
  • Your business email hosting provider.
  • A list of every service that sends emails using your domain.
  • SPF configuration details from each provider.
  • DKIM configuration details from each provider.
  • An email address for receiving DMARC reports.

Your domain registrar and email hosting provider may be different companies. For example, you might purchase a domain through Namecheap, manage DNS through Cloudflare, and use Google Workspace for email.

You must update DNS records wherever your domain’s authoritative nameservers are managed.

Step-by-Step Guide to Setting Up SPF

SPF is usually the first authentication record to configure.

Step 1: Identify All Your Email Sending Services

List every platform that sends emails using your domain.

These may include:

  • Google Workspace.
  • Microsoft 365.
  • Mailchimp.
  • Brevo.
  • Amazon SES.
  • Shopify.
  • Your website contact form.
  • Customer relationship management software.

Do not include only your main business email provider. Missing a legitimate sending service can cause authentication failures.

Step 2: Generate Your SPF Record

Your SPF record is a DNS TXT record containing the authorised email sources.

For a business using Google Workspace exclusively, the standard record is:

v=spf1 include:_spf.google.com ~all

For Microsoft 365 exclusively, the standard record is:

v=spf1 include:spf.protection.outlook.com -all

If you use multiple providers, their authorised sending sources must be combined into one SPF record.

For example, a business using Google Workspace and Microsoft 365 may use:

v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all

These are examples. Always confirm the correct record with your providers before publishing it.

Step 3: Log In to Your DNS Provider

Open the dashboard of your DNS hosting provider.

Find the section labelled DNS Management, DNS Records, or Zone Editor.

Select the option to create a new TXT record.

Step 4: Add Your SPF Record

Enter the following information:

Field Value
Type TXT
Host/Name @
Value Your SPF record
TTL Automatic or provider default

Save the record.

If an SPF record already exists, update it rather than creating another one.

A domain should have only one SPF record. Multiple SPF records can cause a permanent SPF error.

Step 5: Verify Your SPF Configuration

Use an SPF lookup tool such as MXToolbox to check whether the record is published correctly.

Also confirm that every legitimate sending service is included.

Remember that SPF has a limit of 10 DNS lookups during evaluation. Too many nested lookups can cause SPF authentication to fail.

Google notes that DNS changes may take up to 48 hours to become effective.

Step-by-Step Guide to Setting Up DKIM

Once SPF is configured, the next step is enabling DKIM.

The exact process depends on your email hosting provider.

Step 1: Open Your Email Administration Dashboard

Log in to your email provider’s administrator account.

For Google Workspace, open the Google Admin console.

For Microsoft 365, open the Microsoft Defender or Exchange administration environment and locate the DKIM settings for your custom domain.

Step 2: Generate Your DKIM Keys

Your email provider will generate the required DKIM configuration.

This usually includes:

  • A selector name.
  • A DNS record name.
  • A public key or CNAME destination.
  • A private signing key managed by the email provider.

Some providers use TXT records, while others use CNAME records.

Step 3: Publish the DKIM DNS Record

Go to your DNS management dashboard.

Add the record exactly as supplied by your email provider.

For example, a traditional DKIM TXT record may look like this:

Type: TXT
Host: selector1._domainkey
Value: v=DKIM1; k=rsa; p=YOUR_PUBLIC_KEY

This is an illustrative format. Do not publish the placeholder key. Use the actual record generated by your provider.

Microsoft 365 may provide two CNAME records instead of a public-key TXT record. Follow its current instructions.

Step 4: Enable DKIM Signing

Return to your email administration dashboard.

Select your custom domain and activate DKIM signing once the required DNS records have been published and verified.

Step 5: Test DKIM Authentication

Send a test email to an external account, such as Gmail.

Open the message and inspect its original headers or message source.

Look for an authentication result similar to:

dkim=pass

Also check that the signing domain belongs to your business domain or an appropriately aligned subdomain.

Step-by-Step Guide to Setting Up DMARC

DMARC is the final part of the authentication process.

Unlike SPF and DKIM, it combines authentication results with domain alignment and a policy for handling failures.

Step 1: Create a DMARC Reporting Address

Create an email address for receiving DMARC reports.

For example:

[email protected]

Alternatively, use a dedicated DMARC monitoring service that provides reporting and analysis.

Step 2: Create Your DMARC Record

A basic monitoring policy looks like this:

v=DMARC1; p=none; rua=mailto:[email protected]

Here is what each part means:

Tag Purpose
v=DMARC1 Identifies the DMARC version
p=none Requests monitoring without quarantine or rejection
rua Specifies where aggregate reports should be sent

The rua address must be capable of receiving reports.

Step 3: Add the DMARC Record to DNS

Open your DNS management dashboard.

Create a new TXT record using these details:

Field Value
Type TXT
Host/Name _dmarc
Value Your DMARC policy
TTL Automatic

Save the record.

Your complete DMARC record should resemble:

v=DMARC1; p=none; rua=mailto:[email protected]

Step 4: Monitor Your DMARC Reports

Allow time for receiving servers to process your messages and generate reports.

Review the reports to identify:

  • Legitimate sending services.
  • Unauthorised sending sources.
  • SPF failures.
  • DKIM failures.
  • Domain alignment problems.

DMARC reports are commonly delivered in XML format. A reporting service can make them easier to understand.

Step 5: Move Towards a Stronger DMARC Policy

Once you have confirmed that legitimate email sources authenticate correctly, consider strengthening your policy.

You can move from:

v=DMARC1; p=none; rua=mailto:[email protected]

To:

v=DMARC1; p=quarantine; rua=mailto:[email protected]

Eventually, you may use:

v=DMARC1; p=reject; rua=mailto:[email protected]

Do not move to quarantine or reject until you have identified and corrected legitimate authentication failures. Otherwise, important business emails may be rejected.

Best Tools to Check SPF, DKIM, and DMARC Records

Several free and paid tools can help you test your configuration.

Tool Main purpose Website
MXToolbox SPF, DKIM and DMARC lookups https://mxtoolbox.com/
Google Admin Toolbox DNS and email diagnostics https://toolbox.googleapps.com/
EasyDMARC DMARC monitoring and reporting https://easydmarc.com/
dmarcian DMARC analysis https://dmarcian.com/
DMARC Analyzer Email authentication monitoring https://www.mimecast.com/products/dmarc-analyzer/

These tools help identify configuration errors, authentication failures, and unauthorised sending sources.

Common SPF, DKIM, and DMARC Setup Mistakes

Even a small DNS configuration error can affect email delivery. Avoid these common problems.

1. Creating Multiple SPF Records

A domain must not have multiple SPF records. Combine all authorised sending services into one record.

2. Forgetting Third-Party Email Services

Your website, newsletter platform, and automated billing software may send emails using your domain. Include every legitimate source in your authentication strategy.

3. Publishing the Wrong DKIM Record

A missing selector, incorrect DNS name, or outdated public key can cause DKIM verification to fail.

Always copy the exact configuration supplied by your provider.

4. Enforcing DMARC Too Early

Starting with p=reject without checking legitimate sending services can block important emails.

Monitor first, correct authentication problems, and strengthen your policy gradually.

5. Ignoring DMARC Reports

Publishing DMARC without reviewing reports reduces its monitoring value.

Use reports to identify unknown senders, configuration problems, and authentication failures.

6. Forgetting About Subdomains

Marketing platforms and automated systems may send messages from subdomains.

Check their authentication configuration and ensure your DMARC policy covers the domains you use.

Frequently Asked Questions

1. Do I need SPF, DKIM, and DMARC for my business email?

Yes. All three are recommended for protecting business email domains. Bulk senders targeting Gmail, Yahoo, and Microsoft consumer inboxes also face specific authentication requirements.

2. Can I set up SPF, DKIM, and DMARC myself?

Yes. You can configure them through your DNS hosting dashboard and email provider’s administration settings. However, businesses using several sending services may benefit from technical assistance.

3. How long does SPF, DKIM, and DMARC setup take?

Publishing the DNS records may take only a few minutes. However, DNS propagation, DKIM activation, testing, and DMARC monitoring can take longer. Allow up to 48 hours for DNS changes where applicable.

4. Does DMARC work without SPF and DKIM?

DMARC relies on SPF or DKIM authentication results and domain alignment. It is therefore most effective when both protocols are properly configured.

5. What happens if my SPF record fails?

Messages may be marked as suspicious or rejected, depending on the receiving provider’s filtering policies and your DMARC configuration.

6. What is the difference between SPF and DKIM?

SPF verifies whether a sending server is authorised by the envelope sender’s domain. DKIM verifies a cryptographic signature associated with the signing domain and signed message content.

7. Is p=none enough for DMARC?

Yes. It is a valid monitoring policy and is accepted as the minimum DMARC policy under the published bulk sender requirements of major providers. However, moving to quarantine or reject offers stronger protection once your configuration is verified.

8. Can I use SPF, DKIM, and DMARC with Google Workspace and Microsoft 365?

Yes. Both providers support email authentication for custom domains. Follow each provider’s DNS instructions and ensure that all authorised sending services are covered.

Conclusion

Setting up SPF, DKIM, and DMARC is one of the most important steps towards securing your business email domain.

SPF identifies authorised sending servers, DKIM verifies message signatures, and DMARC checks authentication alignment while providing instructions for handling unauthenticated messages.

Start by identifying every service that sends emails using your domain. Configure SPF, enable DKIM, and publish a DMARC monitoring policy. Once you have reviewed the authentication reports and corrected any problems, gradually move towards stronger DMARC enforcement.

You do not need to be a cybersecurity expert to get started. With the right DNS records, careful testing, and regular monitoring, you can significantly improve your domain’s email security and build greater trust with receiving mail providers.

Leave a comment