Skip to content
Back to Blog
Email SecurityFebruary 10, 2026·9 min read

SPF, DKIM & DMARC Generators: How to Create Email Authentication Records

Step-by-step guide to using our free generators to create correct SPF, DKIM, and DMARC records for your domain.

Cybersecurity setup representing email authentication generators

SPF, DKIM, and DMARC records are notoriously easy to break with a single typo. Generator tools eliminate syntax errors and guide you through the logic—which IPs to authorize, which policy to enforce, and how to stage the rollout. This guide walks through each generator, covers provider-specific DKIM setup, and provides a proven deployment order.

Why Manual Creation Is Error-Prone

Email authentication records have strict syntax rules and subtle interactions. Common manual errors include:

  • Mistyped SPF mechanisms (inclue: instead of include:) that silently disable authorization.
  • Exceeding the 10 DNS lookup limit in SPF without realizing nested includes count.
  • Using +all instead of ~all or -all—authorizing the entire internet to send as your domain.
  • Publishing a DMARC record with p=reject before verifying all legitimate senders pass SPF/DKIM.
  • Forgetting the v= version tag or placing it anywhere other than the start of the record.

📖 Definition — An email authentication record generator is a tool that produces syntactically correct DNS TXT records for SPF, DKIM, or DMARC based on your inputs—authorized senders, policy preferences, and reporting addresses.

SPF Generator Walkthrough

An SPF generator builds a valid v=spf1 ... all record by asking you to select your authorized senders:

1. Enter your domain — The generator queries existing SPF records to show your current configuration.

2. Add authorized sources — Select your email providers (Google Workspace, Microsoft 365, SendGrid, etc.). The tool adds the correct include: mechanisms.

3. Add custom IPs — If you run your own mail server, add its IP with the ip4: or ip6: mechanism.

4. Choose the default policy~all (softfail) during testing, -all (hardfail) for production enforcement.

5. Validate — The tool checks for duplicate includes, counts DNS lookups, and flags if you exceed the 10-lookup limit.

; Example generated SPF record
example.com.  3600  IN  TXT  "v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.10 ~all"

⚠️ Each include:, a, mx, and redirect mechanism triggers a DNS lookup. Nested includes count too. Exceeding 10 total lookups causes a PermError—all SPF checks fail.

DKIM Setup by Provider

DKIM requires generating a key pair and publishing the public key as a DNS TXT record. Each provider handles key generation differently:

ProviderSelectorKey GenerationDNS Record
Google WorkspacegoogleAdmin Console → Apps → Gmail → Authenticate email → Generate new recordPublish at google._domainkey.example.com
Microsoft 365selector1, selector2Defender portal → Email authentication → DKIM → EnableCNAME to selector1-example-com._domainkey.example.onmicrosoft.com
SendGrids1, s2Settings → Sender Authentication → Authenticate domainCNAME records provided by SendGrid
Mailchimpk1Website → Domains → Authenticate → DKIM setupCNAME to Mailchimp-provided host
Custom (OpenDKIM)Your choiceopendkim-genkey -s selector -d example.comPublish selector._domainkey.example.com TXT "v=DKIM1; k=rsa; p=..."

💡 Use 2048-bit RSA keys minimum. Some providers default to 1024-bit—upgrade if given the option. The longer key may require splitting across multiple 255-byte DNS strings, which providers handle automatically.

DMARC Generator Walkthrough

A DMARC generator produces a valid v=DMARC1; ... record for the _dmarc.example.com subdomain:

1. Select policy (p=) — Start with none (monitoring only), then escalate to quarantine, and finally reject.

2. Set subdomain policy (sp=) — Optionally set a different policy for subdomains. Defaults to the main policy if omitted.

3. Add aggregate report address (rua=) — Specify where aggregate XML reports are sent: mailto:dmarc-reports@example.com.

4. Add forensic report address (ruf=) — Optional. Many receivers won't send these due to privacy.

5. Set alignment (adkim= / aspf=)r (relaxed) allows subdomain alignment; s (strict) requires exact domain match.

6. Set percentage (pct=) — Apply the policy to a percentage of failing messages. Use pct=10 during rollout, then increase to 100.

; Example generated DMARC record (monitoring phase)
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com; adkim=r; aspf=r; pct=100"

; Example generated DMARC record (enforcement phase)
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=reject; rua=mailto:dmarc@example.com; adkim=s; aspf=s; pct=100"

Recommended Deployment Order

Deploy email authentication records in this order to avoid breaking legitimate mail:

Phase 1: SPF — Publish an SPF record with all known senders and ~all (softfail). Monitor for 2 weeks.

Phase 2: DKIM — Enable DKIM signing on every sending service. Verify signatures with a DKIM checker. Allow 1–2 weeks for propagation confirmation.

Phase 3: DMARC p=none — Publish DMARC with p=none and rua= to collect reports. Analyze reports for 4–6 weeks.

Phase 4: DMARC p=quarantine — After fixing all legitimate failures, move to quarantine at pct=25, gradually increasing.

Phase 5: DMARC p=reject — Once quarantine shows no legitimate failures, enforce reject at pct=100.

🚫 Never skip straight to p=reject without a monitoring phase. Legitimate mail from forgotten third-party senders will be silently dropped.

Post-Deployment Monitoring

After deploying all three records:

  • Process DMARC aggregate reports weekly to catch new senders or misconfigurations.
  • Run SPF, DKIM, and DMARC checks after any DNS change or sender onboarding.
  • Monitor email deliverability metrics in your email platform's dashboard.
  • Set alerts for SPF lookup count approaching 10 (e.g., when adding new SaaS vendors).
  • Rotate DKIM keys annually with a two-key overlap period to avoid downtime.

When to Use Generators vs Manual

ScenarioApproachWhy
Initial setup or new domainGeneratorEliminates syntax errors and guides through options
Adding a new email providerGeneratorValidates that the new include doesn't exceed the lookup limit
Minor SPF tweak (one IP change)ManualSimple substitution; generator overhead unnecessary
Complex multi-domain enterprise setupManual + ValidationGenerators may not handle subdomain delegation or advanced SPF macros
Troubleshooting a failing recordGenerator + CheckerRegenerate the record and compare against the current one to find the diff

Best Practices

  • Always generate records, then validate with a checker before publishing to DNS.
  • Follow the SPF → DKIM → DMARC deployment order.
  • Use a staging/monitoring period at each phase before escalating DMARC policy.
  • Keep a changelog of all email authentication DNS changes.
  • Test with real email sends after every DNS update—don't rely solely on DNS checks.

Common Mistakes

MistakeImpactFix
Publishing multiple SPF recordsSPF PermError; all checks failMerge into a single TXT record with multiple include:
Deploying DMARC p=reject firstLegitimate email from third-party senders is droppedStart at p=none and escalate gradually
Forgetting to enable DKIM signingDKIM always fails; DMARC alignment breaksEnable signing in every email platform and verify with a checker
Not counting nested SPF lookupsExceeding 10 lookups; SPF PermErrorUse a generator that counts lookups recursively
Publishing DKIM key as a separate TXT record instead of at the selector subdomainDKIM verification fails—key not foundPublish at selector._domainkey.example.com, not example.com

Tools

SPF Generator — Build a valid SPF record with lookup counting and duplicate detection.

DMARC Generator — Create a DMARC record with policy, reporting, and alignment options.

DKIM Checker — Verify a published DKIM key and test signature validation.

SPF Checker — Validate your SPF record syntax and count DNS lookups.

DMARC Checker — Verify your DMARC record syntax and policy configuration.

References

🚀 Free ToolZilla tools used in this article

All client-side, no signup, no upload — open them in a new tab while you read:


🎯 Use generators to eliminate syntax errors, but always validate the output with checkers before publishing. Deploy in order—SPF, then DKIM, then DMARC—and never skip the monitoring phase. A rushed p=reject deployment is the fastest way to break your legitimate email.

Continue Reading

Related Articles

Free & Private

Explore Our Free Tools

40+ browser-based utilities — fast, private, and always free. No sign-up required.

Browse All Tools