How to Set Up DKIM in cPanel

Introduction

Email authentication plays a crucial role in verifying the legitimacy of email senders. Two widely used methods for email authentication are DKIM (Domain Keys Identified Email) and SPF (Sender Policy Framework). By enabling these features in your cPanel account and adding the necessary DNS records to your domains, you can effectively authenticate your domain(s) and ensure the trustworthiness of your emails.

SPF Authentication

SPF DNS Record Syntax

An SPF record follows this format:

domain.com. IN TXT "v=spf1 +a +mx +ip4:67.225.138.00 ~all"

Understanding each part of the SPF record is essential:

  • domain.com represents the domain the SPF record applies to. Remember, you need a separate SPF record for each domain you want to authenticate.
  • IN TXT is the DNS record type.
  • v=spf1 designates the record as an SPF record.
  • a allows mail to be sent from the server that matches the domain’s main A record.
  • mx allows mail to be sent from the domain that matches the email address’s MX records.
  • ~all determines how mail is handled if it doesn’t meet the other rules. The tilde (~) signifies that messages failing the SPF check will be carefully scrutinized by other spam prevention techniques.

The default SPF record mentioned above is simple yet effective. To use it, replace “domain.com” with your domain name (don’t forget the ending period). However, there are a few other options available:

  • Adding ip4:ipaddress allows a specific IPv4 address to send mail. Replace “ipaddress” with your server’s IP address.
  • Adding ip6:ipaddress allows a specific IPv6 address to send mail. Replace “ipaddress” with your server’s IP address.
  • If you want to strongly reject mail that doesn’t pass your rules, use -all instead of ~all.
See also  Uploading Your Website in cPanel

Enabling SPF for Your Domain Name

Follow these steps to add SPF for your domain(s):

  1. Log in to your cPanel account at www.your-domain/cpanel.
  2. Once logged in, navigate to Email > Authentication.
  3. Click on the SPF Enable button.
  4. Copy the SPF code to your clipboard. It will look similar to this:
    v=spf1 +a +mx +ip4:67.225.138.00 ~all

    or

    v=spf1 +a +mx +ip4:67.225.138.51 +ip4:67.225.138.000 ~all
  5. Add the SPF code as a TXT record to your domain’s DNS. If you are using your Domain Name Registrar’s DNS service or a third-party DNS provider, follow their instructions. If you are using the Cloudflare DNS provided with your ProgramMatek Hosting account, follow these steps:
    1. Log in to your ProgramMatek Backroom Customer account here.
    2. Navigate to My Services > My Services > Cloudflare > Manage > Manage Cloudflare > DNS.
    3. Choose TXT from the dropdown list and click Add New DNS Record.
    4. In the Name field, type: @.
    5. In the Content field, paste the SPF record and click Continue.
    6. Congratulations! Your domain now has an SPF record.

DKIM Authentication

DKIM (Domain Keys Identified Mail) is another method to authenticate your email and prevent email spoofing. It involves attaching an encrypted digital signature to your email messages, making it more difficult for spammers to impersonate your email address and protecting your server’s reputation.

Enabling DKIM for Your Domain Name

To add DKIM for your domain(s), follow these steps:

  1. Log in to your cPanel account: your-domain/cpanel > Email > Authentication.
  2. Click on the DKIM Enable button.
  3. In the Your current raw DKIM record is text field, you’ll find the code required to create the DNS DKIM record. It will resemble the following structure, consisting of three parts: the Name, Type, and Content of the record:
    Name: default._domainkey
    Type: IN TXT
    Content: "v=DKIM1; k=rsa; p=MIIB...3GGwIDAQAB;"
  4. Add the DKIM code as a TXT record to your domain’s DNS. If you are using your Domain Name Registrar’s DNS service or a third-party DNS provider, follow their instructions. If you are using the Cloudflare DNS provided with your ProgramMatek Hosting account, follow these steps:
    1. Log in to your ProgramMatek Customer account here.
    2. Navigate to My Services > My Services > Cloudflare > Manage > Manage Cloudflare > DNS.
    3. Choose TXT from the dropdown list and click Add New DNS Record.
    4. In the Name field, type: default._domainkey.
    5. In the Content field, paste all the content beginning with “v=DKIM1; k=rsa; p=MIIB…” and click Continue.
    6. Congratulations! Your domain now has a DKIM record.
See also  Directadmin vs Cpanel

Additional Information

If you need any assistance, please submit a Service Request from the Customer Backroom or visit our Contact Us page for additional contact information.