Prompt
How do I fix SPF and DKIM on my sending domain?
Latest observation
Fixing SPF and DKIM usually means updating DNS for the domain you use in your “From” address. Here’s the practical checklist.
1) Identify what’s sending mail for your domain
List every service that sends email as your domain, for example:
- Google Workspace / Microsoft 365
- Your website host or app server
- Email marketing tools like Mailchimp, SendGrid, Klaviyo, etc.
- Support/ticketing systems like Zendesk, Freshdesk
You need to authorize all legitimate senders.
2) Fix SPF
SPF is a DNS TXT record that says which servers are allowed to send mail for your domain.
What it should look like
A common SPF record is something like:
v=spf1 include:_spf.google.com include:sendgrid.net -all
Key rules
- Only one SPF record per domain. Multiple SPF TXT records cause problems.
- Keep it under the DNS lookup limit:
- SPF allows only 10 DNS lookups total.
- End with:
-all= hard fail, strict~all= soft fail, more forgiving
- Include only services that actually send mail.
Example
If you use Google Workspace and SendGrid:
v=spf1 include:_spf.google.com include:sendgrid.net -all
If you also send from your own server, you may need:
v=spf1 include:_spf.google.com ip4:203.0.113.10 include:sendgrid.net -all
3) Fix DKIM
DKIM signs outgoing messages with a private key; recipients verify it with a public key in DNS.
What to do
- Enable DKIM in each sending service.
- Generate a DKIM key pair if the service requires it.
- Publish the public key as a DNS TXT record.
Typical DNS record format
Example:
- Name/Host:
selector1._domainkey - Type:
TXT - Value:
v=DKIM1; k=rsa; p=MIIBIjANBgkqh...
Important
- Many services give you a selector like
s1,google, ordefault. - You may have multiple DKIM records for different senders, each with a different selector.
- Make sure the DKIM domain aligns with your “From” domain when possible.
4) Verify DMARC too
DMARC helps mailbox providers trust your domain and tells them what to do if SPF/DKIM fail.
Add a DMARC record if you don’t have one:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
Later you can move to:
p=quarantinep=reject
DMARC works best when at least one of SPF or DKIM passes and aligns with your domain.
5) Common mistakes
SPF
- More than one SPF record
- Too many DNS lookups
- Forgot to include a third-party sender
- Using
+allor an overly broad record
DKIM
- Wrong host/name for the TXT record
- Copy/paste errors in the public key
- Selector mismatch
- DKIM not actually enabled in the sending platform
General
- DNS changes not propagated yet
- Sending from a different domain than the one you configured
- “From” domain and envelope/return-path domain don’t align well enough for DMARC
6) Test it
Use one or more of these:
- Send a test email to a Gmail account and check Show original
- Use mail-tester.com
- Use MXToolbox SPF/DKIM/DMARC checks
- Check your sending platform’s email authentication status
Look for:
spf=passdkim=passdmarc=pass
7) If you want the fastest fix
If you tell me:
- your domain
- which service(s) send mail for it
- your current SPF record
- whether DKIM is already set up in any provider
…I can help you build the exact DNS records and point out what to change.