How to Configure SPF, DKIM, and DMARC for Your Domain Print

  • email authentication, email deliverability, DKIM, DMARC, SPF, domain authentication, email spam, email security, Microsoft 365, email spoofing, cpanel email, Google Workspace, DNS records
  • 0

How to Configure SPF, DKIM, and DMARC for Your Domain

If you send email using your business domain, properly configured email authentication can help receiving mail servers determine whether your messages are legitimate.

Three important technologies used for email authentication are SPF, DKIM, and DMARC.

Together, they help reduce domain spoofing, improve the ability of receiving systems to evaluate your messages, and support reliable email delivery.

Lagrange Point Media (LPM) provides DNS and email management tools through cPanel to help customers configure these records.

This guide explains what SPF, DKIM, and DMARC do, how to configure them, and how to identify common authentication problems.

1. Understanding Email Authentication

When you send an email, the receiving mail server performs several checks to determine whether the message should be accepted.

These checks may include:

  • Whether the sending server is authorized.

  • Whether the message has a valid cryptographic signature.

  • Whether the authenticated domain matches the visible sender's domain.

  • Whether the sending server has a good reputation.

  • Whether the message appears suspicious or unwanted.

SPF, DKIM, and DMARC address different parts of this process.

Important: Email authentication does not guarantee inbox placement. Receiving providers also consider reputation, spam complaints, message content, and other factors.

2. What Is SPF?

SPF stands for Sender Policy Framework.

It allows domain owners to identify which servers and services are authorized to send email using their domain in the SMTP envelope.

SPF policies are published as DNS TXT records.

For example, a business might send email through:

  • Its cPanel hosting server.

  • Microsoft 365.

  • Google Workspace.

  • A transactional email service.

  • An email marketing platform.

Each sending service may require specific SPF authorization.

An illustrative SPF record looks like:

v=spf1 include:example.com -all

This is an example only and should not be copied into your DNS.

Important: SPF validates the domain used for the SMTP envelope sender, not necessarily the email address displayed in the recipient's inbox.

3. Understanding SPF Record Components

An SPF record contains mechanisms and qualifiers that describe which senders are authorized.

Common components include:

v=spf1

Identifies the record as an SPF policy.

ip4:

Authorizes a specific IPv4 address or range.

include:

References another domain's SPF authorization policy.

-all

Indicates that senders not authorized by the policy should fail SPF evaluation.

~all

Indicates a soft failure for unauthorized senders.

Important: The correct SPF policy depends on your actual sending services.

Do not add mechanisms simply because they appear in an online example.

4. How to Check SPF in cPanel

If you use LPM-hosted email, cPanel provides an Email Deliverability interface that can help identify SPF configuration problems.

To access it:

  1. Sign in to the LPM Client Portal.

  2. Open your active hosting service.

  3. Access cPanel.

  4. Search for Email Deliverability.

  5. Locate your domain.

  6. Click Manage.

  7. Review the SPF information.

If cPanel identifies a problem, it may display a recommended record or repair option.

Important: Before applying an automatic repair, verify whether your domain also sends email through external services.

Replacing an existing SPF record without accounting for those services can cause legitimate messages to fail authentication.

5. Adding or Editing an SPF Record

If you manage DNS through cPanel, SPF records can be configured using Zone Editor.

To update SPF:

  1. Open cPanel.

  2. Search for Zone Editor.

  3. Click Manage beside your domain.

  4. Locate the existing SPF TXT record, if one exists.

  5. Review its contents.

  6. Edit the existing record or add the appropriate TXT record.

  7. Save your changes.

If your DNS is managed through Cloudflare, your registrar, or another provider, make the changes there instead.

Important: A domain must not publish multiple SPF policy records at the same hostname. If you use multiple sending services, their authorization requirements generally need to be incorporated into one valid SPF policy.

6. What Is DKIM?

DKIM stands for DomainKeys Identified Mail.

DKIM uses cryptographic signatures to help verify that an email was signed by a domain and that the signed portions of the message have not been modified.

The sending email system signs the message using a private key.

The receiving system retrieves the corresponding public key from DNS to verify the signature.

DKIM records are commonly published under a hostname containing:

._domainkey

For example:

selector1._domainkey.yourbusiness.com

The selector and record value depend on the email service.

Important: DKIM requires both a correctly configured signing system and a corresponding DNS record. Adding a public key to DNS does not automatically cause your email provider to sign messages.

7. How to Check DKIM in cPanel

For email sent through your LPM hosting server:

  1. Open cPanel.

  2. Navigate to Email Deliverability.

  3. Locate your domain.

  4. Click Manage.

  5. Review the DKIM status.

  6. Follow the displayed recommendations if necessary.

If cPanel manages your domain's authoritative DNS, it may be able to repair certain DKIM configuration problems automatically.

If DNS is hosted externally, you may need to copy the recommended record into that provider's DNS management interface.

Important: If you send email through Microsoft 365, Google Workspace, or another external service, use that provider's DKIM configuration instructions rather than assuming cPanel's DKIM record is sufficient.

8. Configuring DKIM for External Email Providers

Different email providers use different DKIM configurations.

For example:

Microsoft 365

Microsoft 365 commonly uses provider-specific CNAME records and requires DKIM signing to be enabled for the domain through Microsoft's administration tools.

Google Workspace

Google Workspace provides DKIM key generation and activation through its administration tools. Its configuration commonly uses a TXT record.

Other Email Providers

Transactional email and marketing services may provide TXT or CNAME records for domain authentication.

To configure DKIM:

  1. Sign in to your email provider's administration interface.

  2. Locate its domain authentication or DKIM settings.

  3. Obtain the exact DNS record names and values.

  4. Add the records at your authoritative DNS provider.

  5. Allow DNS changes to become visible.

  6. Complete the provider's verification or activation process.

Important: Do not reuse another provider's DKIM records or generate arbitrary values. The records must match the signing keys and configuration of the actual sending service.

9. What Is DMARC?

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

DMARC builds on SPF and DKIM to help protect the domain displayed in the From address.

It allows domain owners to publish a policy requesting how receiving servers should handle messages that fail DMARC authentication.

DMARC also supports reporting mechanisms that can help identify systems sending email using your domain.

A DMARC policy is published as a DNS TXT record.

The hostname is typically:

_dmarc.yourbusiness.com

10. Understanding DMARC Policies

DMARC supports three primary policy settings.

p=none

Requests no DMARC-specific enforcement action.

This is commonly used when initially monitoring email authentication.

p=quarantine

Requests that messages failing DMARC authentication be treated as suspicious.

Receiving providers may place these messages in spam or apply other handling.

p=reject

Requests that messages failing DMARC authentication be rejected.

Important: DMARC policies are requests to receiving systems. Individual providers determine how they apply their own filtering and acceptance rules.

11. Creating a Basic DMARC Record

A simple monitoring policy looks like:

v=DMARC1; p=none

This record identifies a DMARC policy and requests monitoring without DMARC-specific enforcement.

To add it through cPanel:

  1. Open Zone Editor.

  2. Click Manage for your domain.

  3. Add a new TXT record.

  4. Enter _dmarc as the hostname, using the format expected by your DNS interface.

  5. Enter the DMARC policy value.

  6. Save the record.

Before adding a record, check whether a DMARC policy already exists.

Important: This basic example does not configure reporting. It also does not provide the same level of spoofing protection as a properly validated enforcement policy.

Do not create multiple DMARC policy records at the same hostname.

12. Understanding DMARC Reporting

DMARC supports reports that can help domain owners understand how their email is being authenticated.

One common reporting tag is:

rua=

This specifies an address where aggregate DMARC reports may be sent.

For example:

v=DMARC1; p=none; rua=mailto:dmarc@yourbusiness.com

This is an illustrative configuration.

Aggregate reports can contain information about:

  • Sending IP addresses.

  • Authentication results.

  • Domains used for authentication.

  • DMARC policy evaluation.

  • Message volumes.

These reports are typically machine-readable XML files.

Tip: Businesses that send significant amounts of email may benefit from a DMARC reporting service that organizes the information into readable reports.

Important: Only specify a reporting mailbox or service that is prepared to receive the reports. Some external reporting destinations require additional DNS authorization.

13. Understanding SPF and DKIM Alignment

DMARC introduces an important concept called domain alignment.

Alignment compares the domain in the visible From address with the domains authenticated through SPF or DKIM.

For DMARC to pass, at least one of the following must succeed:

  • SPF passes and its authenticated domain aligns with the visible From domain.

  • DKIM passes and its signing domain aligns with the visible From domain.

Both methods do not need to pass simultaneously.

For example, an email might pass SPF authentication but fail DMARC because SPF authenticated a different, unaligned domain.

Important: An SPF or DKIM pass by itself does not necessarily mean DMARC passes.

14. Why Email Forwarding Can Cause Authentication Problems

Email forwarding can complicate authentication.

When a message is forwarded, the forwarding server may not be authorized by the original sender's SPF policy.

As a result, SPF can fail at the final destination.

A valid, aligned DKIM signature may still allow the message to pass DMARC, provided the forwarding process has not modified the signed content in a way that invalidates the signature.

Some forwarding services use additional technologies, such as ARC, to help receiving systems evaluate forwarded messages.

Important: Forwarding problems are not always resolved by changing SPF records. The appropriate solution depends on the forwarding system and the recipient's email provider.

15. Configuring Authentication for WordPress Email

WordPress websites often send automated messages such as:

  • Contact form notifications.

  • Password reset messages.

  • Order confirmations.

  • Customer account notifications.

  • Appointment confirmations.

These messages may be sent through the hosting server or through a separate SMTP or email delivery service.

If your website uses an SMTP plugin connected to Microsoft 365, Google Workspace, or another provider, the domain's authentication configuration must account for that service.

Important: Installing an SMTP plugin does not automatically configure SPF, DKIM, or DMARC.

Those records must be configured according to the actual sending provider.

16. Using Multiple Email Sending Services

Some businesses use several services to send email.

For example:

  • Microsoft 365 for employee email.

  • A transactional provider for website notifications.

  • An email marketing service for newsletters.

Each service may have different domain authentication requirements.

When configuring multiple providers:

  1. Identify every service that sends email using your domain.

  2. Review each provider's authentication instructions.

  3. Configure SPF authorization where appropriate.

  4. Configure DKIM signing for each supported service.

  5. Verify DMARC alignment.

  6. Test outgoing messages.

  7. Review authentication results.

Important: Multiple services can use separate DKIM selectors, but the SPF policy for a particular hostname must remain valid and must not be duplicated.

17. Understanding SPF Lookup Limits

SPF has a limit on the number of DNS-querying mechanisms and modifiers evaluated during an SPF check.

The standard limit is 10 DNS lookups.

Mechanisms such as include, a, mx, exists, and the redirect modifier can contribute to this limit.

Exceeding the limit can cause SPF evaluation to return a permanent error.

Important: Adding more services to an SPF record without considering the lookup limit can create authentication problems.

If your SPF configuration is complex, review it carefully rather than repeatedly adding new include entries.

18. Checking Whether Email Authentication Works

After configuring your records, verify that they're published correctly.

You can use:

Google Admin Toolbox Dig

Check the appropriate TXT or CNAME records for your domain.

You can also send a test email to a mailbox that allows you to inspect message headers.

Depending on the receiving provider, authentication results may show:

  • spf=pass

  • dkim=pass

  • dmarc=pass

These results indicate how that receiving system evaluated the message.

Important: Successful authentication does not guarantee inbox delivery, and a DNS record existing does not prove that outgoing messages are using it correctly.

19. Common SPF Problems

Multiple SPF Records

Publishing more than one SPF policy at the same hostname can cause authentication errors.

Missing Sending Services

A legitimate email provider may not be authorized.

Incorrect Syntax

A malformed SPF record may fail validation.

Too Many DNS Lookups

An overly complex policy may exceed the SPF lookup limit.

Wrong DNS Provider

You may be editing a DNS zone that isn't authoritative for your domain.

20. Common DKIM Problems

Missing DNS Record

The receiving system cannot locate the public key.

Incorrect Selector

The email signature references a selector that doesn't match the published record.

DKIM Signing Isn't Enabled

The provider may require an additional activation step.

Incorrect DNS Value

The published key may be incomplete or incorrect.

Message Modification

Changes to signed message content can invalidate a DKIM signature.

21. Common DMARC Problems

SPF and DKIM Pass, but DMARC Fails

The authenticated domains may not align with the visible From domain.

Legitimate Email Is Rejected

A restrictive policy may have been enabled before all sending services were configured correctly.

No Reports Are Arriving

The reporting address may be missing, incorrect, or not properly authorized.

Multiple DMARC Records

More than one DMARC policy record at the same hostname can prevent proper policy discovery.

22. Should You Use p=none, p=quarantine, or p=reject?

The appropriate DMARC policy depends on your email configuration and how confidently you've identified all legitimate sending services.

A common implementation process is:

  1. Identify legitimate sending systems.

  2. Configure SPF and DKIM.

  3. Verify DMARC alignment.

  4. Publish a monitoring policy.

  5. Review authentication results and reports.

  6. Correct problems affecting legitimate email.

  7. Consider moving toward enforcement when ready.

A stronger policy can provide better protection against direct spoofing of your domain, but only when your legitimate email is properly authenticated.

Warning: Moving directly to p=reject without verifying your sending systems can cause legitimate business email to be rejected.

23. Understanding Email Deliverability and Server Reputation

Even with correctly configured SPF, DKIM, and DMARC, email may still be rejected or filtered.

Receiving providers also evaluate factors such as:

  • Sending IP reputation.

  • Domain reputation.

  • Spam complaints.

  • Message volume and patterns.

  • Suspicious links or attachments.

  • Previous sending behavior.

  • Recipient-specific filtering policies.

For example, a receiving provider may reject messages from an IP address because of its reputation, even when the message passes authentication.

Important: SPF, DKIM, and DMARC help establish authentication. They do not override receiving providers' reputation-based filtering systems.

24. Getting Help from LPM

If you're having trouble configuring SPF, DKIM, or DMARC, LPM can help investigate hosting-related DNS and email authentication issues.

Submit a support ticket through the LPM Client Portal.

Please include:

  • Your domain name.

  • Your email provider.

  • Any additional services that send email using your domain.

  • The authentication problem you're experiencing.

  • Any error or rejection messages.

  • Whether your DNS is managed through cPanel or an external provider.

Do not include account passwords or private DKIM signing keys in your support ticket.

LPM can assist with hosting-related configuration. External email providers may require additional settings or verification through their own administration systems.


Additional Resources:


Was this answer helpful?

« Back