Email security · Practical guide

SPF, DKIM and DMARC in plain English

Understand what each email record does and check the settings supplied by your sending services.

Archive placement: February 2024

Programming text on a laptop screen

SPF, DKIM and DMARC help receiving servers check whether a message is authorised to use your domain. They work together, but publishing three DNS records is not the same as proving every business sender is configured correctly. Build a sender list, use the values supplied by each service and test real messages at an independent mailbox.

1. Start with your actual sending services and DNS provider

List staff mailboxes, website forms, invoices, newsletters and helpdesk tools. For each, note the visible From address and the provider’s custom-domain authentication instructions. If a form sends as the visitor’s address, change the design to send from an authorised address on your domain and put the visitor in Reply-To instead.

Find where the domain’s authoritative nameservers are hosted. DNS changes in cPanel will not reach the public domain when another provider hosts its DNS. Back up existing TXT/CNAME records before editing and keep an owner for each legitimate sender. Do not add an unfamiliar server simply because you saw it in a report.

2. Review SPF in Email Deliverability

SPF tells a receiving mail server which services are authorised to send for the envelope-sender domain. Start with the actual sending services, including website forms and any newsletter or invoicing provider.

  1. Open cPanel → Email → Email Deliverability and choose Manage for the domain.
  2. Review the suggested SPF record and compare it with all the services that legitimately send your mail.
  3. If cPanel controls the authoritative zone, use the supported repair/customization option. If DNS is elsewhere, publish the correct combined TXT value there instead.

Publish one SPF record for a given hostname. Do not add a second record beginning v=spf1 for each provider, or copy an example that omits an existing legitimate sender. Review the SPF lookup limit when combining services.

3. Combine SPF carefully rather than creating a second record

In the authoritative DNS panel, look for the single TXT value beginning v=spf1 at the domain used for sending. A provider may instruct you to add an include mechanism or a specific IP. Merge approved senders into that one SPF policy; two separate v=spf1 records at the same name can produce an error.

Do not confuse receiving and sending: MX describes inbound destinations, while SPF evaluates the envelope sender domain used by an outbound message. A newsletter service may use a dedicated bounce subdomain with its own SPF. Follow the provider’s exact hostname instructions rather than placing every record at the root domain.

SPF permits a limited number of DNS-querying mechanisms, including nested includes. If the combined policy exceeds that limit, remove unused senders or get help restructuring it. Do not copy another organisation’s include list or treat +all as a fix; it authorises everyone.

4. Publish the DKIM value supplied for your domain

DKIM adds a signature to outgoing mail. The provider that signs the message supplies the public DNS record, including its selector.

  1. In Email Deliverability → Manage, review the DKIM name and TXT value generated for the domain.
  2. Use the offered repair action if this cPanel service manages the authoritative DNS. Otherwise copy the exact name and public value to that DNS provider.
  3. For an external mail service, use its DKIM setup instructions and selector rather than replacing its record with an unrelated cPanel key.

A selector is part of the record name, so entering only _domainkey is not enough. Keep long public keys intact and never publish or send a private key. Verify a real message sent through each provider after the DNS change.

5. Publish the DKIM selector exactly as supplied

Enable custom-domain DKIM in the sending service first. It will supply a selector and either TXT key material or one/more CNAME targets. Add the record at the requested selector._domainkey name, taking care whether the DNS panel appends your domain automatically. A duplicated domain suffix is a common mistake.

If cPanel manages the outgoing mail, Email Deliverability can show the recommended records for the domain. If another service sends the messages, use that service’s DKIM values. Never publish a private signing key. After saving, check the selector’s public record and send another test message; the existence of a record does not prove that the sender is using it.

6. Add a monitoring DMARC record in Zone Editor

DMARC checks whether a passing SPF or DKIM identity aligns with the visible From domain. Begin by collecting evidence before requesting rejection of failing mail.

  1. Create a working report destination or use a reporting service, then identify the authoritative DNS zone.
  2. Open Zone Editor → Manage, choose Add Record → TXT and use the full DMARC name, such as _dmarc.example.com.
  3. Use a monitoring policy supplied for your own domain and report address, then save it. Keep a single DMARC policy record at that name and verify the public TXT answer with a browser lookup.

A typical starting policy uses p=none. Replace any example domain and report mailbox with your own values. A DMARC record does not create a report mailbox, and a passing DKIM signature from a provider’s unrelated domain does not automatically align with yours.

7. Publish a monitoring DMARC policy, then verify alignment

Replace the report address with a working address or approved reporting service. Publish one DMARC record at _dmarc, not a second competing policy. A report destination at another domain can require that destination’s DNS authorisation. Start with monitoring while you verify legitimate senders; an enforcement policy can affect their delivery.

Alignment means a passing SPF or DKIM domain matches the visible From domain under the chosen alignment rules. SPF passing for a mail provider’s unrelated domain is not enough on its own. An aligned DKIM signature can let DMARC pass even when forwarding breaks SPF. You need at least one passing, aligned authentication path, not necessarily both on every message.

8. Check a real outgoing message

Send a test to a mailbox at another provider and inspect the authentication results added by that receiving service. Check both the result and the authenticated domain. Do not trust a result line merely because it appears somewhere in a message header.

In cPanel, Email Deliverability can show recommended records where the feature is available. If DNS is hosted elsewhere, make the changes there. Keep a list of legitimate senders so the next website or marketing service is included in the review.

9. Read a useful test result and fix the failing part

Use the receiving mailbox’s Show original/View source information and the authentication results it trusts. Check both “pass” and the domain beside it. A DKIM failure can mean signing is disabled or the wrong selector/key is published. An SPF error can mean a missing sender, duplicate policy or lookup-limit problem. DMARC can fail despite SPF passing if the authenticated domain is unrelated to the From domain.

Repeat the test from every legitimate service, including the website form and occasional invoice sender. Keep the successful sample and exact sending route. Authentication improves trust, but it does not guarantee inbox placement or make an authenticated message’s content safe.

Common questions

Does changing MX fix SPF or DKIM?

Not by itself. MX controls inbound mail routing. Configure authentication using each outbound sender’s documented records and check a real message.

Can I set p=reject immediately?

Only when you understand and have tested all legitimate senders. Start with monitoring and follow the separate DMARC rollout guide so enforcement does not reject your own mail.

Further reading

← Back to all guidesDiscuss your hosting setup ↗