Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
An SPF record lists the servers permitted to send mail for your domain. It is the oldest email authentication control, the easiest to publish, and the easiest to get subtly wrong.

What Is an SPF Record?
Sender Policy Framework, specified in RFC 7208, lets a domain owner publish a list of the hosts permitted to send email on that domain’s behalf. A receiving server compares the connecting address against the list and treats a mismatch according to the policy you have stated. It is a single DNS record, it takes minutes to publish, and it is the foundation that DMARC builds on.
SPF is a TXT record at the domain apex:
example.co.uk. IN TXT "v=spf1 ip4:203.0.113.0/24 include:spf.protection.outlook.com include:_spf.example-crm.com -all"
The mechanisms are evaluated left to right and the first match wins. ip4 and ip6 name addresses directly. include pulls in another domain’s record, which is how SaaS senders are authorised. a and mx authorise the hosts named in those records. all matches everything and therefore belongs last.
The qualifier on all is the policy statement. -all is a hard fail, meaning anything not listed is unauthorised. ~all is a soft fail, meaning treat it as suspicious but accept. +all authorises the entire internet and should never appear; it does appear, and when it does it is nearly always a copy-paste error.
Use -all once you are confident the record is complete. A soft fail is appropriate during rollout and is a reasonable permanent choice only if DMARC enforcement is also in place, since DMARC supplies the policy anyway.
This is the rule that breaks most records. SPF evaluation may perform at most ten DNS lookups, counting every include, a, mx, ptr, and exists mechanism, and crucially counting them recursively — an include that itself contains three includes consumes four. Exceed ten and the result is permerror, which most receivers treat as a failure, so a record that is too long can be worse than no record at all.
Organisations hit the limit after the fourth or fifth marketing platform. The usual remedies are removing senders that no longer exist, replacing an include with the explicit ip4 ranges where the provider publishes stable addresses, moving some senders to a subdomain with its own record, or using a flattening service that resolves includes into addresses automatically. Flattening is effective and carries a maintenance obligation, because a provider that changes its address ranges breaks your mail silently until the record is regenerated.
Two smaller rules matter too: the record must be a single TXT record — publishing two SPF records for one domain is a permanent error — and the ptr mechanism is deprecated and should not be used.
Three limitations define why SPF alone is insufficient.
It checks the envelope sender, not the visible From address. An attacker can pass SPF for their own domain while displaying your domain in the header the recipient actually sees. Only DMARC requires alignment between the two.
Forwarding breaks it. When a mailbox forwards a message, the forwarding server becomes the connecting host and is not in your record, so SPF fails. DKIM usually survives forwarding, which is why DMARC accepts either.
Shared infrastructure dilutes it. An include for a large provider authorises every address in that provider’s sending estate, including those used by other customers. SPF proves the mail came from somewhere authorised, not from you specifically.
Inventory every system that sends on your behalf — the mail platform, the CRM, the invoicing system, the recruitment portal, the transactional sender used by one application. DMARC aggregate reports are the most reliable way to produce that list, because they show what is actually sending rather than what anyone remembers.
Then publish for every domain you own, including ones that never send mail: a bare v=spf1 -all on a parked domain costs nothing and removes it as a spoofing target. Check the record with a validator that counts lookups, and re-check whenever a supplier changes. Finally, publish DKIM and DMARC, because SPF on its own stops very little. Our Email Security Solutions cover the whole authentication stack rather than one record of it.
SPF evaluation may perform at most ten DNS lookups, counting include, a, mx, ptr, and exists mechanisms recursively through nested records. Exceeding it produces a permanent error that most receivers treat as a failure. Remove unused senders, replace includes with explicit address ranges where providers publish them, or use a flattening service with automated regeneration.
Use -all once you are confident every legitimate sender is listed, because it instructs receivers that unlisted sources are unauthorised. Use ~all during rollout while you verify the record from DMARC reports. A permanent soft fail is defensible only alongside DMARC enforcement, which supplies the policy regardless of the SPF qualifier.
Forwarding changes the connecting server. The receiving system sees the forwarder’s address, which is not in your record, so the check fails even though the message is genuine. DKIM signatures usually survive forwarding, which is why DMARC passes when either mechanism aligns, and why ARC exists for mailing lists that modify the message.
Yes, and it is one of the simplest wins available. Publish v=spf1 -all on every parked, brand, or legacy domain you own, along with a DMARC record set to reject and a null MX record. There is no legitimate mail to break, and it removes those domains as spoofing targets at no operational cost.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.