Complete Guide to Email Authentication: SPF, DKIM, DMARC, and Best Practices

Email is a crucial communication channel for businesses, organizations, and individuals alike. Unfortunately, it’s also a prime target for scammers, spammers, and hackers. To protect against these threats, email authentication protocols like SPF, DKIM, and DMARC have been developed. By implementing these protocols, you can help protect your domain from email spoofing, phishing attacks, and other types of email fraud.

In this guide, we’ll take an in-depth look at SPF, DKIM, and DMARC, and explain how they work together to provide strong email authentication. We’ll also cover best practices and provide examples of optimal records to help ensure that your email is properly authenticated and delivered. Whether you’re an IT professional, an email marketer, or just looking to protect your personal email, this guide will provide you with everything you need to know about email authentication.

What is SPF?

Sender Policy Framework (SPF) is a type of email authentication that allows email servers to verify that incoming messages are actually from the domain they claim to be from. SPF works by adding a special DNS record to a domain’s DNS settings. This record lists all of the authorized sending servers for that domain.

When an email server receives a message, it can check the SPF record for the domain in the “From” address to see if the server that sent the message is authorized. If the sending server is not authorized, the receiving server can reject the message or mark it as spam.

Here’s an example of what an SPF record might look like:

v=spf1 ~all

This record allows Google’s email servers to send emails on behalf of the domain, but any other servers will be treated as “soft” failures.

Best practices for SPF include:

  • Use a dedicated domain for your email sending. This makes it easier to manage your SPF record and avoid conflicts with other services that may be using your domain.
  • Include all of your authorized sending servers in your SPF record. This includes any third-party services you may be using to send email.
  • Use the “-all” qualifier in your SPF record to reject any messages that don’t come from authorized servers.
  • Regularly monitor your SPF record to ensure it is up-to-date and accurate.

What is DKIM?

DomainKeys Identified Mail (DKIM) is another type of email authentication that uses digital signatures to verify the authenticity of incoming messages. DKIM works by adding a special signature to the header of the message that can be verified by the recipient’s email server.

To use DKIM, you’ll need to generate a public and private key pair for your domain. The public key is added to your domain’s DNS settings as a special TXT record. The private key is kept secure and used to sign outgoing messages.

When an email server receives a message with a DKIM signature, it can check the signature against the public key in the domain’s DNS settings to verify that the message was actually sent by the domain it claims to be from.

Here’s an example of what a DKIM signature might look like:

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=mail; t=1528867488;

Best practices for DKIM include:

  • Use a strong cryptographic

What is DMARC?

Domain-based Message Authentication, Reporting, and Conformance (DMARC) is a protocol that builds on top of SPF and DKIM to provide even stronger email authentication. DMARC allows domain owners to specify what actions email servers should take when they receive a message that fails SPF or DKIM checks.

To use DMARC, you’ll need to add a special DNS record to your domain’s DNS settings. This record includes information on how email servers should handle messages that fail SPF and/or DKIM checks.

When an email server receives a message with a DMARC record, it checks to see if the message passes SPF and DKIM checks. If the message passes both checks, it is delivered normally. If the message fails one or both checks, the email server checks the DMARC record to see what action to take.

Here are the possible actions specified by a DMARC record:

  • None: The email server takes no action and simply delivers the message as normal.
  • Quarantine: The email server marks the message as spam or junk and may deliver it to the recipient’s spam folder.
  • Reject: The email server outright rejects the message and does not deliver it to the recipient.

Here’s an example of what a DMARC record might look like:

v=DMARC1; p=reject; sp=reject;;;

This record specifies that messages that fail both SPF and DKIM checks should be rejected and not delivered. It also includes an email address where reports of failed messages should be sent.

Best practices for DMARC include:

  • Start with a “none” policy and monitor DMARC reports to ensure your legitimate email is passing authentication checks before moving to “quarantine” or “reject” policies.
  • Use DKIM and SPF in combination with DMARC for maximum protection.
  • Ensure that all authorized sending domains have valid SPF and DKIM records in place.
  • Regularly review DMARC reports to identify any unauthorized use of your domain and to address any issues with your authentication configuration.

By implementing SPF, DKIM, and DMARC, you can help protect your domain from email spoofing and phishing attacks while improving your email deliverability. Be sure to follow best practices and regularly monitor your authentication configuration to ensure that it remains accurate and up-to-date.

There are several online tools that you can use to check your SPF record and identify any issues. Here are a few that you might find helpful:

  1. SPF Record Testing Tools by dmarcian This tool provides a comprehensive SPF survey of your domain and identifies potential issues that could impact email deliverability.
  2. SPF Record Checker by MXToolbox MXToolbox’s SPF Record Checker allows you to check your SPF record syntax and provides detailed information about your SPF record, including any errors or warnings.
  3. SPF Record Validation by DMARC Analyzer DMARC Analyzer’s SPF Record Validation tool checks the syntax of your SPF record and provides feedback on any errors or issues that might impact email deliverability.
  4. SPF Record Checker by This tool checks the syntax of your SPF record and provides detailed information about your SPF record, including any errors or warnings that could impact email deliverability.

By using one of these tools, you can quickly identify any issues with your SPF record and take steps to correct them.

Here are some additional elements that you should care about your SPF, DKIM, DMARC

Common challenges and troubleshooting tips:

  • One common issue that people encounter with SPF is that they might have multiple SPF records published for the same domain, which can cause conflicts and lead to email deliverability problems. To avoid this, it’s important to consolidate all of your SPF records into a single record and to test your SPF record thoroughly to ensure that it’s working correctly.
  • With DKIM, a common issue is that the private key used to sign email messages may expire or become invalid, which can cause email authentication failures. To avoid this, make sure to keep your private key secure and up-to-date, and to monitor your DKIM authentication logs regularly to catch any issues before they become critical.
  • DMARC can also present some challenges, particularly when it comes to interpreting the DMARC aggregate and forensic reports. To make sense of these reports, it’s important to have a clear understanding of the data that’s being presented and to use a tool like DMARC Analyzer or Agari to help you interpret the reports and identify any potential issues.

Integration with email service providers

  • If you’re using an ESP like Mailchimp, Constant Contact, or SendGrid, it’s important to ensure that your email authentication records are properly set up in your account. Most ESPs have built-in tools that make it easy to set up SPF, DKIM, and DMARC authentication, but it’s important to double-check that everything is working correctly. For example, you might need to add a custom DNS record for your DKIM public key or configure your DMARC policy to receive aggregate and forensic reports.
  • Another important consideration when using an ESP is to make sure that your email content and sending practices are aligned with best practices for email authentication. For example, you should avoid sending emails from non-existent or unverified email addresses, and make sure that your email content is high-quality and relevant to your audience.

Real-world examples and case studies

  • One recent example of how DMARC can prevent phishing attacks is the case of the UK National Health Service (NHS). In 2020, the NHS implemented DMARC authentication for their email domains, which helped to prevent a large-scale phishing attack that was targeting NHS staff. By using DMARC to block unauthorized email senders and alert IT administrators to potential threats, the NHS was able to prevent the attack from succeeding and protect its staff from harm.
  • Another success story comes from the global marketing agency, Wunderman Thompson. In 2020, Wunderman Thompson implemented SPF, DKIM, and DMARC authentication for their email domains, which helped to significantly improve their email deliverability rates and reduce the risk of email fraud. By taking a proactive approach to email authentication and aligning its email-sending practices with best practices, Wunderman Thompson was able to enhance their reputation as a trusted and reliable sender of email messages.

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
Scroll to Top