[ DNS & domains ]

Use dig to inspect authentication records and delegation

Use explicit dig queries to compare authentication records, server responses and delegation. Preserve evidence without confusing lookup success with mail success.

By the EmailAuth research team · 6 min read

[ Key points ]

  • Use sender evidence to choose the SPF domain or DKIM selector.
  • Pin the tool scope and retain full responses before shortening output.
  • Verify authority before interpreting a nonrecursive comparison.
  • Keep trace, transport and DNSSEC claims narrower than end-to-end validation.
On this page

Turn a lookup into a precise question

Use dig to ask a named DNS server about an exact owner and record type, then retain enough context to interpret the reply. For email authentication, the central question is rarely whether a domain has any TXT records. It is whether the dependency used by the sender or verifier exists at the correct name and can be resolved through the relevant path.

Examples in this guide target the documented syntax of ISC BIND 9.20.13 dig. That is a pinned documentation scope, not a claim that every installed dig has that version or that it is the newest release. All commands are proposed read-only DNS queries or a local version check. None has been executed here. The example.com names and 192.0.2.0/24 addresses are documentation placeholders, not a working resolver setup.

Start with the identity that email actually uses

For SPF, identify the domain used in the relevant SMTP identity rather than automatically using the visible From domain. For DKIM, take the signing domain and selector from the message's signature. The key lookup owner combines the selector, _domainkey and signing domain. Do not guess a selector from a vendor's name. RFC 7208 RFC 6376

A lookup of _dmarc.example.com. can inspect a policy record at that owner. It is not by itself a complete implementation of policy discovery or an alignment evaluation. Preserve the message identity and applicable policy-discovery context when handing results to a mail specialist. DNS visibility and authentication outcome belong in related but separate evidence fields. RFC 9989

Write a question sheet with owner, type, reason for the query and expected authority. This small preparation prevents an attractive-looking answer for the wrong domain from being accepted as a fix. A trailing period makes the examples' names explicit absolute DNS names.

Make the initial query reproducible

The proposed local command dig -v records the tool version. For a controlled query shape, use dig -r @192.0.2.53 _dmarc.example.com. TXT. The -r option avoids per-user dig defaults, while the server argument identifies the DNS server. Replace both placeholders only for a separately authorized lookup. Retain the complete output before making a compact extract. ISC dig manual

Record UTC time, source network context and the server actually reported in the result. Avoid beginning with a command that hides everything except answers. A short answer-only view may be convenient later, but the initial evidence should preserve the question, status, flags, answer and authority sections, plus transport-related messages. Those details distinguish absence, a referral and failure.

Suggested companion questions are dig -r @192.0.2.53 example.com. TXT and dig -r @192.0.2.53 selector1._domainkey.example.com. TXT. These are syntax examples, not a claim that either name has an authentication record. Select the actual names from the approved investigation, and never treat an ANY query as a guaranteed inventory of everything in a zone.

Compare recursive and authoritative observations

First establish which server you queried. A recursive resolver can return cached data; an authoritative server answers for zones it serves. To compare with a separately verified authority, the proposed form is dig -r @192.0.2.54 _dmarc.example.com. TXT +norecurse. Disabling recursion does not make an arbitrary server authoritative. Check the response and the delegation evidence rather than trusting the chosen IP address alone. RFC 1034

If the recursive and authoritative results disagree, keep both. Compare names, types, values, response status and timestamps before blaming propagation. A decreasing cached TTL is informative but is not a universal expiry deadline for every observer. A negative cache entry also follows its own rules. RFC 2308

Read the answer structurally. Several quoted character strings can belong to one TXT resource record; several TXT resource records are a different condition. Do not flatten both forms into one space-separated string. Preserve record boundaries before the mail specialist evaluates SPF or DKIM syntax. A CNAME introduces another name to investigate rather than proving that the final key or policy text is available. RFC 1035

Trace delegation only when that is the question

The proposed query dig -r +trace example.com. NS follows referrals from the root. It sends multiple network queries, so approve the diagnostic scope accordingly. Adding a server argument does not keep the whole trace confined to that resolver. A trace investigates delegation from the operator's network; it does not reproduce every decision made by a remote email receiver. ISC dig manual

When reviewing a trace, identify the last successful referral, the contacted servers and where resolution stopped. A timeout at one stage is not permission to edit nameservers. Compare the finding with the registrar and DNS owner's inventory, then assign the next investigation to the appropriate owner. Avoid turning one incomplete trace into a migration recommendation.

Keep failure and validation claims narrow

NXDOMAIN, a successful response without the requested data, and SERVFAIL need different next steps. Do not translate all three into missing authentication records. If transport is suspected, a proposed +tcp comparison can help separate paths, but success over one transport does not prove that every receiver can resolve the record. RFC 1035 RFC 7766

The dig +dnssec option requests DNSSEC material; its presence is not a standalone cryptographic validation result. Keep validation conclusions tied to appropriate resolver behavior and trusted evidence. Finish the investigation with a concise statement of which server answered which question, when, and what remains uncertain. The timestamped authoritative and recursive transcripts required for this article are still missing; these proposed commands are not substitutes for them.

[ Takeaway ]

Keep the exact owner, type, server and full response together. Commands and screenshots without context cannot establish an authentication outcome.

[ By role ]

What this means for you

Choose your role for practical next steps.

DNS engineer

Preserve server and response semantics

The engineer’s job is to make each conclusion traceable to a specific question and vantage point. Short extracts should remain linked to their complete underlying responses.

Next steps

  1. Record dig version, server, source context and UTC time.
  2. Verify authority before the nonrecursive comparison.
  3. Keep timeout, referral, NODATA and SERVFAIL branches distinct.

Deliverability analyst

Connect the query to the message

A technically correct lookup can concern the wrong identity. Use message evidence to choose the dependency and limit the conclusion to what DNS actually establishes.

Next steps

  1. Extract the relevant SPF identity or DKIM domain and selector.
  2. Preserve TXT record boundaries when sharing results.
  3. Require receiver evidence before claiming authentication or delivery success.

Incident coordinator

Bound the next diagnostic step

A trace or transport difference can justify further investigation without justifying a DNS edit. Assign the unresolved layer to the right owner and keep the evidence chronology intact.

Next steps

  1. State the last confirmed successful question or referral.
  2. Identify whether the next action is a query or a modifying change.
  3. Request separately authorized follow-up evidence rather than inferred repair commands.

[ FAQs ]

Frequently asked questions

Why do these examples include dig -r?

In the pinned BIND 9.20.13 documentation, -r prevents reading per-user defaults from .digrc. That improves reproducibility but does not fix the server, network or query identity. Record those separately.

Which DKIM selector should I query?

Use the selector and signing domain from the relevant DKIM signature or approved sender configuration. A domain can have several selectors, and guessing a vendor-related name can inspect the wrong dependency. Preserve the identity source with the query.

Does +norecurse make the answer authoritative?

No. It changes the request’s recursion setting, not the server’s role. Establish the intended authority from delegation evidence and inspect the reply. A server that is not authoritative can return a referral, cached information or a failure.

Should I use ANY to collect all authentication records?

Do not use it as a complete inventory. Ask for the types and exact owners relevant to the mail identity, and use an authorized provider inventory when you need zone contents. A broad-looking query is not evidence that no other selectors or records exist.

Are two quoted strings the same as two TXT records?

No. One TXT record can contain multiple character strings. Keep that structure distinct from multiple resource records at the same owner before evaluating the authentication data. A flattened support extract can conceal the difference.

Does +trace reproduce a receiver’s lookup?

No. It follows delegation from the operator’s network. Its purpose is to inspect that path, not a remote receiver’s cache, validation policy or application behavior. Retain where it stopped and avoid treating one trace as a universal view.

Does requesting DNSSEC records validate the domain?

No. The dig +dnssec option requests DNSSEC material. A validation claim needs an appropriate validation process and trustworthy evidence. Do not label an answer secure solely because a query included that option.

What should I do when UDP and TCP results differ?

Preserve both questions, destinations, timestamps and full responses. Escalate the transport difference without changing authentication records to compensate. One successful path is not proof of reachability from every receiver. The examples here have not been executed.

[ Sources ]

Sources

  1. ISC BIND 9.20.13 manual pages: dig
  2. RFC 1034: Domain names: concepts and facilities
  3. RFC 1035: Domain names: implementation and specification
  4. RFC 2308: Negative Caching of DNS Queries
  5. RFC 6376: DomainKeys Identified Mail Signatures
  6. RFC 7208: Sender Policy Framework for Authorizing Use of Domains in Email
  7. RFC 7766: DNS Transport over TCP: Implementation Requirements
  8. RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance

[ Glossary ]

Glossary

Absolute owner name
A fully specified DNS name ending at the root, shown with a trailing period in these examples.
Recursion desired
A DNS request flag asking the server to pursue resolution; changing it does not change the server’s authority.
Referral
A DNS response directing resolution toward other name servers rather than supplying the final requested data.
TXT character string
One component of TXT record data; several strings can belong to one TXT resource record.
Diagnostic transcript
A retained record of the actual command, execution context, observation time and complete output; proposed commands are not transcripts.

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base