Domain check / SPF

<SPF>

Sender Policy Framework

SPF checks whether an email really comes from a server that is allowed to send on behalf of your domain. Does it check out? Then your message goes through. Does it not? Then the recipient stops the misuse. That way you prevent others from using your domain name, and your own emails arrive more reliably.

<why it matters>

Why SPF matters

Without SPF, anyone can send email that claims to come from your domain. Recipients cannot tell which servers are really yours. With SPF you publish that list in your DNS, and every receiving mail server can check it.

Since 2024 Google and Yahoo, and since 2025 Microsoft too, require organisations that send a lot of email to their users to have SPF, DKIM and DMARC in place. Even at low volumes, email without proper SPF ends up in spam more often.

SPF alone is not enough. It checks the technical sender address (Return-Path), not the address the recipient sees. And with forwarded email, SPF often fails. That is why SPF works together with DKIM and DMARC.

<example>

What a SPF record looks like

yourdomain.com (TXT)

v=spf1 include:spf.protection.outlook.com include:servers.mcsv.net ip4:203.0.113.10 -all
PartWhat it means
v=spf1This is an SPF record. There may be only one.
include:spf.protection.outlook.comMicrosoft 365 may send on your behalf. An include adopts another party's SPF record.
include:servers.mcsv.netA second service, in this example a newsletter service.
ip4:203.0.113.10One fixed server, for example your web shop or scanner. Costs no DNS lookup.
-allAnything not listed above is not allowed. ~all is more lenient: suspicious, but do not reject.
<in order>

SPF done right

  • There is exactly one SPF record on your domain.
  • The record ends with -all (strict) or ~all (lenient).
  • There are no more than ten DNS lookups, such as include:.
<common problems>

What goes wrong, and what you can do

More than ten DNS lookups

SPF may look up another DNS name at most ten times (RFC 7208). Every include, a, mx, exists, redirect and ptr counts, also when it sits inside another party's include. ip4, ip6 and all do not count. Microsoft 365 alone already uses several.

If you go over ten, SPF returns a permanent error (permerror). Many recipients treat that as a failed check, and with DMARC your email may then be rejected. Often you only notice when complaints come in.

What you can do: clean up first. Remove services you no longer use. Replace a and mx with fixed ip4 addresses if your own server has a fixed address. Send newsletters and transactional email through a separate subdomain (such as news.yourdomain.com), or set up a custom sender domain at that service, so their SPF does not need to be in your main record.

If that still is not enough, use SPF flattening: the includes are replaced by the IP addresses they point to. Do not do this by hand, because services such as Microsoft and Google change their addresses regularly. Dynamic SPF flattening keeps track of that automatically. That is how we keep our own domain under ten.

Two SPF records

If there are two TXT records starting with v=spf1, SPF is invalid. This often happens when a new service has its own record added. Merge them into one record with all includes.

A record that is too broad

+all or ?all means anyone may send on your behalf. An include of an entire hosting provider or a wide IP range is risky too: every customer on those same servers may then send as you. Only include what you actually use.

Domains that do not send email

Domains you never send from get misused too. Put v=spf1 -all on them, together with a DMARC record with p=reject. Then every recipient knows that email from that domain is always fake.

<together with DMARC Advisor>

We take it off your hands

Brandaris works with DMARC Advisor, the Dutch DMARC specialist that has been around since 2013. With DMARC Advisor's SPF Management we keep your SPF record up to date, and Dynamic SPF Flattening solves the problem of too many lookups without manual work. In the DMARC Manager reports we see which servers send on behalf of your domain, and whether they are in your SPF.

<frequently asked questions>

About SPF

Is your question not listed? Call us on 072 202 97 95.

Should I use -all or ~all?

With -all you say that all other servers may not send. With ~all it is suspicious, but not rejected. If DMARC is set to reject, DMARC decides and the difference is small. We recommend -all as soon as you are sure all genuine senders are in the record.

How do I know how many lookups my SPF uses?

The free domain check on our site counts the DNS lookups in your SPF record, including those in includes, and warns you when you are close to the maximum of ten.

Do ip4 and ip6 entries count towards the ten lookups?

No. Only parts that need an extra DNS query count: include, a, mx, exists, redirect and ptr.

What is SPF flattening?

The includes in your SPF record are replaced by the IP addresses they point to. That keeps you under ten lookups. Do it dynamically: services change their IP addresses, and a static list then becomes outdated.

Is SPF enough to prevent spoofing?

No. SPF does not check the sender address the recipient sees. Only DMARC, together with SPF and DKIM, protects that address.

<newsletter>

Our newsletter

Cybersecurity is not just technology. It is people work. In our newsletter we share knowledge, stories and experiences that show how we help organisations move forward. The newsletter is in Dutch.