Back to ResourcesEmail News

DNS TXT Record Lookup: dig, nslookup & Online Tools

By Taylor TabusaAugust 9, 2023Updated August 12, 20266 min read

In brief

Look up DNS TXT records with dig, nslookup, PowerShell, or our free online checker. Find and interpret SPF, DKIM, DMARC, BIMI, and verification records.

DNS TXT Record Lookup: dig, nslookup & Online Tools

A DNS TXT record lookup returns the text records published at one exact DNS name. The fastest options are:

  • Browser: enter the hostname in the free DNS lookup tool and select TXT.
  • macOS or Linux: run dig TXT example.com.
  • Windows: run nslookup -type=TXT example.com or Resolve-DnsName -Name example.com -Type TXT in PowerShell.
For email authentication, the hostname matters as much as the record type. SPF is usually published at the sending domain, DMARC at _dmarc.example.com, DKIM at ._domainkey.example.com, and BIMI at default._bimi.example.com. DNS TXT record lookup commands and common email-authentication hostnames

Run a DNS TXT lookup online

Use the Palisade DNS lookup tool when you want the public answer without opening a terminal:

  1. Enter the full hostname you need to inspect, such as _dmarc.example.com.
  2. Select TXT as the record type.
  3. Run the lookup and read each returned string.
  4. Repeat with the exact hostname used by the service or protocol you are troubleshooting.
A lookup reads public DNS. It does not change the domain, prove that a production message was signed correctly, or show a private mailbox provider decision.

DNS TXT lookup commands you can copy

macOS and Linux with dig

Query TXT records at the root domain:

Terminalbash
dig TXT example.com

Return a shorter answer without the surrounding DNS response:

Terminalbash
dig +short TXT example.com

Query the most common email-security TXT records:

Terminalbash
dig +short TXT _dmarc.example.com
dig +short TXT selector1._domainkey.example.com
dig +short TXT default._bimi.example.com
dig +short TXT _smtp._tls.example.com

Replace selector1 with the DKIM selector used by the sending service. A generic DKIM lookup cannot discover every selector; the selector normally comes from the provider's setup instructions or a real message header.

To compare a specific resolver with your default resolver, add its IP address:

Terminalbash
dig +short TXT _dmarc.example.com @1.1.1.1
dig +short TXT _dmarc.example.com @8.8.8.8

Windows with nslookup

Run a one-line TXT query in Command Prompt or PowerShell:

Technical exampletext
nslookup -type=TXT example.com

Query a DMARC hostname through Cloudflare's public resolver:

Technical exampletext
nslookup -type=TXT _dmarc.example.com 1.1.1.1

You can also open the interactive nslookup prompt:

Technical exampletext
nslookup
set type=TXT
_dmarc.example.com

Type exit when you are finished.

Windows with PowerShell

PowerShell returns structured DNS output that is easier to filter or reuse in a script:

POWERSHELLpowershell
Resolve-DnsName -Name example.com -Type TXT

For DMARC:

POWERSHELLpowershell
Resolve-DnsName -Name _dmarc.example.com -Type TXT

If your system resolver appears stale, specify another DNS server:

POWERSHELLpowershell
Resolve-DnsName -Name _dmarc.example.com -Type TXT -Server 1.1.1.1

Which hostname should you query?

RecordTypical hostnameValue usually starts with
SPFexample.comv=spf1
DKIM._domainkey.example.comv=DKIM1 or a public key
DMARC_dmarc.example.comv=DMARC1
BIMIdefault._bimi.example.comv=BIMI1
TLS reporting_smtp._tls.example.comv=TLSRPTv1
Service verificationProvider-specificA token supplied by the provider

The root domain is not a universal shortcut. Querying example.com can reveal SPF and verification tokens, but it will not normally return DMARC, DKIM, or BIMI because those records use dedicated hostnames.

How to read the result

Quoted strings may be one logical record

DNS software can split a long TXT value into several quoted character strings. Tools may display an SPF or DKIM record as two adjacent quoted sections even though DNS returns one logical TXT record. Join the strings in order before interpreting the value.

An empty answer is different from an error

  • No TXT answer: the hostname resolves, but no TXT record is published there.
  • NXDOMAIN: the queried hostname does not exist.
  • SERVFAIL: the resolver could not complete the lookup, often because of a DNS or DNSSEC problem.
  • Timeout: the resolver or network did not answer in time.
Check the exact hostname before assuming a record is missing.

TTL explains part of propagation

The time to live (TTL) tells recursive resolvers how long they may cache an answer. After you change a TXT record, one resolver can show the new value while another still serves the cached value. Compare more than one public resolver and the authoritative nameserver before declaring propagation complete.

Use the DNS propagation guide for a step-by-step comparison.

How to interpret email-authentication TXT records

SPF

An SPF record starts with v=spf1 and lists mechanisms that authorize sending infrastructure. A domain must not publish multiple SPF records at the same hostname; use the SPF checker to inspect syntax and the DNS-lookup chain.

DKIM

A DKIM record is tied to a selector. The query name looks like selector._domainkey.example.com. DNS can show the published public key, but only a real signed message proves which selector and signing domain the production stream used. The DKIM checker is useful once you know the selector.

DMARC

A DMARC record starts with v=DMARC1 and is published at _dmarc.example.com. Read the p= policy, reporting addresses, and alignment tags. The DMARC checker validates the public record and explains each state.

BIMI

A BIMI record starts with v=BIMI1 and is normally published at default._bimi.example.com. It points to the logo and, when used, certificate evidence. Use the BIMI checker to validate the public record, but remember that each mailbox provider applies its own display criteria.

Troubleshoot a TXT record that is missing or stale

Work through these checks in order:

  1. Confirm the full hostname. _dmarc, _domainkey, and _bimi are not interchangeable.
  2. Check the provider's host-field convention. Some DNS panels want only _dmarc; others want _dmarc.example.com. Entering the full domain when the panel appends it automatically can create _dmarc.example.com.example.com.
  3. Check authoritative DNS. Make sure you edited the DNS zone used by the domain's current nameservers, not an old registrar panel.
  4. Compare resolvers. Query your default resolver, 1.1.1.1, and 8.8.8.8.
  5. Wait out the previous TTL. Lowering the TTL after a change does not erase answers already cached under the old TTL.
  6. Look for duplicates. Multiple SPF or DMARC records at the same hostname can invalidate evaluation even though the lookup returns text.
  7. Preserve exact punctuation. Missing semicolons, smart quotes, copied line breaks, or an incorrect hostname can make a record unusable.

Check the full public email-security posture

Use the Email Security Score when you want one public-domain assessment across DMARC, SPF, DKIM, BIMI, MX, MTA-STS, and TLS-RPT. It is a point-in-time DNS assessment, not continuous monitoring or proof of inbox placement.

Questions readers ask

Frequently asked questions

Look up the published DNS answer before changing it

Enter your domain and record.

Check DNS record

Share this article

Taylor Tabusa

Written by

Taylor Tabusa

Co-Founder & Head of Business Development, Palisade

Taylor Tabusa is the co-founder and Head of Business Development at Palisade, helping managed service providers turn email security into a practical, valuable service.

More from Taylor

Related articles