DevTools Logo

DMARC Record Generator — SPF/DKIM Helpers

SPF, DKIM & DMARC Record Builder

Author and lint the three email-authentication TXT records before you publish them — all checks run in your browser.

Runs in your browser
Try an example

SPF editor

3 terms · 54 octets

Used for the zone name and recursive-include detection.

1 of 10 DNS lookups used

Counts DNS-triggering terms in this record only. Lookups inside include/redirect targets and MX host addresses also consume the receiver's budget; verify those with a live DNS checker before publishing.

Mechanisms

Flattener helper

Paste the resolved include IPs to author an ip4-only record with zero direct lookups.

SPF record & zone file

0 findings

Zone file (BIND / dig-friendly)

@ 3600 IN TXT "v=spf1 include:_spf.google.com ip4:203.0.113.0/24 ~all"

Defects & RFC clauses

No syntax defects — review before publishing.

Examples

SPF lookup count

Input
v=spf1 include:_spf.google.com ip4:203.0.113.0/24 ~all
Output
1 of 10 DNS lookups used

include costs one lookup; ip4 and ~all cost none.

First DMARC enforcement

Input
v=DMARC1; p=none; rua=mailto:dmarc@example.com
Output
v=DMARC1; p=quarantine; pct=25; rua=mailto:dmarc@example.com

The next ladder stage quarantines a quarter of failing messages while reports continue.

Dangerous SPF

Input
v=spf1 +all
Output
error: +all allows anyone to send as your domain

The defect list uses severity text, not colour alone, and cites RFC 7208 §5.1.

About this tool

SPF, DKIM and DMARC are three DNS TXT records that work together: SPF says which servers may send, DKIM signs messages cryptographically, and DMARC tells receivers what to do when neither check aligns. This builder authors all three and lints the exact string you are about to publish.

The SPF panel counts DNS-triggering terms against the RFC 7208 limit of ten, flags dangerous mechanisms such as +all, validates IPv4/IPv6 CIDRs and macros, and shows the quoted-string split needed for records longer than 255 octets. The counter is a first-order count of this record's terms; lookups inside included records are called out because only a live DNS check can see them.

The DKIM panel validates tags and decodes the DER-encoded public key so a real 2048-bit RSA key is reported as 2048 bits, not as the roughly 2200 bits of raw base64 payload. The DMARC panel validates every RFC 7489 tag and turns the none → quarantine → reject journey into clickable stages with pct ramps and report-address checks. Nothing is queried or uploaded: records are constructed in this browser tab.

What this tool does not do

  • This is a static authoring and syntax check: no DNS lookup, SMTP test or reputation check is performed.
  • The SPF counter models this record's terms; nested include and redirect records must be checked separately.
  • DKIM keys are never persisted; SPF and DMARC drafts are saved locally and can be cleared with one click.
  • The flattener does not resolve hostnames — paste the addresses yourself and refresh them on a schedule.

How to use this tool

  1. Pick a record tab

    Use SPF, DKIM or DMARC. Each tab starts with a minimal valid draft you can replace.

  2. Edit the record

    Type the TXT value directly, or use the structured mechanism rows, tag fields and rollout chips.

  3. Read the counter and defects

    The SPF counter updates per keystroke; errors, warnings and RFC clauses sit under the record.

  4. Copy the zone line

    Copy the record string or the BIND-style TXT line with name, TTL and quoted value.

Use cases

Flatten an SPF record

Paste the IPs resolved from a chain of includes into the flattener helper to author an ip4-only record with zero direct lookups.

Move DMARC toward reject

Follow the staged ladder from monitoring through quarantine percentages to full rejection, keeping rua reports on every step.

Pre-publish review

Lint a record before changing DNS so malformed tags, invalid CIDRs and weak keys are caught before receivers see them.

Record names and outputs

RecordOwner name
SPF@ (apex)
DKIMselector._domainkey
DMARC_dmarc
Zone splitone owner, many strings
Paste & lintauto-detected

The 3600-second TTL in the zone preview is a suggestion; keep it consistent with your existing zone policy.

Common mistakes

Mistake:Assuming the lookup counter includes records reached through include.

Fix:It counts this record's DNS-triggering terms only. Verify nested lookups with a live DNS checker before publishing.

Mistake:Publishing p=reject without a monitoring period.

Fix:Start at p=none with rua reports, then ramp through quarantine 25/50/100 before rejection.

Mistake:Estimating RSA key size from the base64 payload length.

Fix:The tool decodes the SPKI DER structure to read the modulus bit length, which is the number receivers actually enforce.

Frequently asked questions

What is the SPF 10-lookup limit?

RFC 7208 §4.6.4 caps the DNS queries used while evaluating an SPF record at ten. Each include, a, mx, ptr, exists and redirect term counts as one; ip4, ip6 and all do not. The counter in this tool counts the terms in the record you are editing and warns at nine, so you have room to add another sender before receivers return permerror.

How do I split an SPF record over 255 characters?

DNS TXT strings are limited to 255 octets each, but a record may consist of several quoted strings at the same owner name. The builder splits at mechanism boundaries and shows a zone line such as "first part " "second part" — the trailing space keeps concatenation identical to the original record.

What does p=quarantine; pct=25 do?

DMARC applies the policy only to a percentage of messages that fail SPF or DKIM alignment. p=quarantine with pct=25 sends a quarter of failing messages to spam quarantine and leaves the rest alone. It is the first enforcement step after a monitoring period, followed by 50%, 100% and only then a p=reject ramp.

How do I choose a DKIM selector?

A selector is a DNS label that identifies the key, such as s1 or google. Use something short, unique to this key and rotatable — many teams include a year or a provider name. The record name becomes selector._domainkey.example.com. Publish a second selector when rotating keys, then remove the old one after the transition.

Does this tool check my live DNS?

No. It authors and statically validates records before publication and makes no network requests. To inspect records that are already published, use the TXT lookup tool; that is the complementary live-DNS side of the same workflow.

Why is my DKIM key reported as a different bit length than the base64 size?

A DKIM p= value is a DER-encoded SubjectPublicKeyInfo structure, which contains headers in addition to the RSA modulus. Multiplying the decoded byte count by eight therefore overstates the key size. This builder parses the DER structure and reads the modulus, so a real 2048-bit key is reported as 2048 bits.

References & standards