Dev.to Security 🔐 Cybersecurity 👁 0 📖 4 min read

3 DNS records to publish before your startup sends its first email

Your first welcome email can end up in spam even if nobody ever marks it as spam. The reason can sit outside your email entirely: three DNS records you have not published yet. Since February 2024, Google requires every

3 DNS records to publish before your startup sends its first email

Your first welcome email can end up in spam even if nobody ever marks it as spam. The reason can sit outside your email entirely: three DNS records you have not published yet.

Since February 2024, Google requires every sender to Gmail accounts to authenticate with SPF or DKIM, and Yahoo's sender requirements say the same. Send more than 5,000 messages a day to Gmail and Google's list grows: both SPF and DKIM, a DMARC policy, and one-click unsubscribe for marketing mail. Yahoo splits its requirements into the same two tiers, all senders and bulk senders. None of this guarantees an inbox: both providers still weigh your spam complaint rate, and Google warns that unauthenticated mail can be marked as spam or rejected.

For a new sender the floor is one record, SPF or DKIM. All three are still worth publishing from day one: Google recommends always setting up all of them, and both providers require the full set at bulk volume.

Here is what each record does, who actually sets it, and what the sources say. The last two sections cover the two records founders mix in by mistake: one you can only verify, and one that is not about sending at all.

Diagram titled What a receiving server checks, subtitled three records to publish, one your provider owns, one that is not about sending. Your app or ESP sends a welcome email, magic link or receipt to a receiving mail server, which checks: PTR, reverse DNS on the connecting IP; SPF, whether this IP is allowed for the sender domain; DKIM, whether the signature is valid using the public key in your DNS; and DMARC, From-domain alignment plus the failure policy. The mail then lands in the inbox or spam folder, and a note says authentication is a requirement, not a guarantee, and spam rate and behavior count too. A Who sets what box says you publish SPF, DKIM and DMARC in your DNS, your email or hosting provider manages PTR on the sending IP and you verify it, and MX routes inbound mail to you and is not part of outbound authentication. Two side-by-side boxes list requirements per provider. Google: all senders to Gmail need SPF or DKIM, forward and reverse DNS, TLS and a spam rate under 0.3 percent; Google's bulk senders, over 5,000 messages a day to Gmail, also need SPF and DKIM, DMARC with p=none accepted, From-domain alignment and one-click unsubscribe for marketing and subscribed mail. Yahoo: all senders need SPF or DKIM at minimum, forward and reverse DNS and a spam rate under 0.3 percent; Yahoo's bulk senders also need SPF and DKIM, DMARC at least p=none with a rua tag strongly recommended, and one-click unsubscribe honored within 2 days. The footer says: publish SPF, DKIM, DMARC from day one, verify PTR, MX will not help your sending.

1. SPF: the allowlist

Email can be forged by default. RFC 7208, the spec for the Sender Policy Framework, opens by noting that nothing in the base protocols restricts what a sending host claims as the MAIL FROM address. SPF is the fix a domain publishes: a record listing which servers may send mail for that domain.

You publish it yourself, in your own DNS zone. Google's guidelines warn that if your third-party senders are missing from your SPF record, their messages are more likely to be marked as spam, so the record has to include your email provider. Most providers give you an include statement to paste in.

2. DKIM: the signature

DKIM, from RFC 6376, lets the owner of a domain claim some responsibility for a message by attaching a cryptographic signature. The receiving server verifies it against a public key you publish in DNS. Unlike SPF, the signature travels with the message itself.

Your email provider generates the key pair and hands you the public key record to publish. One concrete detail from Google's guidelines: sending to personal Gmail accounts takes a DKIM key of at least 1024 bits, and Google recommends 2048 if your provider supports it.

3. DMARC: the policy

DMARC, from RFC 7489, lets you express domain-level policy: what a receiver should do when a message claiming to be from you fails SPF and DKIM, plus reporting back to you. The part people miss is alignment. For DMARC to pass, the domain in the visible From header must align with the domain that passed SPF or DKIM. Google and Yahoo both spell this out for bulk senders.

For bulk senders, DMARC is required, and both providers accept a policy of p=none, which means "take no action, but tell me." Yahoo strongly recommends adding the rua tag so you actually receive the reports. For everyone else, both providers recommend publishing DMARC even though only bulk senders must.

The record you verify, not publish: PTR

Google requires valid forward and reverse DNS for sending domains and IPs, from every sender. Reverse DNS means a PTR record mapping your sending IP back to a hostname, with the hostname resolving forward to the same IP.

The catch: you usually cannot set it. A PTR record belongs to whoever owns the IP address, and that is your email provider or hosting company, not your DNS zone. If you send through an email service, Google's advice is to verify that your provider authenticates your mail with SPF and DKIM; PTR comes with their infrastructure. If you run your own mail server, you ask your hosting provider to set it. Either way, your job is verification, not publication.

The record that is not about sending: MX

MX records tell the world where to deliver mail addressed to your domain. That is inbound. Neither Google's nor Yahoo's sender requirements list MX among what a sender must publish, because outbound authentication runs on SPF, DKIM, DMARC and reverse DNS.

Keep your MX working so replies to your From address arrive, but do not expect it to move your launch email out of anyone's spam folder.

Where the bulk rules start

Most early startups send transactional mail: receipts, magic links, password resets. The strictest rules target bulk senders, which Google defines as more than 5,000 messages a day to Gmail accounts: both SPF and DKIM, a DMARC policy, alignment between the From domain and the authenticating domain, and one-click unsubscribe for marketing and subscribed messages. Yahoo's bulk list is similar, and it adds a strongly recommended rua reporting tag and a 2-day unsubscribe deadline.

The floor applies to everyone though. Any sender to Gmail accounts needs SPF or DKIM, valid forward and reverse DNS, TLS, and a spam rate under 0.3% as reported in Postmaster Tools; Yahoo's all-sender list matches, without the TLS item. If you are small, that is your checklist. If you grow into bulk volume, the rest of the list is waiting.

What this adds up to

Publish three records yourself: SPF and DKIM for authentication (one of them meets the all-sender floor, and bulk senders need both), plus DMARC (recommended for everyone, required for bulk). Verify one you do not control: PTR on your sending IP. And stop expecting MX, the inbound record, to help your outbound mail.

Both providers say spam rate and sending behavior carry weight too, so records alone do not decide where you land. The starting point is small: three records in your DNS, one question to your provider, and a test email to a Gmail address you own.

Source pages: Google email sender guidelines, Yahoo sender best practices, RFC 7208: SPF, RFC 6376: DKIM, RFC 7489: DMARC.

I write about startups and AI at startupwiki.substack.com.

Cover photo: California Dream on Unsplash.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.