DMARC and SPF record generator

Setting up email on your own domain means adding two TXT records that most DNS panels give you no help with. Tick what applies, copy the result and paste it in.

Short answer

For SPF, tick every service that sends email for your domain and copy the value into a TXT record at the root (@). For DMARC, start with policy none and a report address, copy the value into a TXT record called _dmarc, and tighten the policy once the reports show that only your own services send mail.

Build your records

Everything is calculated in your browser. Nothing you type is sent to us.

Loading the tool …

SPF: list every sender, once

SPF answers one question: which servers may send email that claims to come from your domain? List your mailbox provider, your newsletter tool, your web shop and anything else that sends on your behalf. Ticking Ayamail adds the same mechanisms our own setup uses for domains connected to Ayamail.

A domain may only have one SPF record. If you already have one, add the new service to it instead of creating a second. Each include, a, mx and redirect costs a DNS lookup, and receivers give up after ten, including the lookups hidden inside the services you include. The generator counts the ones it can see; the domain checker follows the includes and counts them all.

End the record with ~all while you test. It asks receivers to treat other senders as suspicious. Once everything works, -all tells them to reject other senders outright.

DMARC: monitor first, then enforce

DMARC tells receivers what to do when a message fails both SPF and DKIM alignment with the From address. Start with p=none and a report address in rua. Reports arrive as compressed XML files, usually once a day per receiver, and show every server that sent mail as your domain.

When the reports only show your own services, move to p=quarantine, which sends failing mail to spam, and later to p=reject. The percentage setting lets you apply the stricter policy to part of the mail first. Reports sent to an address on a different domain only arrive if that domain publishes a record allowing it.

Ayamail does not collect or read DMARC reports for you, so use an address you check yourself or a reporting service you trust.

Adding the records at your DNS host

  1. Open your DNS settings

    Usually at the company where you bought the domain, such as 123 Reg, IONOS or Cloudflare.

  2. Create or edit the TXT records

    SPF goes on @ (the domain itself), DMARC on _dmarc. Paste the value without extra quotation marks unless the panel asks for them.

  3. Check the result

    Wait for the change to show up, then run the domain checker to confirm both records and the lookup count.

Check what is published now

See the live SPF, DKIM and DMARC records for your domain.

Questions and answers

Should I use ~all or -all?
Start with ~all. When you are sure every legitimate sender is listed, switch to -all.
What does the ten-lookup limit mean?
A receiver may make at most ten DNS lookups while checking your SPF record. Above that, SPF fails, even for real mail.
Will DMARC stop all fake email?
It stops fake mail that uses your exact domain, once the policy is quarantine or reject. It cannot stop look-alike domains.
  • Domain checker

    Enter a domain to see its mail servers and whether SPF, DKIM and DMARC are set up correctly, with plain-English fixes. Free, no sign-up.

  • Glossary

    From alias and Bcc to DKIM, IMAP, MX record and TLS: short, accurate definitions of email and privacy terms, with links to deeper guides.

  • Header analyser

    Paste the headers of a suspicious email to see the route, delays and SPF, DKIM and DMARC results. Runs in your browser; nothing is uploaded.

  • Password generator

    Generate strong passwords or easy-to-type passphrases. Created on your device with your browser's secure random generator; nothing is sent or stored.