Skip to content

DMARC Generator & SPF Record Builder

Build valid SPF and DMARC TXT records for your domain, then use the diagnostic tab to fix the exact error your scanner or mail provider reported.

100% Local Browser Execution • Zero Server Uploads • Air-Gap Safe

100% Local Tool Execution • Tool Inputs Never Leave Your Browser DNS TXT builder

SPF senders

Email platforms
Unlisted senders

DMARC policy

Policy (p)
Subdomain policy (sp)
DKIM alignment
SPF alignment
Failure options (fo)

SPF record

Host
example.com
Type
TXT
Value
v=spf1 include:_spf.google.com ~all

1 of 10 DNS lookups used directly (nested includes add more)

OKSPF syntax looks valid.

DMARC record

Host
_dmarc.example.com
Type
TXT
Value
v=DMARC1; p=none; rua=mailto:dmarc@example.com

WarnDMARC quarantine/reject policy not enabled: p=none only monitors, spoofed mail is still delivered.

CtrlEnter to run

Wrong result, broken layout or an idea? Tell us about this tool.

DMARC Generator & SPF Record Builder SPF and DMARC DNS Lookup Flow & Security Architecture Banner

This DMARC generator and SPF record builder produces valid DNS TXT records from a few choices, then explains what each tag does. The diagnostic tab takes the error your scanner or mail provider reported, such as “No DMARC record found” or “DMARC quarantine/reject policy not enabled”, and gives you the record and steps that fix it. Records are assembled locally; no DNS queries are made from this page.

How SPF, DKIM and DMARC fit together

SPF (Sender Policy Framework) is a TXT record on your domain that lists the servers allowed to send mail for it. DKIM signs each message with a private key; receivers fetch the public key from selector._domainkey.yourdomain. DMARC ties them together: it tells receivers what to do when a message fails, and where to send reports.

DMARC passes only when SPF or DKIM passes and is aligned with the visible From domain. Alignment is why a message can pass SPF (for the bounce domain of your email platform) yet still fail DMARC. For DMARC email security, DKIM alignment is the more robust of the two because it survives forwarding.

How it works: SPF & DMARC Generator

DMARC Generator & SPF Record Builder SPF and DMARC DNS Lookup Flow & Security Architecture Diagram. Diagram of DMARC evaluation: a sending server delivers to a receiving MTA, which looks up SPF, DKIM and _dmarc TXT records, checks alignment, then delivers, quarantines or rejects and sends aggregate reports to the rua mailbox.
Diagram of DMARC evaluation: a sending server delivers to a receiving MTA, which looks up SPF, DKIM and _dmarc TXT records, checks alignment, then delivers, quarantines or rejects and sends aggregate reports to the rua mailbox.

SPF syntax and the 10-lookup limit

An SPF record starts with v=spf1, lists mechanisms and ends with an all qualifier. include:_spf.google.com authorises Google Workspace (the standard Google SPF record), ip4:203.0.113.0/24 authorises a range, mx authorises your MX hosts, and -all tells receivers to reject everything else. ~all (softfail) is a common, gentler default while you inventory senders.

SPF evaluation may trigger at most 10 DNS lookups. Every include, a, mx, ptr, exists and redirect counts, including nested includes. Exceed it and SPF returns permerror, which DMARC treats as a fail. The builder counts lookups as you add providers.

  • Publish exactly one SPF record per domain; two v=spf1 records are a permerror.
  • Do not use +all; it authorises the whole internet to send as you.
  • Domains that never send mail should publish v=spf1 -all.

Choosing a DMARC policy: none, quarantine, reject

Start with p=none and a rua address so you receive aggregate reports without affecting delivery. Once every legitimate sender passes, move to p=quarantine (failures go to spam), optionally ramping with pct=25, 50 and 100, then to p=reject. A DMARC policy of reject is what actually stops exact-domain spoofing, and it is what Google and Yahoo bulk-sender rules and most scanners look for.

The sp tag sets the policy for subdomains, adkim and aspf set alignment mode (r relaxed or s strict), and fo=1 requests failure reports for any failing mechanism.

Reading DMARC aggregate reports

Receivers send daily aggregate (rua) reports as gzipped XML. Each <record> gives a source IP, a message count, the SPF and DKIM results and the disposition applied. Group rows by source: known platforms that fail need SPF includes or DKIM keys; unknown IPs that fail are spoofing attempts your policy should block.

At volume, a dedicated DMARC report analyzer or DMARC service saves time. Commercial DMARC software such as PowerDMARC parses reports into dashboards and alerts on new senders. For a single domain, unzip the XML and scan the source_ip, count, dkim and spf fields; the Log Deobfuscator on this site can gunzip a Base64-encoded report locally.

Troubleshooting: “No SPF record found”

Scanners report no SPF record found when a lookup of TXT records at the root of your domain returns nothing that starts with v=spf1. The usual causes are a record published on www or _spf instead of the root (@), a legacy SPF-type DNS record instead of TXT, a typo such as v=spf or v= spf1, or a change that has not propagated yet.

Check what the world sees with nslookup -type=TXT example.com (or dig +short TXT example.com). Exactly one line should start with v=spf1. If you see none, publish the record from the Build tab as a TXT record on the root host. If you see two, merge them: multiple SPF records are a PermError.

How to fix an SPF record

Start from the failing message: the Authentication-Results header names the sending IP and the SPF result. Add the include that the sending platform documents (for example include:_spf.google.com or include:spf.protection.outlook.com), keep a single v=spf1 record, stay at 10 DNS lookups or fewer, and end with ~all while testing, then -all once DMARC reports show every legitimate source passing.

Online SPF query tools such as the Kitterman SPF validator and the MXToolbox SPF record check run live DNS lookups and expand nested includes. This builder works offline and never sends your domain anywhere, so use it to compose and lint the record, then confirm the published result with nslookup or one of those checkers.

SPF and DMARC tag reference

Tags you can combine in v=spf1 and v=DMARC1 records.
TagRecordMeaning
include:domainSPFAuthorise another domain’s SPF senders (1 lookup)
ip4: / ip6:SPFAuthorise an address or CIDR range (0 lookups)
mx / aSPFAuthorise the domain’s MX or A hosts (1 lookup each)
-all / ~allSPFFail / softfail everything not listed
p=DMARCPolicy: none, quarantine or reject
sp=DMARCPolicy for subdomains
pct=DMARCPercentage of failing mail the policy applies to
rua=mailto:DMARCAggregate report destination
ruf=mailto:DMARCForensic (failure) report destination
adkim= / aspf=DMARCAlignment mode: r relaxed, s strict
fo=DMARCFailure reporting options (0, 1, d, s)

Tags you can combine in v=spf1 and v=DMARC1 records.

Command-line examples

Check a published DMARC record

dig +short TXT _dmarc.example.com

Check SPF

dig +short TXT example.com | grep spf1

Check a DKIM key

dig +short TXT google._domainkey.example.com

Windows equivalent

Resolve-DnsName -Type TXT _dmarc.example.com

Frequently asked questions

Make sure SPF and DKIM pass for all your senders, then publish a TXT record at _dmarc.yourdomain with a value such as v=DMARC1; p=none; rua=mailto:dmarc@yourdomain. Monitor reports for two to four weeks, fix failing sources, then raise the policy to quarantine and finally reject.

Related Engineering Guides