How-to

How to set up SPF, DKIM & DMARC

Published 21 October 2026 · 6 min read

If your app sends email — password resets, receipts, welcome messages, notifications — you need three DNS records: SPF, DKIM, and DMARC. Together they prove that email claiming to come from your domain is really from you. Without them, two bad things happen: anyone can send email pretending to be your domain, and your legitimate email is far more likely to land in spam.

The good news is that setting them up is a one-time job. You add a few records at your DNS provider (wherever your domain lives — Cloudflare, Namecheap, GoDaddy, Google Domains, etc.), and your email provider gives you most of the values. Here is what each record does and exactly what to add.

What each record actually does

Why this matters for your app

Picture a founder whose app sends password-reset emails. With no SPF, DKIM, or DMARC, nothing stops a scammer from sending "reset your password" emails that appear to come from your exact domain. Customers can't tell the difference, and a phishing campaign in your name damages trust you spent months building.

The flip side is deliverability. Mailbox providers like Gmail and Outlook increasingly require authentication before they trust a sender. If your records are missing or wrong, your real transactional email gets filtered to spam — so users never receive the reset link and assume your app is broken. These records fix both problems at once.

1. Add your SPF record

SPF is a single TXT record on your root domain. You usually only need one SPF record, and it should include every service that sends email for you. Your email provider documents the exact value — a common pattern looks like this:

Replace include:_spf.yourprovider.com with the value your provider gives you. If you send through more than one service, add each one as another include: in the same record — don't create a second SPF record, as that breaks SPF entirely.

2. Add your DKIM record

You don't write the DKIM record yourself — your email provider generates the keys and tells you exactly what to publish. In Resend, Postmark, SendGrid, Mailgun, or whatever you use, add your domain in their dashboard and they'll show you one or more records to copy:

Copy the name and value exactly as shown. After you save them, your provider has a "verify" button that confirms the records are live.

3. Add your DMARC record — and start gently

DMARC is one TXT record at a special subdomain. The important part is the policy (p=), which tells receivers what to do with mail that fails. Don't jump straight to the strictest setting — roll it out in stages so you don't accidentally block your own legitimate email.

Start here (monitor only, nothing gets blocked):

The rua= address receives aggregate reports so you can see who's sending as your domain and confirm your own mail passes. Watch these reports for a week or two.

Once your legitimate email is passing cleanly, tighten the policy to p=quarantine (failing mail goes to spam). After you're confident everything is healthy, move to the strictest setting, p=reject (failing mail is rejected outright). The progression is simple: none → quarantine → reject.

How to check it worked

Check your app in 30 seconds

Faultline scans no-code & AI-built apps for exactly these issues — free.

Run a free scan

Faultline's free surface scan works on any website — it checks your TLS, security headers, and DNS/email setup, including whether these records are present. Our deeper data-exposure engine currently specializes in Base44, with more platforms rolling out. For email specifically, follow the steps above, publish the records, and verify them with your provider — it's one of the highest-value hours you can spend on your app's security.

Related: The no-code security checklist · Is Base44 secure?