What is a TXT record; how does it differ from the SPF record type?
Short answer
A TXT record attaches free text to a name (RFC 1035); its most common uses are verifying domain ownership (e.g. the verification text given by a cloud service) and e-mail security policies (SPF, DKIM, DMARC). SPF (Sender Policy Framework) is the policy that states which servers can send e-mail on behalf of a domain. A separate record type was defined for SPF in its experimental period; the current standard (RFC 7208) requires the SPF policy to be published only with a TXT record. In TR7 GTM, TXT and SPF are present as separate types in the Record Type list, and in both of them the text is entered into the Text field in the Record cell; the text is written into the record in quotes (record type specific fields). For an SPF policy, the TXT type is selected.
Where It Is Used in TR7
| Where | Field / label | What for |
|---|---|---|
| GTM → GTM Services → service name → Records → Add | Record Type = TXT / SPF | Publishing free text or an e-mail policy |
| Same form, the pencil icon in the Record cell | Text (record type specific fields) | Entering the text; empty text is not accepted |
| Load Balancer → Profiles → Health Checks (DNS) | DNS Record Type = TXT | Checking the DNS server with a TXT query |
| GTM → GTM Services → service name → Dashboard → Query Types | TXT Queries panel | Monitoring the share of TXT queries |
Comparison
| TXT | SPF type | |
|---|---|---|
| Content | Any text | Only an SPF policy |
| Current use | All text records, including SPF | Deprecated; RFC 7208 requires TXT |
| Example | v=spf1 include:_spf.example.net -all | The same policy |
Common Misconceptions
- "An SPF policy must be written with the SPF type." Receiving servers look for the policy in the TXT record; if the policy is published only with the SPF type, it is not taken into account.
- "A TXT record is only for e-mail." It is used for many purposes, such as domain ownership verification.
- "Only a single TXT row can be written for a name." Multiple texts for the same name are entered as separate rows of a single TXT record; however, there must be only one SPF policy (a single text starting with
v=spf1) in a domain.
How it is done in the documentation
