A new domain that sends mail without SPF and DKIM is treated as suspicious by every major mailbox provider, and its mail lands in spam or is rejected outright. cPanel’s Email Deliverability interface generates and publishes both records for you in a couple of clicks when the domain’s DNS is on the same server — and walks you through what to copy to your DNS provider when it is not. This runbook sets up SPF and DKIM correctly from the start, verifies they resolve, and confirms outbound mail actually authenticates, so a brand-new domain sends as a trusted one.
What’s happening
Two DNS records prove your mail is legitimate. SPF is a TXT record listing which servers are allowed to send mail for your domain; a receiving server checks whether the connecting IP is in that list. DKIM is a cryptographic signature: cPanel holds a private key, signs every outgoing message, and publishes the matching public key as a TXT record at default._domainkey.example.com so receivers can verify the signature was made by the key holder. Together they let a receiver confirm both where the mail came from and that it was not altered — the foundation DMARC then builds on.
cPanel’s Email Deliverability page manages both. When the domain uses cPanel’s own nameservers, the page can write the records directly and shows everything as valid. When DNS is hosted elsewhere (a registrar, Cloudflare, a separate DNS provider), cPanel cannot write the records, so it displays the exact SPF and DKIM values you must copy into that external DNS. This is the most common stumbling point: people generate the keys in cPanel, assume they are live, and never copy them to the DNS that is actually authoritative — so the records never resolve and mail still fails.
How to verify
First, see what the domain currently publishes — likely nothing for a new domain.
# Existing SPF (a TXT starting with v=spf1)
dig +short TXT example.com | grep -i spf
# Existing DKIM at the default cPanel selector
dig +short TXT default._domainkey.example.com
# Where is DNS authoritative? (tells you if cPanel can write records)
dig +short NS example.com
After setting the records in cPanel, confirm cPanel’s own view and then the public DNS view:
# cPanel's deliverability status for the domain
whmapi1 get_domain_email_deliverability_status domain=example.com 2>/dev/null
# Public resolution (run after DNS propagates)
dig +short TXT example.com @8.8.8.8 | grep -i spf
dig +short TXT default._domainkey.example.com @8.8.8.8
Confirm outbound mail signs and passes by sending a test and reading the headers:
# Send a test from the domain to an external account, then in the
# received message's Authentication-Results header confirm:
# spf=pass ... dkim=pass header.d=example.com
The fix
-
Open Email Deliverability for the domain — go to cPanel » Email » Email Deliverability and find the domain. cPanel shows a status for SPF, DKIM, and the reverse-DNS PTR. Anything not green needs attention; click Manage on the domain.
-
Let cPanel install the records when it controls DNS — if the domain’s nameservers are cPanel’s, click Repair (or Install the suggested record) for both SPF and DKIM. cPanel writes the correct TXT records into the zone immediately, and the status turns valid within the zone’s TTL.
-
Copy the records to external DNS when cPanel does not control it — if DNS is hosted elsewhere, the Manage page displays the exact SPF TXT value and the DKIM name/value. Copy each into your DNS provider verbatim: the SPF as a TXT on the domain root, the DKIM as a TXT at
default._domainkey. cPanel cannot do this step for you — it is the one people skip. -
Keep the SPF record to a single TXT and within ten lookups — a domain must have exactly one SPF TXT record; two SPF records is a permerror. If you add third-party senders, append their
include:to the same record and watch the ten-DNS-lookup limit, flattening if you approach it. -
Use the full DKIM value without breaking it — the DKIM public key is long and DNS quoting splits it into 255-byte segments. Paste it exactly as cPanel provides; if your DNS provider mangles the segmentation, the signature fails validation. Verify with the
digcheck that the published key matches what cPanel generated. -
Set the reverse DNS (PTR) too — Email Deliverability also flags PTR. The datacenter/IP owner sets rDNS, not cPanel, so request a PTR for the sending IP that matches your mail hostname; a missing PTR alone causes rejections from strict receivers.
-
Add DMARC once SPF and DKIM pass — with both authenticating, publish a
_dmarc.example.comTXT starting atp=noneto begin collecting reports, then tighten toquarantine/rejectonce you confirm all legitimate mail aligns. DMARC without working SPF/DKIM underneath does nothing.
Once published, run the dig ... @8.8.8.8 checks until both records resolve publicly, then send a test and confirm spf=pass and dkim=pass header.d=example.com in the headers — that proves the domain authenticates and is ready to send. Setting these up on day one is the cheapest deliverability win a new domain gets. Stack Harbor configures SPF, DKIM, and DMARC for cPanel domains under cPanel/WHM management — start a conversation.