Skip to content
Email2 min read

What is an SPF record?

Short answer

SPF (Sender Policy Framework) is a TXT record in DNS that lists the servers allowed to send email for your domain. The receiving server checks it, and mail from a server that isn't listed may be rejected or sent to spam.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Record syntax
  2. Practical example: merging two services
  3. Common mistakes
  4. On ArabyHost

Without SPF, anyone can send a message from their own server with [email protected] as the sender. SPF closes part of that gap: you publish a list of the servers that send for you, and the receiving server compares the sending IP against it.

Record syntax

SPF is published as a TXT record on the domain itself:

example.com.  IN  TXT  "v=spf1 a mx include:_spf.google.com ~all"
Part Meaning
v=spf1 Start of the record and its version; required
a The server in the domain’s A record may send
mx The domain’s MX servers may send
ip4:203.0.113.10 A specific IP address may send
include:_spf.google.com Servers allowed by another service (Google here)
~all Anything else is suspicious (softfail)
-all Anything else fails

Practical example: merging two services

Your mailbox is on your hosting, and you also use a newsletter service that asks you to add include:servers.newsletter.example. The mistake is adding a second record; the right move is editing the existing one:

v=spf1 a mx include:servers.newsletter.example ~all

Build it with the SPF generator, then check it with the TXT lookup tool.

Common mistakes

  • Two SPF records on one domain: results in PermError, which is as good as having no SPF.
  • More than 10 DNS lookups: each include, a and mx costs a lookup, the limit is 10, and going over also gives a PermError.
  • Forgetting a service that sends as you: such as your invoicing system or store, whose mail then lands in spam.
  • Thinking SPF protects the From address: SPF checks the return path (Return-Path); tying it to the visible From is the job of DMARC.

On ArabyHost

When your domain points to ns1.arabicode.com and ns2.arabicode.com, SPF is set up automatically, together with DKIM, for your business email. If you add another sending service, edit that same record in the DNS editor instead of creating a new one. If your DNS zone is hosted elsewhere, such as Cloudflare, copy the record there. For the full steps, see the SPF, DKIM and DMARC guide.

FAQ

Can I have more than one SPF record?

No. A domain must have exactly one SPF record. If you use several services, merge them into one record with an include for each.

What's the difference between ~all and -all?

~all marks mail from other servers as suspicious (softfail), usually accepted with a lower score; -all says reject it (fail). Start with ~all until you're sure every sending source is listed.

Is SPF enough to stop spoofing?

No. SPF only checks the sending server and doesn't protect the visible From address. You need DKIM and DMARC as well.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.