SPF and DKIM Records: How to repair the SPF and DKIM Records in cPanel

What Is SPF and DKIM Records?

SPF and DKIM Records

SPF and DKIM Records: SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail) are email authentication methods that help prevent email spoofing and ensure that emails from your domain are legitimate.

  1. SPF Record:
    • The SPF record is a DNS (Domain Name System) record that specifies which mail servers are allowed to send email on behalf of your domain. It helps receiving mail servers verify that the email sent from your domain is authorized.The SPF record is written in TXT format in DNS and contains the IP addresses or hostnames of servers that can send email for your domain.
    Example of an SPF record:
v=spf1 ip4:192.0.2.1 include:mailserver.com -all
  • v=spf1: Version of SPF.
  • ip4:192.0.2.1: IP address allowed to send email.
  • include:mailserver.com: Allows mailserver.com to send emails.
  • -all: States that only the listed IP addresses/servers can send mail.

DKIM Record:

  • DKIM adds a digital signature to email headers, enabling the receiving mail server to verify that the email was sent by an authorized source and hasn’t been altered during transmission.
  • The DKIM record is also a DNS TXT record, and it contains the public key that receiving mail servers use to verify the signature of an email.

Example of a DKIM record:

default._domainkey.yourdomain.com IN TXT "v=DKIM1; k=rsa; p=MIGfMA0G...base64encodedpublickey"
  • v=DKIM1: Version of DKIM.
  • p=MIGfMA0G...: Public key used for email signature validation.

How to Repair SPF and DKIM Records in cPanel

If your SPF or DKIM records are misconfigured or you need to repair them, follow these steps:

1. Log in to cPanel:

  • Access your hosting account’s cPanel.

2. Navigate to “Email Deliverability”:

  • In cPanel, go to the “Email” section.
  • Select “Email Deliverability”. This will show the status of SPF, DKIM, and DMARC records for your domains.

3. Repair SPF Record:

  • Under the “Manage” section next to your domain, click “Manage”.
  • If the SPF record is invalid or missing, cPanel will provide a warning or notification.
  • Click the “Repair” button to automatically fix the SPF record.
  • Alternatively, you can manually edit the SPF record by clicking “Customize”, where you can add or remove authorized IPs, hosts, and services.

4. Repair DKIM Record:

  • Follow the same steps for DKIM. If the DKIM record is broken or missing, you’ll be given the option to repair it.
  • cPanel will generate the correct DKIM record and automatically update your DNS.

5. Verify Changes:

  • Once you’ve repaired the SPF and DKIM records, verify the changes by using email authentication.

This will ensure that your SPF and DKIM records are functioning correctly and that your domain’s emails are being authenticated properly.