SPF & DMARC Record Generator
SPF and DMARC TXT records, with the SPF lookup count and long values split for DNS.
About SPF & DMARC Record Generator
An SPF and DMARC record generator that builds the DNS TXT values for your mail senders and policy, and counts SPF DNS lookups against the limit of 10.
How to use
- Under SPF, tick the mail providers you send through, choose whether the domain's own A or MX servers send mail, and add any IP addresses or other include domains.
- Choose what happens to mail from anywhere else:
-all(fail),~all(soft fail) or?all(neutral). - Under DMARC, choose the policy and, if you want reports, the addresses they go to. The other tags are optional.
- Publish each record at your DNS host as a TXT record with the name and value shown. To change a record you already have, paste it into the Read box and press Read into fields.
What it does
- Builds
v=spf1records froma,mx,ip4,ip6andincludemechanisms, plus any other terms you type, ending with theallyou choose. Presets add the include values that Google Workspace, Microsoft 365, Amazon SES, SendGrid, Mailgun, Fastmail and Proton Mail give in their own setup guides. - Counts the terms that need DNS lookups (
include,a,mx,ptr,existsandredirect) and warns above 10, the limit in RFC 7208. It cannot see the lookups inside each included record, so the real total may be higher. - Shows a zone file line with the value split into quoted strings of at most 255 characters, the size limit of one TXT string, when a record is longer than that.
- Builds
v=DMARC1records withp,sp,pct,rua,ruf,adkim,aspfandfo, leaving out tags that only repeat the default. Report addresses are checked and given themailto:prefix. - Reads an existing SPF or DMARC record back into the fields, including one split into quoted strings, and says which tags it could not keep.
- Does not query DNS, so it cannot check what is published now, and it does not make DKIM or BIMI records.
Example
SPF name @ TXT v=spf1 mx include:_spf.google.com ~all
DMARC name _dmarc TXT v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com
Privacy
The records are built in the browser from what you enter. No DNS query or other request is made, and nothing is stored.
Frequently asked questions
- What is the SPF 10 DNS lookup limit?
- RFC 7208 lets a receiver make at most 10 DNS lookups while checking one SPF record, counting include, a, mx, ptr, exists and redirect, and the lookups inside included records. Over 10, the check ends in a permanent error, so SPF cannot pass for any message.
- Can a domain have two SPF records?
- No. With more than one v=spf1 record the check returns a permanent error. Merge the mechanisms into one record with a single all at the end.
- What is the difference between ~all and -all in SPF?
- -all asks receivers to treat mail from unlisted servers as a fail, and ~all as a soft fail, which usually means accepting it but marking it as suspicious.
- Which DMARC policy should I start with?
- Start with p=none and an rua address to collect aggregate reports without affecting delivery. When the reports show your own mail passing SPF or DKIM in alignment, move to p=quarantine and then p=reject.