DNS & Setup

What Is a TXT Record and Why Does Email Depend on It?

A TXT record stores text in DNS, and email relies on it for SPF, DKIM, DMARC and verification. Learn what a TXT record is and how to add one correctly.

A TXT record is a DNS record type that holds arbitrary text attached to a hostname. It was designed for human notes but became the standard place to publish machine-readable email policies. SPF, DKIM, DMARC, MTA-STS discovery and most domain ownership checks all live in TXT records, which is why email setup is mostly a matter of adding TXT entries correctly.

Quick summary

  • SPF at the root (@): v=spf1 MX (Mail Exchanger — where incoming email is delivered) a:mail.oqumail.com ~all
  • DKIM at selector._domainkey: v=DKIM1; k=rsa; p=… (the exact key is shown in your OquMail dashboard)
  • DMARC at _dmarc: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
  • MTA-STS discovery at _mta-sts: v=STSv1; id=20260701
  • TLS reporting at _smtp._tls: v=TLSRPTv1; rua=mailto:tls@yourdomain.com

How a TXT record works

Each TXT record has a host (the name it is attached to) and one or more quoted strings as its value. A resolver that queries TXT for a name gets back every TXT record at that name. Email software then scans those strings for the prefix it cares about: v=spf1 for SPF, v=DKIM1 for DKIM, v=DMARC1 for DMARC. Unrelated TXT records at the same name are ignored, so a Google Site Verification string can happily sit next to your SPF.

The TXT records email setup uses

  • SPF at the root (@): v=spf1 MX (Mail Exchanger — where incoming email is delivered) a:mail.oqumail.com ~all
  • DKIM at selector._domainkey: v=DKIM1; k=rsa; p=… (the exact key is shown in your OquMail dashboard)
  • DMARC at _dmarc: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
  • MTA-STS discovery at _mta-sts: v=STSv1; id=20260701
  • TLS reporting at _smtp._tls: v=TLSRPTv1; rua=mailto:tls@yourdomain.com
  • Ownership checks such as google-site-verification=... or a provider-specific token

Example TXT record as a DNS panel shows it

Type:   TXT
Host:   _dmarc
Value:  v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com
TTL:    3600

The 255 character rule

A single TXT string cannot exceed 255 characters, but a record can contain several strings that receivers join together. This matters for 2048-bit DKIM keys, which are around 400 characters. Some panels split the value automatically; others require you to paste it as "part one" "part two" with quotes. If your panel refuses a long value, that is the reason, not a problem with the key.

How to check a TXT record

  1. Run nslookup -type=txt yourdomain.com (Windows) or dig txt yourdomain.com (macOS, Linux). Add the subdomain for _dmarc or the DKIM selector.
  2. Look for the exact string you published. Extra quotes in the output are normal.
  3. Use Google Admin Toolbox Dig or MXToolbox if you prefer a browser.
  4. In OquMail, press Check DNS. Each TXT records (short text lines in DNS used for email security) is verified individually and shown green or red with the value that was actually found.

Common TXT record mistakes

  • Typing the full domain in the host field when the panel appends it automatically, producing _dmarc.yourdomain.com.yourdomain.com.
  • Wrapping the value in extra quotes in panels that already add them.
  • Creating a second SPF record instead of editing the existing one. Two SPF records equals PermError.
  • Choosing the deprecated SPF record type where offered. Only TXT is read.
  • Adding a trailing space or a smart quote copied from a document.

TXT records and OquMail

OquMail shows the three TXT values for your domain with the host already in the short form most panels expect, and validates each one live. If you are unsure whether your panel wants @ or the full domain, add the record, press Check DNS, and adjust if it shows red. Once SPF, DKIM and DMARC are green, all mailboxes on the domain send authenticated mail.

Common questions

Can I have multiple TXT records on the same host?

Yes, and it is normal. The limit is one SPF and one DMARC policy per name, but verification tokens and other strings can coexist.

Why does my TXT record show with quotes in dig?

DNS tools display each string in quotes to show boundaries. The quotes are not part of the data your panel expects you to type, unless it says so.

Is a TXT record the same as an SPF record?

SPF is a policy that happens to be published inside a TXT records (short text lines in DNS used for email security). Every SPF record is a TXT record, but not every TXT record is SPF.

Free business email on your own domain

OquMail gives you up to 15 mailboxes on your domain — free — with guided SPF/DKIM/DMARC, webmail, IMAP/SMTP for any mail app, and a send API. Most teams are live in under fifteen minutes. Start at oqumail.com.

Get started free

Ready for business email on your domain?

Up to 15 free mailboxes, guided DNS, webmail, and a transactional API — start in minutes.

Create your free workspace