All articles

SPF Records Explained: How to Set Up and Verify Yours

Aug 10, 2026 5 min read
Illustration of a shield over a server icon, representing SPF email authentication protecting a domain

What does v=spf1 include:_spf.example.com ~all actually mean? A full walkthrough of SPF syntax, setup, and verification for your domain.

SPF is one of three pieces of the email authentication puzzle — alongside DKIM and DMARC — that determine whether your emails reach the inbox or get flagged as suspicious. For the full picture of how all three work together, see our guide to Email Authentication: SPF, DKIM, DMARC, and How to Reach the Inbox. Here, we're focused specifically on SPF: what it does, how to read and write one correctly, and how to verify it's actually working.

What an SPF Record Actually Does

SPF (Sender Policy Framework) is a DNS TXT record that lists which mail servers are authorized to send email on behalf of your domain. When someone else's mail server receives a message claiming to be from yourcompany.com, it checks the sending server's IP address against your domain's SPF record. If the IP is listed as authorized, SPF passes. If it isn't, SPF fails — and depending on your configuration, that message might be flagged, quarantined, or rejected outright.

Without an SPF record, anyone could send email that appears to come from your domain, and receiving servers would have no way to check whether that's legitimate. That's the core problem SPF solves.

Anatomy of an SPF Record — Reading One Line by Line

Here's a real-looking SPF record:

v=spf1 include:_spf.example.com ip4:192.0.2.10 ~all

Every SPF record follows the same basic shape: a version tag, one or more mechanisms, and a qualifier on the final catch-all.

Diagram breaking an SPF record into its component parts: version tag, mechanisms, and qualifier

The mechanisms: include, a, mx, ip4/ip6

  • v=spf1 — always the first element; declares this as an SPF version 1 record
  • include:domain.com — authorizes any servers listed in another domain's SPF record (commonly used when a third-party service, like a marketing platform, sends mail on your behalf)
  • a — authorizes the server matching your domain's own A record
  • mx — authorizes any server listed in your domain's MX record
  • ip4:x.x.x.x / ip6:x:x:x:x — authorizes a specific IP address directly

SPF mechanisms are evaluated left to right, and evaluation stops at the first match. This matters for troubleshooting: if a mechanism earlier in the record matches (even incorrectly), later mechanisms are never checked.

The qualifiers: +, ~, -, ?

The qualifier — usually attached to the final all mechanism — tells receiving servers what to do if nothing in the record matches:

Qualifier
Name
Meaning
+allPassAuthorizes everyone (effectively disables SPF — avoid this)
~allSoftfailUnauthorized senders are marked suspicious but typically still delivered, often to spam
-allHardfailUnauthorized senders should be rejected outright
?allNeutralNo explicit policy stated — treated roughly like no SPF at all

Most businesses should use ~all while testing a new record, then move to -all once confident it's complete and accurate.

How to Create Your SPF Record

Finding what to include

Before writing anything, list every service that sends email on your domain's behalf — your primary email host, plus anything like a CRM, marketing platform, or invoicing tool that sends as [email protected]. Each of these typically publishes their own include: value in their setup documentation.

Writing and publishing the TXT record

  1. Combine your primary mail host and any third-party senders into one record — you can only have one SPF record per domain
  2. Format it as v=spf1 [mechanisms] ~all (or -all once confirmed)
  3. Log into your domain's DNS settings and add a new TXT record
  4. Set the host/name field to @ (or your root domain, depending on your DNS provider's convention)
  5. Paste your SPF string as the record value
  6. Save, and allow time for DNS propagation — this can take anywhere from a few minutes to 48 hours

How to Verify Your SPF Record Is Working

Once published, verification confirms the record is both correctly formatted and actually resolving:

  1. Use a DNS lookup tool to query the TXT record for your domain and confirm it returns your SPF string exactly as written
  2. Send a test email to a personal account at a major provider (Gmail, Outlook) and check the message's original headers for an "spf=pass" result
  3. Use a dedicated SPF checking tool to validate syntax and confirm no errors like exceeding the lookup limit

If SPF shows as failing on a message you know is legitimate, the most common culprits are a missing include: for a sending service, a typo in the record, or having more than one SPF TXT record published (which is invalid and causes a permanent error).

Common SPF Mistakes (and the 10 Lookup Limit)

SPF enforces a hard limit of 10 DNS lookups per check — every include, a, mx, exists, and redirect mechanism counts toward that limit, including nested lookups inside include mechanisms you didn't write yourself. Exceed it, and SPF returns a permanent error (PermError), which many receiving servers treat as an outright fail — silently breaking deliverability even though the record looks fine at a glance.

Illustration showing a limited sequence of lookups, the last ones highlighted in warning colors, representing SPF's 10 DNS lookup limit

Other common mistakes: publishing multiple SPF TXT records instead of merging them into one, using +all (which defeats the purpose entirely), and forgetting to update the record after switching or adding a sending service.

SPF Alone Isn't Enough — Where DKIM and DMARC Come In

SPF checks where a message came from, but it doesn't verify the message's content wasn't altered, and it can break entirely when email is forwarded. That's what DKIM and DMARC are for — DKIM cryptographically signs your outgoing messages, and DMARC ties SPF and DKIM together into one enforceable policy. Our full Email Authentication: SPF, DKIM, DMARC guide covers how all three work together as a complete authentication setup — SPF is necessary, but it's step one, not the whole picture.

How UCN Mail Handles SPF Setup

UCN Mail walks you through SPF setup as part of its guided domain configuration — rather than handing you a raw record to assemble and debug on your own, the setup flow identifies your sending services and generates a correctly merged record for you, including DKIM and DMARC alongside it. Combined with built-in spam and threat filtering, this means your domain's authentication is set up correctly the first time, with mailboxes available across the Lite, Basic, Pro, and Business tiers.

Further Reading on the UCN Mail Blog

SPF record explainedSPF record explainedwhat is an SPF recordhow to set up SPF recordhow to create SPF recordSPF record syntaxSPF record examplehow to verify SPF recordSPF record checkerSPF TXT recordSPF include mechanismSPF softfail vs hardfailSPF ~all vs -allSPF record for multiple domainsSPF 10 lookup limitSPF record generatorSPF DNS recordSPF record for Google WorkspaceSPF record for Office 365how does SPF workSPF email authenticationSPF record failedwhy is my SPF record not workingSPF permerrorSPF record best practicescombine SPF recordsSPF and DKIM and DMARCemail spoofing preventionsender policy frameworkcustom domain email SPFSPF record validationbusiness email deliverability
Share

UCN Mail Editorial

The team behind UCN Mail. Writing about deliverability, DNS, and running email on your own domain.

UCN Mail

Professional email for your domain — reliable inboxes for teams of any size, without the hassle.

Best premium mail in

🇦🇫Afghanistan
🇦🇱Albania
🇩🇿Algeria
🇦🇸American Samoa
🇦🇩Andorra
🇦🇴Angola
🇦🇮Anguilla
🇦🇶Antarctica
🇦🇬Antigua and Barbuda
🇦🇷Argentina
🇦🇲Armenia
🇦🇼Aruba
🇦🇺Australia🇦🇹Austria🇦🇿Azerbaijan
🇧🇸Bahamas
🇧🇭Bahrain🇧🇩Bangladesh
🇧🇧Barbados
🇧🇾Belarus🇧🇪Belgium
🇧🇿Belize
🇧🇯Benin
🇧🇲Bermuda
🇧🇹Bhutan
🇧🇴Bolivia, Plurinational State of
🇧🇶Bonaire, Sint Eustatius and Saba
🇧🇦Bosnia and Herzegovina
🇧🇼Botswana
🇧🇻Bouvet Island
🇧🇷Brazil
🇮🇴British Indian Ocean Territory
🇧🇳Brunei Darussalam
🇧🇬Bulgaria
🇧🇫Burkina Faso
🇧🇮Burundi
🇨🇻Cabo Verde
🇰🇭Cambodia
🇨🇲Cameroon
🇨🇦Canada
🇰🇾Cayman Islands
🇨🇫Central African Republic
🇹🇩Chad
🇨🇱Chile
🇨🇳China
🇨🇽Christmas Island
🇨🇨Cocos (Keeling) Islands
🇨🇴Colombia
🇰🇲Comoros
🇨🇬Congo
🇨🇩Congo, The Democratic Republic of the
🇨🇰Cook Islands
🇨🇷Costa Rica
🇭🇷Croatia
🇨🇺Cuba
🇨🇼Curaçao
🇨🇾Cyprus
🇨🇿Czechia
🇨🇮Côte d'Ivoire
🇩🇰Denmark
🇩🇯Djibouti
🇩🇲Dominica
🇩🇴Dominican Republic
🇪🇨Ecuador
🇪🇬Egypt
🇸🇻El Salvador
🇬🇶Equatorial Guinea
🇪🇷Eritrea
🇪🇪Estonia
🇸🇿Eswatini
🇪🇹Ethiopia
🇫🇰Falkland Islands (Malvinas)
🇫🇴Faroe Islands
🇫🇯Fiji
🇫🇮Finland🇫🇷France
🇬🇫French Guiana
🇵🇫French Polynesia
🇹🇫French Southern Territories
🇬🇦Gabon
🇬🇲Gambia
🇬🇪Georgia
🇩🇪Germany
🇬🇭Ghana
🇬🇮Gibraltar
🇬🇷Greece
🇬🇱Greenland
🇬🇩Grenada
🇬🇵Guadeloupe
🇬🇺Guam
🇬🇹Guatemala
🇬🇬Guernsey
🇬🇳Guinea
🇬🇼Guinea-Bissau
🇬🇾Guyana
🇭🇹Haiti
🇭🇲Heard Island and McDonald Islands
🇻🇦Holy See (Vatican City State)
🇭🇳Honduras
🇭🇰Hong Kong🇭🇺Hungary
🇮🇸Iceland
🇮🇳India🇮🇩Indonesia
🇮🇷Iran, Islamic Republic of
🇮🇶Iraq
🇮🇪Ireland
🇮🇲Isle of Man
🇮🇱Israel
🇮🇹Italy
🇯🇲Jamaica
🇯🇵Japan
🇯🇪Jersey
🇯🇴Jordan
🇰🇿Kazakhstan
🇰🇪Kenya
🇰🇮Kiribati
🇰🇵Korea, Democratic People's Republic of
🇰🇷Korea, Republic of
🇰🇼Kuwait
🇰🇬Kyrgyzstan
🇱🇦Lao People's Democratic Republic
🇱🇻Latvia
🇱🇧Lebanon
🇱🇸Lesotho
🇱🇷Liberia
🇱🇾Libya
🇱🇮Liechtenstein
🇱🇹Lithuania
🇱🇺Luxembourg
🇲🇴Macao
🇲🇬Madagascar
🇲🇼Malawi
🇲🇾Malaysia
🇲🇻Maldives
🇲🇱Mali
🇲🇹Malta
🇲🇭Marshall Islands
🇲🇶Martinique
🇲🇷Mauritania
🇲🇺Mauritius
🇾🇹Mayotte
🇲🇽Mexico
🇫🇲Micronesia, Federated States of
🇲🇩Moldova, Republic of
🇲🇨Monaco
🇲🇳Mongolia
🇲🇪Montenegro
🇲🇸Montserrat
🇲🇦Morocco
🇲🇿Mozambique
🇲🇲Myanmar
🇳🇦Namibia
🇳🇷Nauru
🇳🇵Nepal
🇳🇱Netherlands
🇳🇨New Caledonia
🇳🇿New Zealand
🇳🇮Nicaragua
🇳🇪Niger
🇳🇬Nigeria
🇳🇺Niue
🇳🇫Norfolk Island
🇲🇰North Macedonia
🇲🇵Northern Mariana Islands
🇳🇴Norway🇴🇲Oman🇵🇰Pakistan
🇵🇼Palau
🇵🇸Palestine, State of
🇵🇦Panama
🇵🇬Papua New Guinea
🇵🇾Paraguay
🇵🇪Peru
🇵🇭Philippines
🇵🇳Pitcairn
🇵🇱Poland🇵🇹Portugal
🇵🇷Puerto Rico
🇶🇦Qatar🇷🇴Romania🇷🇺Russian Federation
🇷🇼Rwanda
🇷🇪Réunion
🇧🇱Saint Barthélemy
🇸🇭Saint Helena, Ascension and Tristan da Cunha
🇰🇳Saint Kitts and Nevis
🇱🇨Saint Lucia
🇲🇫Saint Martin (French part)
🇵🇲Saint Pierre and Miquelon
🇻🇨Saint Vincent and the Grenadines
🇼🇸Samoa
🇸🇲San Marino
🇸🇹Sao Tome and Principe
🇸🇦Saudi Arabia
🇸🇳Senegal
🇷🇸Serbia
🇸🇨Seychelles
🇸🇱Sierra Leone
🇸🇬Singapore
🇸🇽Sint Maarten (Dutch part)
🇸🇰Slovakia
🇸🇮Slovenia
🇸🇧Solomon Islands
🇸🇴Somalia
🇿🇦South Africa
🇬🇸South Georgia and the South Sandwich Islands
🇸🇸South Sudan
🇪🇸Spain🇱🇰Sri Lanka
🇸🇩Sudan
🇸🇷Suriname
🇸🇯Svalbard and Jan Mayen
🇸🇪Sweden
🇨🇭Switzerland
🇸🇾Syrian Arab Republic
🇹🇼Taiwan, Province of China
🇹🇯Tajikistan
🇹🇿Tanzania, United Republic of
🇹🇭Thailand
🇹🇱Timor-Leste
🇹🇬Togo
🇹🇰Tokelau
🇹🇴Tonga
🇹🇹Trinidad and Tobago
🇹🇳Tunisia
🇹🇲Turkmenistan
🇹🇨Turks and Caicos Islands
🇹🇻Tuvalu
🇹🇷Türkiye
🇺🇬Uganda
🇺🇦Ukraine
🇦🇪United Arab Emirates🇬🇧United Kingdom🇺🇸United States
🇺🇲United States Minor Outlying Islands
🇺🇾Uruguay
🇺🇿Uzbekistan
🇻🇺Vanuatu
🇻🇪Venezuela, Bolivarian Republic of
🇻🇳Viet Nam
🇻🇬Virgin Islands, British
🇻🇮Virgin Islands, U.S.
🇼🇫Wallis and Futuna
🇪🇭Western Sahara
🇾🇪Yemen
🇿🇲Zambia
🇿🇼Zimbabwe
🇦🇽Åland Islands

© 2026 UCN Mail. All rights reserved.

Built by UCN Hub