SPF Record Generator

Build a Sender Policy Framework record for your domain, see how many of its 10 DNS lookups it uses, and check the record you already have published. The record is built in your browser.

Build a record

Servers that send mail for this domain
Email services you send through
What should happen to mail from any other server?
Your SPF record

    Publishing it

    TypeTXT
    Name / Host@ (the domain itself; some dashboards want the full domain name)
    Value
    TTL3600 (or your provider's default)

    A domain must have exactly one SPF record. If one already exists, replace it instead of adding a second; two SPF records make every check fail.

    Check a published record

    Looks up the domain's TXT records through Cloudflare's public DNS-over-HTTPS resolver (cloudflare-dns.com), then follows every include and counts the lookups.

    About SPF

    • SPF lists the servers allowed to send mail using your domain in the envelope sender. Receivers check the connecting server against that list. It is defined in RFC 7208; background is at open-spf.org.
    • Each include, a, mx, ptr, exists and redirect costs a DNS lookup, and so does every lookup inside an included record. Past 10, receivers stop and treat SPF as failed. Large providers' includes often use several each, so check nested lookups before publishing.
    • ip4 and ip6 cost no lookups, so listing a fixed server by address is cheaper than a.
    • SPF on its own is not enough today. Gmail and Yahoo require SPF or DKIM for all senders, and SPF, DKIM, and DMARC for bulk senders. DKIM signs each message, and DMARC tells receivers what to do when checks fail.
    • The 2009 walkthrough on this site, Setting Up SPF, SenderId, Domain Keys, and DKIM, covers the original Postfix setup.