How to Set Up SPF, DKIM, and DMARC Records

Introduction

Setting up SPF, DKIM, and DMARC records might sound technical, but it’s actually quite simple. You don’t need to be an expert or know how to code. All you need is access to your domain’s DNS settings and the correct records from your email provider. These records help email services verify your messages, protect your domain from unauthorized sending, and improve email authentication. In this guide, we’ll show you how to set up SPF, DKIM, and DMARC records step by step. From adding TXT records to checking your setup, we’ll make the entire process easy to understand and follow.

What Are SPF, DKIM, and DMARC?

SPF (Sender Policy Framework)

SPF is an email authentication method that helps verify whether an email is sent from a server authorized by your domain owner. It works through a DNS TXT record that lists the servers or email services allowed to send emails on behalf of your domain.

DKIM (DomainKeys Identified Mail)

DKIM is an email authentication method that uses a digital signature to verify that an email was signed by an authorized sending service and has not been altered during delivery. It works using two cryptographic keys: a private key used to sign emails and a public key published in your domain’s DNS records.

DMARC (Domain-based Message Authentication, Reporting and Conformance)

DMARC is an email authentication standard that helps protect your domain from email spoofing. It checks whether SPF or DKIM passes and aligns with the domain shown in the sender’s email address. DMARC also lets domain owners set policies for handling emails that fail authentication and receive reports about email authentication activity.

Together, SPF, DKIM, and DMARC help receiving email servers verify legitimate messages, reduce domain spoofing, and support secure email communication.

Prerequisites for Setting Up SPF, DKIM, and DMARC

Before starting, make sure you have:

  1. A domain name: For example, yourbusiness.in.
  2. DNS access: Log in to the provider managing your domain’s DNS records.
  3. Email provider details: Get the required SPF and DKIM records from your email service.
  4. Permission to edit DNS: You must be able to add or update records.
  5. An email address for testing: Use it to check your setup after configuration.

Once everything is ready, you can begin.

How to Set Up SPF, DKIM, and DMARC

Follow these six steps to configure email authentication for your domain.

DNS management panel showing how to add SPF, DKIM, and DMARC TXT records for email authentication.
Add SPF, DKIM, and DMARC TXT records to your domain’s DNS settings for email authentication.

Step 1: Log In to Your Domain’s DNS Dashboard

First, open the website where your domain’s DNS records are managed.

This might be Cloudflare, GoDaddy, Namecheap, or another DNS provider.

  1. Sign in to your DNS provider.
  2. Select your domain.
  3. Find DNS Management, DNS Settings, or DNS Records.
  4. Open the section where you can add or edit DNS records.

You’ll usually see an option like Add Record.

Screenshot suggestion: DNS management dashboard.

Step 2: Add or Update Your SPF Record

An SPF record tells receiving email servers which sending services are authorized for your domain.

Here’s how to configure it:

  1. Check whether your domain already has a TXT record beginning with v=spf1.
  2. If it doesn’t, click Add Record.
  3. Select TXT as the record type.
  4. Enter @ as the hostname if your DNS provider uses it for the root domain.
  5. Paste the SPF value supplied by your email provider.
  6. Save your changes.

Important: Don’t create multiple SPF records for the same hostname. If one already exists, update it to include all authorized sending services instead of adding another.

Step 3: Configure Your DKIM Record

DKIM helps receiving servers verify that your email was signed by an authorized sending service.

Your email provider will give you the required DKIM details.

To add them:

  1. Open your domain’s DNS settings.
  2. Click Add Record.
  3. Select TXT or CNAME, depending on your provider’s instructions.
  4. Enter the DKIM hostname, such as selector1._domainkey.
  5. Paste the DKIM value provided by your email service.
  6. Save the record.

Some providers also require you to enable DKIM signing in their dashboard.

Quick Tip: Always copy the DKIM hostname and value exactly. Even a small mistake can cause verification to fail.

Step 4: Create Your DMARC Record

DMARC helps receiving servers decide what to do when emails fail authentication and domain-alignment checks.

Here’s how to add a DMARC record:

  1. Open your DNS management panel.
  2. Click Add Record.
  3. Choose TXT.
  4. Enter _dmarc as the hostname.
  5. Add your DMARC policy.
  6. Save the record.

For example, a basic monitoring policy looks like this:

v=DMARC1; p=none

This is an illustrative starting policy, not a complete configuration for every domain.

The p=none setting allows you to monitor authentication without requesting that failing emails be blocked. It does not prevent spoofing by itself.

For useful monitoring, configure DMARC reports to an appropriate mailbox or reporting service. Review legitimate sending sources before moving to stricter policies.

Step 5: Save Your DNS Changes

After adding your records, make sure everything is saved.

DNS updates may appear within minutes, but sometimes take several hours or longer, depending on caching and your provider’s settings.

While waiting:

  • Check that every hostname is correct.
  • Make sure the record values are complete.
  • Avoid creating duplicate SPF or DMARC records.
  • Confirm you’re editing the correct DNS zone.

Once the new records are publicly visible, you can test them.

Step 6: Verify Your SPF, DKIM, and DMARC Records

Now it’s time to check whether your authentication records are working.

  1. Open your email provider’s domain verification section.
  2. Check whether your SPF, DKIM, and DMARC records are detected.
  3. Send a test email from your domain.
  4. Check the authentication results in the received message.

Remember, a DNS record being published doesn’t always mean email authentication is working correctly. Testing a real email helps confirm your setup.

Example DNS Settings for SPF, DKIM, and DMARC

Here’s a simple reference table showing where these records are usually added.

RecordTypeDNS NameValue
SPFTXT@Provider-supplied SPF value
DKIMTXT or CNAMEselector._domainkeyProvider-supplied DKIM value
DMARCTXT_dmarcYour configured DMARC policy

Note: These are general examples. Your actual DNS values and hostnames depend on your email provider and domain configuration.

How to Check If SPF, DKIM, and DMARC Are Working

One easy way to test your setup is through Gmail.

  1. Send an email from your business domain to a Gmail account.
  2. Open the received message on a computer.
  3. Click the three-dot menu beside the message.
  4. Select Show original.
  5. Look for SPF, DKIM, and DMARC results.
Gmail Show Original message displaying PASS results for SPF, DKIM, and DMARC email authentication checks.
Check Gmail’s Show Original section to confirm whether SPF, DKIM, and DMARC authentication has passed.

You may see:

  • SPF: PASS — The sending server passed the SPF check.
  • DKIM: PASS — The email’s DKIM signature was verified.
  • DMARC: PASS — At least one authentication method passed with the required domain alignment.

If a check fails, review the relevant DNS record and your sending provider’s settings.

How to Fix Common SPF, DKIM, and DMARC Setup Errors

1. Multiple SPF Records Found

  • Problem: Having multiple SPF records at the same hostname can cause email authentication failures.
  • Fix: Combine all authorized sending services into one SPF record.

2. DKIM Verification Failed

  • Problem: An incorrect DKIM hostname, missing public key, or disabled DKIM signing can cause verification to fail.
  • Fix: Check the DKIM details provided by your email service and make sure DKIM signing is enabled.

3. DMARC Authentication Failed

  • Problem: DMARC fails when neither SPF nor DKIM passes authentication with the required domain alignment.
  • Fix: Check your SPF and DKIM settings and make sure at least one authenticated domain aligns with your visible From address.

4. DNS Record Not Found

  • Problem: The DNS record may be missing, entered under the wrong hostname, or not yet publicly visible.
  • Fix: Verify the record name, type, and value in your DNS management panel.

5. Domain Verification Pending

  • Problem: Your email service may not have detected the updated DNS records yet.
  • Fix: Allow time for DNS changes to become visible, confirm the records are correct, and retry verification.

Conclusion

Setting up SPF, DKIM, and DMARC records is a simple but important step toward secure and reliable email communication. With the right DNS settings, you can authenticate your emails, help protect your domain from spoofing, and support better email deliverability. Always double-check your records and test them after configuration to make sure everything works correctly.

FAQs

Can I configure SPF, DKIM, and DMARC myself?

Yes. You can set up these records yourself if you have access to your domain’s DNS settings and the correct information from your email provider.

Can I have multiple SPF records?

No. You should have only one SPF record per hostname. Include all authorized sending services in that record.

How long does DNS verification take?

DNS changes may appear within minutes, but verification can take several hours or longer depending on DNS caching and your provider.

Will SPF, DKIM, and DMARC prevent emails from going to spam?

Not completely. These records support email authentication, but sender reputation, email content, and recipient engagement also affect inbox placement.

How to Configure SPF, DKIM, and DMARC with SMTPPrime

SMTPPrime makes it easy to access the DNS details needed to verify your sending domain.

Follow these steps:

  1. Log in to your SMTPPrime dashboard.
  2. Open Domains and Connections.
  3. Add a domain you own or are authorized to manage.
  4. Automatically TXT records will be generated for that domain.
  5. Copy the required SPF, DKIM, and DMARC records.
  6. Add these records to your domain’s DNS settings.
  7. Wait for the DNS records to propagate. This may take a few minutes. 
  8. Return to SMTPPrime and verify your domain.

Once verification is successful, your SMTP credentials automatically become available under Domains and Connections. You can then choose your preferred sending method: SMTP, Email Sending Application, or API.

Need help getting started? Read our SMTPPrime Getting Started Guide.

Share This Guide

Leave a Reply

Your email address will not be published. Required fields are marked *