TXT records pile up in a cPanel DNS zone over the years, and a short cleanup makes email and certificate problems much easier to troubleshoot. They hold free-form text and carry email authentication records, ownership-verification codes for services such as Google or Microsoft 365, and the temporary _acme-challenge records some certificate requests use. Over time a zone gathers codes for tools nobody uses and, often, a second SPF record, the list of servers allowed to send mail for your domain, even though only one is valid. Merge every SPF include: into a single record, delete DKIM selectors (named signing keys) that your mail system no longer uses, and remove leftover _acme-challenge entries.
What’s happening
The TXT record type is the kitchen drawer of DNS. SPF (RFC 7208) lives in TXT. DKIM public keys live in TXT under selectors. DMARC lives in TXT under _dmarc. SaaS verifications (Google site verification, Microsoft 365 onboarding, Atlassian, Slack, Stripe, et cetera) all use TXT. ACME’s DNS-01 challenge for cert issuance uses TXT at _acme-challenge.<name>. Each is a valid use.
The mess starts when:
- An SPF record at the apex coexists with a second TXT that also starts with
v=spf1— only one is valid per RFC, and senders pick the first they see, which may not be the one you intend. - Two DKIM selectors are publishing keys but one was rotated out and never re-deleted — the old selector still validates if mail signed with it shows up, which it shouldn’t.
- A
_acme-challengeTXT from a one-off cert request is now permanent in the zone — it’s not harmful but it can mislead anyone troubleshooting cert issuance.
How to verify
List every TXT in the zone:
whmapi1 dumpzone domain=example.com | grep ' TXT '
dig +short TXT example.com
dig +short TXT _dmarc.example.com
dig +short TXT default._domainkey.example.com
For SPF, confirm there’s exactly one record starting with v=spf1:
dig +short TXT example.com | grep -c '^"v=spf1'
If that returns more than 1, the zone has duplicate SPF and senders see undefined behaviour.
For DKIM, list every selector:
whmapi1 dumpzone domain=example.com | grep -E '_domainkey.*TXT'
Every selector publishing a key here should match a selector your mail system actively signs with.
What to do
- One SPF record at the apex. Combine all
include:directives into a singlev=spf1 include:... include:... ~all(or-allonce validated). Multiple SPF records is a configuration bug, not a feature. - Prune dormant DKIM selectors. If a selector has been retired for more than the longest mail-flight window (typically two weeks), delete it. The selector is referenced by message headers; once those messages have been delivered or bounced, the public key is no longer needed.
- Delete
_acme-challengeleftovers unless you’re running a continuous DNS-01 cert renewal. ACME’s challenge records are meant to be ephemeral. - Document SaaS verifications in the zone as comments (cPanel’s raw zone editor in WHM allows comments). When a verification’s TXT looks unfamiliar three years later, you’ll thank yourself for noting “Stripe site verification, added 2024-03”.
- Use the SPF lookup-limit counter every time you add an
include:. The hard limit is 10 DNS lookups during SPF evaluation, and manyinclude:directives chain to more includes —_spf.google.comalone uses a few. Tools likemxtoolbox.comgive the count.
Periodic zone hygiene — quarterly, or on every customer takeover — keeps the TXT pile lean and the next person troubleshooting a delivery issue or cert renewal less frustrated.
Stack Harbor performs zone hygiene on multi-domain fleets during onboarding as part of cPanel server administration.