RTFM_ security field notes

DNS: names, zones and responses

Query a specific resolver, distinguish record types and interpret DNS failures before pursuing a service.

DNS commonly uses both UDP and TCP 53. A domain is a branch of the name tree; a zone is an authoritative portion of that tree, excluding delegated child zones. Query the resolver or authoritative server relevant to the network view being assessed.

Query a known server

DNS_SERVER='192.0.2.53'
dig -r @"$DNS_SERVER" app.example.org. A +time=2 +tries=1
dig -r @"$DNS_SERVER" app.example.org. AAAA +time=2 +tries=1
dig -r @"$DNS_SERVER" -x 192.0.2.20 +time=2 +tries=1

-r ignores .digrc; the trailing dot makes the name absolute. Keep the full response while diagnosing: +short hides status and authority information. A PTR record is a reverse-DNS name, not proof of ownership or of a matching forward record. Internal and external resolvers can legitimately return different answers.

Interpret the response

  • NOERROR with an answer: inspect its type, TTL and any CNAME chain.
  • NOERROR without the requested data: may be a NODATA answer or a referral; inspect the authority section and flags before concluding absence.
  • NXDOMAIN: the server reports that the queried name does not exist in this view; this does not mean the corresponding machine is offline.
  • REFUSED: the server declined the operation, often because of policy.
  • SERVFAIL: resolution failed; upstream or DNSSEC problems are possible.
  • Timeout: no usable response arrived; distinguish routing, filtering and transport failure from a negative DNS answer.

To compare TCP behavior, repeat the selected query with +tcp. A truncated UDP response normally makes dig retry over TCP; +tries=1 is not a universal one-packet budget. +dnssec requests DNSSEC records but does not make dig independently validate the chain.

Find a zone or service

dig -r @"$DNS_SERVER" example.org. SOA +time=2 +tries=1
dig -r @"$DNS_SERVER" example.org. NS +time=2 +tries=1
# AD locator records, when the AD DNS domain is known
dig -r @"$DNS_SERVER" _ldap._tcp.dc._msdcs.example.org. SRV +time=2 +tries=1

An SRV record advertises a host and port; check reachability separately, then continue with LDAP. Do not treat ANY as a complete record inventory.

Zone transfer

Against a known authoritative server, AXFR requests the contents of one zone:

dig -r @192.0.2.53 example.org. AXFR +time=3 +tries=1

A successful transfer discloses that zone’s records, not all delegated zones or every host. Whether access is inappropriate depends on the intended transfer policy. A refusal from one server does not establish the policy on all others.

Sources

BIND dig manual, reviewed 2026-11-24. Examples use reserved documentation names and addresses.

Provenance and confidence
Version
1
Sources reviewed
2026-11-24
Confidence
medium — dig syntax and response-handling guidance reviewed against the BIND manual on 2026-11-24; no remote DNS service tested.

Also searched as: dns, 53/udp, 53/tcp, résolution DNS, zone DNS, transfert de zone, axfr