← Back to blog

SPF Record Syntax Explained With Safe, Simple Examples

August 30, 2026

SPF record syntax can look like one long line of punctuation, but it follows a small set of rules. An SPF record is a DNS TXT policy that says which systems may send using an envelope-from domain. Understanding the pieces helps you add a legitimate provider safely and recognize common mistakes before they affect delivery.

The required beginning

An SPF record starts with v=spf1. This identifies the TXT value as an SPF policy. A DNS zone may contain many TXT records for other purposes, including verification, DKIM, DMARC, and TLS-RPT; only the one beginning with v=spf1 is the SPF record.

Mechanisms authorize senders

Mechanisms are the items after the version tag. Common examples are include:, which evaluates another domain’s SPF policy; ip4: and ip6:, which authorize specific IP addresses; a, which can authorize a domain’s address; and mx, which can authorize mail-exchange hosts. Use only mechanisms your real sending providers document.

Qualifiers change the result

A qualifier can change what happens when a mechanism matches. In practice, many business records use a final ~all or -all. The all mechanism applies to senders that did not match an earlier authorization. Do not add mechanisms after it: SPF evaluation stops when it reaches all.

Read a safe conceptual example

A pattern such as v=spf1 include:provider-one.example include:provider-two.example ~all means “check two provider policies, then treat anything else according to the final all rule.” The provider names are illustrative, not values to publish. Replace them only with current vendor-provided mechanisms for services your business uses.

Use one SPF record

A domain should publish one SPF policy. Adding another TXT record that begins with v=spf1 can cause a permanent SPF error at receiving systems. When a new sender is approved, edit the existing record and preserve every authorization still needed by other streams. Save the old value before changing it.

Count DNS lookups

Includes, A, MX, and redirect mechanisms can cause DNS lookups. SPF allows a maximum of ten during evaluation, including lookups inside provider includes. A record can look short and still exceed the limit. Review the SPF lookup-limit guide before adding another service.

Watch record placement and formatting

SPF normally belongs at the root of the sending domain, not at a random subdomain or the visible From address unless that is the actual envelope-from identity. DNS dashboards may show quotes or split long TXT values into fragments; that can be normal. More dangerous problems are a wrong host name, an accidentally removed include, or a copied record that replaces your real sender list.

Test real senders

After a change, wait until the new public value is visible and send fresh messages from every important system: mailboxes, campaigns, CRM, forms, support, and billing. Inspect headers for SPF results. Use how to check SPF, what SPF include means, and SPF record examples for the supporting steps.

Remember SPF’s limits

SPF is part of email authentication, not the whole answer. Enable DKIM where available and use DMARC to evaluate aligned identity. A sender can pass SPF but still have a DMARC alignment issue, and forwarding can affect SPF evaluation. Run Beacon’s free domain check to review the public SPF, DKIM, and DMARC foundation after a syntax change.

Document the owner, purpose, and test result for every SPF change.

Want a free deliverability check for your domain?
Run a free check →