This article explains the difference between SPF records and TXT records in DNS.
It applies when configuring email authentication or reviewing DNS record types in UltraDNS.
When to Use This Article
- You are configuring Sender Policy Framework (SPF).
- You are unsure whether to create an SPF record or a TXT record.
- You are troubleshooting email authentication issues.
What Is an SPF Record?
An SPF record defines which mail servers are authorized to send email on behalf of a domain.
It helps receiving mail servers determine whether a message is legitimate or potentially spoofed.
What Is a TXT Record?
A TXT record is a general-purpose DNS record type used to store text-based information.
TXT records are commonly used for SPF, DKIM, DMARC, and other verification or authentication mechanisms.
How SPF Is Typically Configured Today
Historically, SPF could be published as a dedicated SPF record type.
However, modern implementations publish SPF policies using TXT records.
For compatibility and standards compliance, SPF should be created as a TXT record containing the SPF policy string.
Verification
After creating the TXT record, use a DNS lookup tool such as dig to confirm that the record returns the expected SPF string.
Ensure the syntax follows SPF standards.
Important Notes
- SPF records should be published as TXT records.
- Only one SPF policy record should exist per domain.
- Incorrect SPF syntax can cause email delivery issues.