Skip to main content

DNS Setup

How to Add a TXT Record Without Formatting Mistakes

TXT records handle domain ownership verification, SPF, and DKIM — and small formatting slips in the host field or quoting are what usually break them.

3 Uses

Verification, SPF, and DKIM all rely on TXT records

250+

Characters a DKIM TXT value can commonly run to

24/7

Human support for TXT record formatting issues

Free

DNS management included with hosting

In short

To add a TXT record: open the DNS zone editor, choose TXT as the record type, enter the exact host the verification or email service specifies (often @ for the root, or a prefixed subdomain like _dmarc or selector._domainkey for DKIM), paste the value exactly as given, and save. Most panels handle quoting automatically, but some require the value wrapped in double quotes manually.

The two most common failure points are entering the host incorrectly (adding the full domain name when only a subdomain prefix was needed) and truncating a long SPF or DKIM value, since these can run well past 250 characters and get cut off if pasted incompletely.

A TXT record holds arbitrary text data attached to a hostname, and while it wasn't originally designed for any one purpose, it's become the default way services prove a domain is genuinely controlled by whoever claims it, and the backbone of email authentication standards like SPF and DKIM.

This guide covers the three situations a site owner runs into a TXT record most often — site verification for tools like Search Console, SPF for email sending authorization, and DKIM for cryptographic email signing — along with the specific formatting details that trip people up in each case.

TXT Records for Domain Ownership Verification

Services like Google Search Console, Microsoft 365, or a marketing platform often offer a DNS TXT verification method as an alternative to an HTML file upload or meta tag. The service generates a unique string (something like google-site-verification=abc123...) and asks for it to be added as a TXT record, typically on the root host (@).

Once added, the service checks whether that exact TXT record exists on the domain, and if it does, ownership is considered proven since only someone with real DNS access could have added it. This method has the advantage of surviving a full website rebuild, since it lives in DNS rather than on the site's files.

Getting the Host Field Right

The host field is where most TXT record mistakes happen. A verification record almost always goes on @ (the root), while an SPF record also typically belongs on @ since it governs the whole domain's outgoing mail. DKIM, by contrast, uses a specific selector prefix supplied by the email provider, such as selector1._domainkey or google._domainkey, which must be entered exactly as given rather than guessed.

A frequent error is typing the full domain name into the host field when the panel already appends it automatically — entering 'selector._domainkey.yourdomain.com' in a field that only expects 'selector._domainkey' results in a record on the wrong, doubled-up hostname that the intended lookup will never find.

SPF: Authorizing Who Can Send Email as Your Domain

An SPF (Sender Policy Framework) record is a specifically formatted TXT value starting with v=spf1, listing which mail servers are authorized to send email on behalf of the domain, and ending with a policy like ~all or -all describing what to do about anything not listed. A typical SPF record might read v=spf1 include:_spf.example.com ~all.

A domain can only have one SPF record — if two exist (say, one added by a hosting provider and another by a marketing tool, each unaware of the other), mail servers checking SPF often treat that as invalid entirely, which can hurt deliverability rather than help it. Merging multiple services into a single SPF line using additional include: statements is the correct fix.

DKIM: Cryptographically Signing Outgoing Mail

DKIM (DomainKeys Identified Mail) works by publishing a public cryptographic key as a TXT record at a selector-prefixed host, while the sending mail server holds the matching private key and signs each outgoing message. Receiving mail servers look up the public key via DNS and confirm the signature matches, proving the message wasn't altered in transit and genuinely came from an authorized sender.

DKIM values are long strings of what looks like random characters, often exceeding what a single DNS TXT entry technically allows in one unbroken chunk — some panels handle this by automatically splitting the value across multiple quoted strings that resolvers reassemble. Pasting the full value exactly as the email provider gives it, without adding line breaks manually, avoids breaking that structure.

How to Add a TXT Record for Verification

TXT Records That Save Correctly the First Time

Hosting Cheap's DNS panel handles TXT record quoting and long DKIM values without requiring manual formatting tricks, so pasting a verification string or an SPF line saves cleanly.

24/7 human support is available for the trickier cases — an SPF conflict between two mail-sending services, or a DKIM selector that isn't quite matching what a provider expects — rather than leaving deliverability to guesswork.

  • DNS panel that handles TXT quoting and long DKIM values automatically
  • 24/7 human support for SPF conflicts and DKIM selector issues
  • Free managed migration that preserves existing verification and email records
  • Free auto-renewing SSL alongside a properly authenticated email setup

Why Hosting Cheap

What you get

Simple TXT Record Editor

Add verification, SPF, or DKIM values without manual quoting workarounds.

24/7 Human Support

Get help resolving an SPF conflict or a DKIM record that won't validate.

Free Managed Migration

Existing verification and email authentication TXT records move over intact.

Free Auto-Renewing SSL

Pairs with a properly authenticated domain for trustworthy email and web traffic.

Daily Backups

A safety net while editing DNS records tied to email deliverability.

Pure NVMe SSD + LiteSpeed

Fast mail and web response times once every TXT record is correctly authenticated.

How It Works

Get set up in a few steps

1

Get the exact TXT value and host

Copy the verification string, SPF line, or DKIM key precisely as the service or email provider supplies it.

2

Enter it in the correct host field

Use @ for verification and SPF, or the exact selector prefix given for DKIM, without duplicating the domain name.

3

Save and confirm with a DNS lookup

Check that the TXT record resolves with the expected value before relying on the service or email flow.

Included

Everything you need, on every plan

  • TXT value copied exactly, without truncation or added line breaks
  • Host field set correctly for verification (@), SPF (@), or DKIM (selector prefix)
  • Domain name not duplicated in the host field if the panel appends it automatically
  • Only one SPF record exists per domain, merged via include: if multiple services are used
  • DKIM selector matches exactly what the email provider specifies
  • Record confirmed live with a DNS lookup tool before relying on it
  • Verification re-checked in the requesting service after the record is saved

FAQ

Frequently asked questions

What host do I use for a domain verification TXT record?

Almost always @, representing the root domain itself, unless the service explicitly specifies a different subdomain. The verification string itself is pasted as the record's value.

Can I have more than one TXT record on the same host?

Yes, a host can carry multiple TXT records for different purposes, such as one for site verification and a separate one for SPF. The exception is SPF specifically, which should only have one combined record per domain rather than multiple competing ones.

Why isn't my DKIM record validating?

This is usually caused by an incorrect selector in the host field, a truncated or altered public key value, or the record simply not having propagated yet. Comparing the saved record character-for-character against what the email provider issued is the fastest way to find the mismatch.

Do I need quotes around a TXT record value?

Most modern DNS panels add the required quotes automatically when a TXT record is saved, but some older interfaces expect the value wrapped in double quotes manually. Checking how the saved record displays afterward confirms which behavior applies.

How long does a new TXT record take to work?

It depends on the record's TTL and how quickly resolvers refresh their cache, but verification and email checks typically succeed within minutes to a few hours after saving. Waiting a bit and retrying the verification step is normal if it fails immediately.

What happens if I have two SPF records by mistake?

Many mail servers treat multiple SPF records on the same domain as invalid entirely, which can cause legitimate email to fail authentication and land in spam. Combining every authorized sender into a single SPF record with multiple include statements fixes this.

Get DNS and Email Authentication Right the First Time

A clear TXT record editor and 24/7 human support keep verification, SPF, and DKIM from breaking on a formatting slip.

Get Started