TXT Record
DNS record for arbitrary text, used for SPF, DKIM and verification.
A TXT record is a DNS record type that stores free-form text associated with a domain. It was originally intended for human-readable notes, but today it carries most of the metadata that email and cloud services rely on: SPF policies, DMARC policies at _dmarc.example.com, DKIM public keys at selector._domainkey.example.com, ACME challenges for TLS certificate issuance at _acme-challenge.example.com, and the ownership-verification tokens used by Google, Microsoft 365, AWS and similar providers.
At the wire-format level, the value is stored as one or more strings of up to 255 characters each. Longer values — common for 2048-bit DKIM keys — are split into multiple quoted strings inside the same record, which the resolver concatenates before returning the value to the application. Tooling usually hides this detail, but a hand-edited zone file must respect the quoting rules or the record will fail to load.
A single hostname can hold several TXT records at the same time. Receivers that look up SPF, for example, expect to find exactly one v=spf1 string in the returned set; multiple SPF strings on the same name are a misconfiguration and cause a permanent error. Ownership-verification tokens, by contrast, coexist safely with other TXT data.
Because TXT answers can grow large, oversize responses used to be truncated over UDP and force resolvers to retry over TCP. Modern resolvers negotiate larger UDP payloads via EDNS(0), but very large TXT sets can still cause fragmentation issues on poorly configured networks.
TXT records are queried through the same resolution path as MX and other records, which means they inherit DNS caching and TTL behaviour — useful to keep in mind when rotating a DKIM selector or rolling out a new DMARC policy.
Key Points
- Stores text data in DNS
- Used for SPF, DKIM and DMARC
- Common in domain verification
- Can be used by security systems
- Supported by modern DNS systems