SPF, DKIM and DMARC Setup

Email Services, Settings No Comments

DNS records are essential for authenticating your domain’s email sending capabilities. They help in improving email deliverability and protecting your domain from being used for email spoofing. The three main types of DNS records relevant to email deliverability are:

  • SPF (Sender Policy Framework)
  • DKIM (DomainKeys Identified Mail)
  • DMARC (Domain-based Message Authentication, Reporting, and Conformance)

Setting Up SPF Records

SPF records specify which mail servers are permitted to send email on behalf of your domain. Here’s how to set up an SPF record:

  1. Identify your email sending platform.
  2. Create an SPF record in your domain’s DNS settings. This record should include the IP addresses or hostnames of the servers allowed to send emails for your domain.
  3. Syntax Example: v=spf1 include:sendinblue.com ~allv=spf1 indicates the version of SPF used.include:sendinblue.com authorizes Sendinblue’s servers to send emails on behalf of your domain.~all specifies a soft fail for email sent from servers not listed in the SPF record.
  4. v=spf1 indicates the version of SPF used.
  5. include:sendinblue.com authorizes Sendinblue’s servers to send emails on behalf of your domain.
  6. ~all specifies a soft fail for email sent from servers not listed in the SPF record.

Implementing DKIM Records

DKIM adds a digital signature to emails sent from your domain, allowing receiving mail servers to verify that the email was indeed sent from an authorized mail server. To set up DKIM:

  1. Generate a DKIM key pair through your email-sending platform.
  2. Add a DKIM record to your domain’s DNS settings, including the public key part of your DKIM key pair.
  3. Ensure alignment between the email’s “From” domain and the domain in the DKIM signature.

Configuring DMARC Policies

DMARC uses SPF and DKIM to determine the authenticity of an email message. It also instructs receiving servers on what to do with emails that fail SPF and DKIM checks. To configure DMARC:

  1. Create a DMARC record in your domain’s DNS settings.
  2. Set your policy to either none, quarantine, or reject, depending on how strictly you want to enforce SPF and DKIM checks.
  3. Example: v=DMARC1; p=reject; rua=mailto:report@yourdomain.comv=DMARC1 indicates the DMARC version.p=reject tells receiving servers to reject emails that fail SPF and DKIM checks.rua=mailto:report@yourdomain.com specifies where aggregate reports of DMARC failures should be sent.
  4. v=DMARC1 indicates the DMARC version.
  5. p=reject tells receiving servers to reject emails that fail SPF and DKIM checks.
  6. rua=mailto:report@yourdomain.com specifies where aggregate reports of DMARC failures should be sent.

Troubleshooting Tips

  • Emails not being delivered? Check your SPF, DKIM, and DMARC records for errors.
  • Receiving spam complaints? Ensure your DMARC policy is set to reject to prevent unauthorized use of your domain.
  • DMARC reports not received? Verify the email address in your DMARC record is correct and capable of receiving messages.

Frequently Asked Questions

Can I use multiple email-sending platforms?

  • Yes, but ensure all platforms are included in your SPF record and have their DKIM keys added to your DNS settings.

What does ~all and -all mean in SPF records?

  • ~all indicates a soft fail, suggesting that emails from unlisted servers should be treated with suspicion. -all indicates a hard fail, recommending that emails from unlisted servers be rejected.

How often should I update these records?

  • Whenever you change your email sending platform or if you add additional platforms.