If your emails are sending but landing in spam, this is your bug. Modern email providers reject or junk-folder any email whose sender domain doesn't authenticate properly. Gmail tightened this in 2024 — emails without SPF + DKIM + DMARC simply don't reach Gmail inboxes anymore for bulk senders.
What each record does (in 30 seconds)
- SPF (Sender Policy Framework): A DNS TXT record listing which servers are allowed to send email "from" your domain. Without it, receivers can't tell if the email is legitimate or spoofed.
- DKIM (DomainKeys Identified Mail): A cryptographic signature on each outgoing email, verifiable via a public key in your DNS. Proves the email wasn't tampered with in transit.
- DMARC (Domain-based Message Authentication, Reporting & Conformance): Tells receivers what to do if SPF or DKIM fails (reject / quarantine / none) and where to send failure reports.
Receivers (Gmail, Outlook, Yahoo) check all three. If any is missing or fails, the email gets junk-foldered or outright rejected.
How to fix it
The exact records depend on your email provider. Here are the most common setups:
If sending via Resend
Go to resend.com/domains → Add your domain → Resend gives you 3 records to add to your DNS:
1. TXT record at "resend._domainkey" — for DKIM
2. MX record at "send" — for bounce handling
3. TXT record at "send" — for SPF
4. (Recommended) TXT record at "_dmarc" — for DMARC policy
If sending via SendGrid
SendGrid → Settings → Sender Authentication → Domain Authentication. They provide 3 CNAME records for DKIM and an SPF record.
If self-hosting
You need:
- An SPF TXT record:
v=spf1 ip4:YOUR_SERVER_IP -all
- A DKIM TXT record: generate keys with
opendkim-genkey, publish the public key as TXT
- A DMARC TXT record:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com (start with p=none to monitor, escalate to p=quarantine or p=reject later)
How to verify the records work
Use mail-tester.com — send a test email to the address it generates and it returns a deliverability score (out of 10) with detailed SPF/DKIM/DMARC results. Aim for 9/10 or better. Below 7 means real deliverability problems.
You can also run dig TXT yourdomain.com from a terminal to see what your DNS actually serves vs. what you think you configured.