Skip to content

SPF & DMARC Generator

This SPF and DMARC generator builds the two DNS TXT records that prove your email is really from you: an SPF record listing your sending services, and a DMARC policy telling receivers what to do with mail that fails. It counts SPF DNS lookups as you go, so you stay under the limit of 10.

How to use the SPF & DMARC Generator

  1. 1Tick every service that sends email using your domain, such as your mailbox provider and newsletter tool.
  2. 2Add any other include domains or your own server IP addresses, then choose ~all or -all.
  3. 3Check the DNS lookup counter stays at 10 or below.
  4. 4Set your DMARC policy and add an address for aggregate reports. Start with p=none if DMARC is new to you.
  5. 5Copy each value into a TXT record at your DNS host: SPF on @ (the root) and DMARC on _dmarc.

How SPF works

SPF (Sender Policy Framework) is a TXT record on your domain that lists the servers allowed to send email for it. When a message arrives, the receiving server looks up the SPF record of the domain in the envelope sender, also called the Return-Path or MAIL FROM, and checks whether the sending IP address is on the list.

The record starts with v=spf1, followed by mechanisms that are checked from left to right: ip4 and ip6 for specific addresses, a and mx for your own servers, and include to pull in a provider's list. It ends with an all mechanism for everything else. ~all means soft fail, so unlisted mail is usually accepted but marked as suspicious, while -all means fail. A domain must have exactly one SPF record: if you add a new service, edit the existing record rather than creating another.

The 10 DNS lookup limit

SPF has a hard limit: evaluating a record may trigger at most 10 DNS lookups. Every include, a, mx, ptr, exists and redirect counts, and so does every lookup inside the records you include. Google Workspace costs one lookup, but some providers nest several includes, so a few services can use up the budget quickly. ip4 and ip6 entries cost nothing.

If a record goes over 10, receivers return a permanent error and treat SPF as failed for all of your mail, which can push it to spam or get it rejected under DMARC. To stay under the limit, remove services you no longer use, avoid the slow and discouraged ptr mechanism, and send bulk or marketing mail from a subdomain such as news.example.com, which has its own SPF record and its own budget of 10.

How DMARC builds on SPF and DKIM

SPF on its own does not stop spoofing, because it checks the hidden envelope sender rather than the From address people see. DMARC closes that gap. A message passes DMARC when it passes SPF or DKIM and the domain that passed is aligned with the visible From domain. Relaxed alignment, the default, accepts any subdomain of the same organizational domain; strict alignment requires an exact match.

The DMARC record lives at _dmarc.yourdomain.com. Its policy, p=none, quarantine or reject, tells receivers what to do with mail that fails. The rua tag asks receivers to send daily aggregate reports, XML summaries of who sent mail as your domain and whether it passed. Those reports are how you discover forgotten senders before you enforce a strict policy.

Rolling out DMARC safely

Start with p=none and an rua address. Nothing is blocked at this stage; you simply collect reports. Review them for a few weeks, ideally with a DMARC report viewer, and make sure every legitimate service, including CRMs, help desks and invoicing tools, passes SPF or DKIM with alignment. Most providers support DKIM signing with your own domain, which is the more robust of the two.

When the reports look clean, move to p=quarantine, optionally with a lower pct value to phase it in, and then to p=reject. Large mailbox providers now expect this setup: Google and Yahoo require SPF, DKIM and a DMARC record from bulk senders, and a published DMARC policy improves deliverability for everyone else too.

Email Marketing

Good DNS gets you to the inbox. Devma designs and tests the emails that get opened, clicked and remembered.

Questions? Answers.

Can I have two SPF records on my domain?

No. If a domain publishes more than one TXT record starting with v=spf1, receivers return a permanent error and SPF fails. Merge every service into a single record instead.

Should I use ~all or -all?

Use ~all (soft fail) while you are still confirming which services send mail for you, then switch to -all (fail) once you are confident the list is complete. With DMARC in place, the DMARC policy largely decides what happens to failing mail.

Which DMARC policy should I start with?

Start with p=none plus an rua reporting address. It changes nothing about delivery but shows you every source sending as your domain. Move to quarantine and then reject once all legitimate mail passes.

What happens if my SPF record has more than 10 lookups?

Receivers stop evaluating it and return a permanent error (permerror), so SPF fails for every message. Remove unused includes, replace small includes with ip4 or ip6 ranges, or move bulk mail to a subdomain.

Do I also need DKIM?

Yes. DKIM signs each message with a key published in your DNS, and it survives forwarding better than SPF. DMARC passes if either SPF or DKIM aligns, so setting up both gives you the most reliable delivery. Each email provider gives you its own DKIM records.

Abstract blue swirling shapes with light reflections

Ready to grow?

Let’s build a solution that’s built for your business. Whether you’re starting fresh or scaling fast, we’re here to help you go further, faster.

Get a free proposal

Fill out the form and our team will get back to you within 24 hours.

Devma

AI assistant · replies in seconds

Hi there.
How can we help?

Ask about websites, SEO, ads, AI search or our care plans. Answers come from our own guides, and a person is one tap away.

  • Message us on WhatsApp