DNSUnit 3 of 4
Foundations32 minIn reviewreview

DNS tools and Wireshark inspection

Use DNS commands deliberately and learn how to inspect a query and response in Wireshark.

What you will learn
  • Choose a DNS command for the observation you need.
  • Locate a controlled DNS query and response in the real Wireshark interface.
Know this first
  • DNS
  • Command
  • Packet
  • Network interface
Start this unit
Last verifiedReview every 90 days
On this page

Choose the command for the question

EnvironmentCommandBest first observation
Windows CMDnslookup example.testResolver used and returned answer
Windows CMDipconfig /displaydnsWindows DNS client cache
Windows CMDipconfig /flushdnsClear that local client cache
PowerShellResolve-DnsName example.test -Type ATyped DNS result as objects
PowerShellGet-DnsClientCacheLocal cache entries
PowerShellClear-DnsClientCacheClear the local cache; success has no output
Linux/BIND toolsdig example.test AHeader and DNS message sections
Linux/BIND toolshost -t AAAA example.testCompact typed lookup

In the simulator, these forms operate only on controlled virtual state. The values use reserved documentation namespaces and ranges.

TRY IT HERE

Ask for two DNS record types and compare the answers.

Deterministic simulator: no real shell, network or access to your files.

Suggested sequence

$ …

What happened: The resolver stays 192.0.2.53 while A and AAAA return different address families.

What Wireshark is

Wireshark is a protocol analyzer. A packet capture is a recorded set of packets observed at a selected capture interface. It is not a complete record of every packet in the network: placement, interface choice, capture settings, encryption and packet loss all affect what you can see.

The current Wireshark User's Guide describes three main packet views:

  1. Packet list — one summary row per captured packet.
  2. Packet details — decoded protocol fields for the selected packet.
  3. Packet bytes — the captured bytes corresponding to the selected data.

Capture filter is not display filter

A capture filter limits which packets are recorded. A display filter selects which already captured packets are shown. For a capture that already exists, dns is a Wireshark display filter for decoded DNS protocol traffic. Do not paste capture-filter syntax into the display-filter bar and assume it is equivalent.

Inspect a DNS exchange

  1. Select the correct capture interface before capture.
  2. Generate one deliberate DNS lookup.
  3. Stop the capture so the evidence set stops changing.
  4. Apply the display filter dns.
  5. Select the query and expand its DNS details: transaction ID, flags, question name and query type.
  6. Select the matching response and compare transaction ID, response flag, answer type, value and TTL.
  7. Keep transport details separate from DNS meaning. A packet may use UDP or TCP; the DNS fields still describe the question and answer.

See the real interface

A controlled DNS exchange in WiresharkWireshark 4.6.8 / macOS / 2026-09-21
  1. 1Display filter: dns
  2. 2Packet list: query and response
  3. 3Packet details: decoded fields
  4. 4Packet bytes: captured data

Real Wireshark 4.6.8 screenshot on macOS. The trace uses reserved documentation addresses and no production traffic.

The screenshot is evidence of the actual software interface in Wireshark 4.6.8 on macOS. The numbered explanations are localized HTML, so the raster is not altered or mistaken for a generated UI. Select the query row to inspect the question; select the response row to inspect the answer and TTL.

Next stepDiagnose before you flush

Separate resolver, cache, answer, transport and application failures.