Prompt

How do I set up SPF, DKIM, and DMARC for an app email domain?

Technology / API Platforms1 observationLast seen Nov 6, 2026

Latest observation

Nov 6, 2026OpenAI APIWeb search: off

Here’s the practical way to set up SPF, DKIM, and DMARC for an app sending mail from your domain.

1) Decide which domain/subdomain the app will use

For app email, it’s often best to use a dedicated subdomain, such as:

  • mail.example.com
  • notify.example.com
  • mg.example.com

This keeps app mail separated from your main business email and makes DNS management easier.

You’ll configure records in the DNS zone for that domain or subdomain.


2) Set up SPF

SPF tells receiving mail servers which services are allowed to send mail for your domain.

What to add

You typically publish one TXT record like:

  • Name/Host: @ or your subdomain
  • Type: TXT
  • Value: something like:
v=spf1 include:your-email-provider.example -all

Examples

If your app sends through:

  • Google Workspace:
    v=spf1 include:_spf.google.com -all
  • Microsoft 365:
    v=spf1 include:spf.protection.outlook.com -all
  • SendGrid:
    v=spf1 include:sendgrid.net -all
  • Mailgun:
    v=spf1 include:mailgun.org -all
  • Amazon SES:
    SES often uses its own MAIL FROM domain setup; SPF may look different depending on the custom MAIL FROM domain you configure.

Important SPF rules

  • You should have only one SPF record per domain.
  • If you use multiple senders, combine them into one SPF record.
  • Keep SPF under the DNS lookup limit of 10 mechanisms/void lookups.

3) Set up DKIM

DKIM signs outgoing messages cryptographically so receivers can verify they weren’t altered and that they’re authorized by your domain.

What to do

Your email provider/app will generate:

  • a selector name
  • a public key to publish in DNS

You’ll create a TXT record like:

  • Name/Host: selector._domainkey.example.com
  • Type: TXT
  • Value: something like:
v=DKIM1; k=rsa; p=PUBLIC_KEY_HERE

Example

If the selector is app1, the DNS record might be:

  • Host: app1._domainkey.notify.example.com
  • TXT value: provider-generated DKIM public key

Notes

  • Many services let you generate 1 or more DKIM selectors.
  • Use 2048-bit keys if supported.
  • Make sure your app actually signs outbound messages with DKIM using the same domain/subdomain.

4) Set up DMARC

DMARC tells receivers what to do if SPF/DKIM fail, and gives you reporting.

Start with a monitoring policy

Create a TXT record at:

  • Name/Host: _dmarc.example.com
    or _dmarc.notify.example.com if you’re using a subdomain

Example:

v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com; adkim=s; aspf=s

What the tags mean

  • p=none = monitor only, don’t reject yet
  • rua= = aggregate report email
  • adkim=s = strict DKIM alignment
  • aspf=s = strict SPF alignment

Then move to enforcement

After you confirm legitimate mail passes:

  • p=quarantine to send suspicious mail to spam
  • p=reject to block unauthenticated mail

A common progression is:

  1. p=none
  2. p=quarantine
  3. p=reject

5) Make sure alignment works

For DMARC to pass, the domain in the visible From: address must align with SPF and/or DKIM.

Example:

  • Visible From: no-reply@notify.example.com
  • SPF pass: mail is sent by an authorized service for notify.example.com
  • DKIM pass: DKIM signature uses d=notify.example.com

If your app sends mail as from@example.com but the sending service signs as some other domain, DMARC may fail even if SPF/DKIM individually pass.


6) Test after publishing DNS

After adding DNS records:

  • wait for propagation
  • send test emails to Gmail, Outlook, Yahoo
  • inspect message headers for:
    • SPF: pass
    • DKIM: pass
    • DMARC: pass

Tools you can use:

  • MXToolbox
  • dmarcian
  • mail-tester.com
  • Gmail “Show original”

7) Common mistakes

  • Multiple SPF TXT records on the same domain
  • Wrong DNS host names for DKIM
  • Using -all too early without verifying senders
  • DKIM key pasted incorrectly
  • DMARC set to reject before testing
  • From address domain not aligned with SPF/DKIM

Suggested setup for an app

If your app sends notifications from notify.example.com:

SPF

notify.example.com TXT "v=spf1 include:YOUR_PROVIDER -all"

DKIM

selector1._domainkey.notify.example.com TXT "v=DKIM1; k=rsa; p=YOUR_PUBLIC_KEY"

DMARC

_dmarc.notify.example.com TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"

If you want, I can also give you:

  1. the exact DNS records for a specific provider like SendGrid, Mailgun, Amazon SES, Gmail/Google Workspace, or Microsoft 365, or
  2. a step-by-step setup for a subdomain like notify.yourdomain.com.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.