Illustration of approved email sources passing through a glass verification gate while an unauthorised source is stopped.
TechVertu » Blog » Technical Guides and Tutorials » What Is an SPF Record? A Business Email Guide With Examples

What Is an SPF Record? A Business Email Guide With Examples

An SPF record is a DNS TXT record that identifies the servers allowed to send email using a particular domain in the message’s envelope sender address. SPF stands for Sender Policy Framework. Receiving mail systems check the sending server’s IP address against this published authorisation to help detect unauthorised use of the domain.

For a business, the practical challenge is accounting for every legitimate sender: employee mail, invoices, website notifications and marketing platforms. This guide explains the record, shows a labelled fictional example and provides a sender-inventory worksheet to plan changes safely. An SPF pass does not guarantee delivery or prove that a message is safe. Microsoft’s SPF guidance explains the identity being checked.

What Is the SPF Record Used For?

SPF lets a domain owner publish sending permissions in the Domain Name System, or DNS. It helps receivers distinguish an authorised sending server from one using a domain without permission. It does not encrypt email, inspect attachments or verify the person who wrote a message.

Email has two relevant sender addresses. The visible From address appears in your email app. The envelope sender, also called MAIL FROM, is used during mail transport and for delivery errors; its domain may belong to a sending provider. A delivered message’s Return-Path can help identify it. Amazon SES documents these two addresses.

For ordinary mail, SPF checks the envelope domain. It can also check the sending server’s HELO/EHLO identity; that identity supplies the domain for SPF when the reverse path is empty, as with some bounce messages. See RFC 7208, Sections 2.3–2.4.

The distinction matters when a marketing email displays your business address but uses the provider’s bounce domain. Editing your business domain’s SPF record does not change the record for that provider-owned domain.

What Does an SPF Record Look Like?

For a custom domain sending only through commercial Microsoft 365, Microsoft documents this value:

v=spf1 include:spf.protection.outlook.com -all

This is a conditional example, not a default for every business. Other Microsoft cloud environments use different values, and additional sending systems require review. SPF is edited at the authoritative DNS host, which may be separate from the domain registrar or website host. It is not an Outlook setting. Microsoft lists the relevant scenarios.

Part Meaning
v=spf1 Identifies the SPF version.
include:spf.protection.outlook.com Consults Microsoft’s SPF policy; a pass from that evaluation matches this mechanism.
ip4: or ip6: Authorises a specified IPv4 or IPv6 address or range.
-all Returns fail for a source that reaches this final mechanism.
~all Returns softfail instead.

Mechanisms are evaluated from left to right; a match ends evaluation. Publish one SPF TXT record at each relevant DNS owner name. Other TXT records, such as domain-verification records, can coexist. Do not create a second SPF record when adding a sender. These rules are defined in RFC 7208.

Should You Use -all or ~all?

Both identify unmatched sources differently; neither guarantees a particular delivery outcome. Receivers apply their own policies. Microsoft recommends -all for its documented setup alongside DKIM and DMARC, while Google’s Workspace setup guidance recommends ~all. Follow the verified requirements for your sending environment and complete the inventory before tightening an existing record. Never use +all as a delivery fix: it authorises every source.

A Fictional Business SPF Example

Illustrative scenario, not a TechVertu deployment: a small firm uses example.com, commercial Microsoft 365 for staff email, a managed invoice relay and a newsletter platform. The domain and IP address below are reserved for documentation. This record must not be copied into production.

Assume the invoice supplier has confirmed a stable public sending IP and uses example.com as the envelope domain. The newsletter platform uses its own envelope domain and separately provides aligned DKIM for the firm’s visible From address.

Sender Evidence to Obtain Decision in This Scenario
Staff Microsoft 365 mail Service configuration and a controlled message showing the envelope domain Retain Microsoft’s documented include in example.com.
Invoice relay Supplier confirmation of the envelope domain and stable public IP Authorise the verified relay IP in the same record.
Newsletter platform Provider instructions, envelope domain and DKIM signing domain No root SPF addition solely because the visible From address uses example.com; verify aligned DKIM.

The fictional root-domain record would be:

v=spf1 ip4:203.0.113.25 include:spf.protection.outlook.com -all

The ip4: entry represents the invoice relay, the include covers Microsoft 365, and the final mechanism returns fail for other sources if no earlier error stops evaluation. The documentation IP will not authorise a real invoice service. The Microsoft include can involve further lookups, so this line alone does not establish the total lookup count.

This example’s most useful decision is the newsletter row: identify the envelope domain before deciding where an SPF change belongs. A supplier using your domain in the visible From address does not, by itself, establish a root SPF requirement.

What If the Provider Requires a Custom Bounce Domain?

Follow its exact instructions. For example, Amazon SES custom MAIL FROM requires an SPF TXT record and an MX record for the selected subdomain. Its default MAIL FROM instead uses an Amazon-owned domain. Other services may use different records or delegation arrangements.

A subdomain such as bounce.example.com does not inherit the root SPF record. Creating that subdomain’s DNS record alone also does not move a service onto it: the sending service must be configured accordingly. Preserve unrelated root MX records that handle staff inboxes.

Build a Sender Inventory Before Changing DNS

Ask finance, marketing, sales, HR and the website owner which systems send messages. Include occasional processes such as annual renewals, password resets and scanners that send through a relay. The NCSC recommends consulting departments about third-party mailing agents; a successful staff-email test cannot establish that every business workflow is covered.

Copy the worksheet below into your change record. Use a separate row when a service has more than one sending route or envelope domain.

Inventory Field What to Record Evidence Needed Before Approval
Service and business owner Platform, purpose and accountable person Owner confirms the service is still required.
Visible From and envelope domain Both identities for each sending route Controlled message and provider configuration; do not infer one from the other.
Required authorisation Exact include, stable public IP, or provider-managed arrangement Current official instructions for the account’s region and mode.
DNS owner name Root domain, sending/bounce subdomain or provider domain Confirm which domain the receiver actually checks.
DKIM and DMARC alignment Signing domain, aligned result and relevant alignment mode Recipient-side authentication results and approved reporting.
Change and recovery Existing value, proposed value, TTL and rollback owner Approved comparison, lookup review and recovery plan.
Test and review Test date, recipient system, workflow result and next review Evidence for every sender, including delayed or scheduled jobs.

Do not treat an unfamiliar IP in a report as permission to authorise it. First establish service ownership through your own configuration, logs and supplier evidence. TechVertu’s guide to reading a DMARC report explains how to investigate reported sources without assuming every failure is an attack.

Understand the SPF Lookup Limit

SPF allows at most 10 evaluated DNS-querying terms across an evaluation, including nested policies. include, a, mx, ptr, exists and redirect count; ip4, ip6 and all do not. Exceeding the limit produces permerror. The initial retrieval of the domain’s SPF record is not an extra counted term. The standard also recommends a two-void-lookup limit for empty or non-existent DNS answers. RFC 7208, Section 4.6.4 defines these limits.

Worked planning calculation: suppose a fictional record has three includes. If each provider policy evaluates three further includes, a path reaching all of them uses 3 + (3 × 3) = 12 counted terms. It would exceed the limit. A message matching an earlier mechanism may stop sooner, which explains why one sending route can pass while another encounters an error.

This is a hypothetical calculation, not a measurement of Microsoft or another vendor. Check the actual nested policies and relevant paths with a suitable validator. Google’s troubleshooting guidance confirms that nested lookups count.

Remove obsolete authorisations only after the owner confirms retirement. Consider consolidating senders or using a correctly configured sending subdomain. Avoid manually replacing a dynamic provider include with today’s resolved IPs: the addresses can change. Microsoft specifically advises against flattening its Microsoft 365 include.

How to Check and Update SPF Safely

You need authorised access to the DNS zone and enough access to each sending service to obtain settings and send controlled messages. A Microsoft 365 administrator role does not automatically grant access to an external DNS host. SPF itself is a public DNS mechanism, not a feature unlocked by purchasing Defender for Office 365.

  1. Capture the current state. Record the DNS host, exact owner name, existing SPF value and TTL. Export the relevant records and name the person responsible for recovery.
  2. Complete the inventory. Resolve unknown senders and account-specific provider requirements before drafting a replacement. Do not replace a complex record with a provider-only example.
  3. Review the proposed change. Preserve required senders, check syntax and nested lookup paths, and confirm the chosen qualifier. Validate in a suitable test environment where feasible; a test subdomain does not prove the production inventory is complete.
  4. Edit the correct DNS record. Follow your host’s instructions for the name and TXT value. Some interfaces use @ for the root and others append the domain automatically. Update the existing SPF record rather than adding another; preserve unrelated records. Cloudflare’s DNS documentation illustrates provider-specific controls.
  5. Check publication and send tests. Compare authoritative and recursive DNS responses, allowing for caching of the previous TTL. Test every sending workflow to approved external recipient systems, then examine authentication results, delivery errors and reporting.
  6. Monitor and recover if necessary. If a required workflow breaks after the edit, investigate against the saved comparison. An authorised administrator can restore the previous value when appropriate, but caches may delay recovery. Re-test after restoration; do not weaken the record to +all.

Read the Published TXT Records

On Windows, these are read-only queries. Replace the example with the actual envelope domain you are investigating:

Resolve-DnsName -Name example.com -Type TXT

Alternatively:

nslookup -type=TXT example.com

Find the record starting v=spf1. A TXT response can contain several quoted strings belonging to one record; these are joined together. That differs from two separate SPF records. A DNS query proves what that resolver returns, not successful mail authentication or complete sender coverage. Microsoft documents Resolve-DnsName and nslookup.

For a controlled message, use the receiving system’s trusted authentication results to check the SPF result and evaluated domain, often shown as spf=pass and smtp.mailfrom. Do not rely on a copied header from an untrusted source. Google explains checking message authentication.

SPF, DKIM and DMARC: What Each Adds

SPF authorises the connecting source for the envelope domain. DKIM uses a digital signature to authenticate a signing domain and signed message content. DMARC connects authentication to the visible From domain through alignment: a message passes DMARC when SPF passes with an aligned domain, or DKIM passes with an aligned signing domain. Alignment rules can be relaxed or strict. Microsoft explains the relationship.

Consequently, a provider-domain SPF pass may be unaligned with your business From address. Aligned DKIM can still provide the DMARC pass. Forwarding can also break SPF because the connecting IP changes; do not authorise arbitrary forwarding servers as a shortcut. Authentication forms part of email security alongside filtering, account protection and user awareness.

Troubleshoot With Evidence Before Editing

Symptom First Evidence to Check Sensible Next Step
permerror Duplicate SPF records, syntax, include responses and counted lookup path Identify the exact error before changing permissions.
temperror DNS availability and the receiving system’s diagnostic detail Investigate temporary DNS failures; adding senders does not fix a timeout.
Staff mail passes; invoices fail Invoice envelope domain, actual outbound route and supplier settings Correct the verified route’s authorisation at the appropriate domain.
SPF passes; DMARC fails Evaluated SPF domain, visible From domain and DKIM result Investigate alignment and signing; do not assume a larger SPF list will help.
Forwarded mail fails SPF Original and forwarded delivery paths and DKIM results Review forwarding behaviour with the mail administrator.
DNS tool looks correct; mail still fails Resolver cache, exact queried domain and a fresh controlled message Check the actual message path and allow for the old cached value.

Use Google’s SPF troubleshooting guide alongside the sender’s current documentation. A green DNS checker is one piece of evidence; keep the workflow tests and service-owner sign-off in the change record.

Keep Sending Permissions Accountable

Start with the inventory, then review the DNS record against the services your business actually uses. Give every authorisation an owner and review it when a supplier, website or mail route changes. The useful outcome is a maintained record supported by evidence for each required workflow.

Frequently Asked Questions

Plan Your Next Email Security Review

Give every sending service a named owner before changing DNS. If your business needs help reviewing its email protection or Microsoft 365 environment, explore TechVertu’s email security services and Microsoft 365 services to discuss your requirements.

Subscribe for Latest Tech Insights & Company News

anything else?

Lets Talk!

If you have additional comments or questions about this article, you can share them in this section.

Your email address will not be published. Required fields are marked *


Scroll to Top