In Wireshark, a DNS query asks a question and a DNS response reports what the server could return. Expand Domain Name System and check Flags → Response. The bit is 0 in a query and 1 in a response. Then use Response In or Request In to connect the two frames.
Our offline sample asks for an IPv4 address for example.com. Frame 1 asks the question. Frame 2 returns 198.51.100.20 24 milliseconds later. The address and elapsed time come from a synthetic capture made for this example.
Find the Two Frames in Wireshark
Download and open example-dns.pcap, or follow the two frames below. The file contains two UDP packets assembled offline using documentation addresses. The browser or DNS service on your computer takes no part in the exercise.
Download the two-packet DNS practice capture
Enter this expression in the display filter bar above the packet list and press Enter.
dns.qry.name == "example.com" && dns.id == 0x4b2fThe filter keeps both frames visible because both carry the same DNS question and transaction ID. In a larger capture, start with the name and add the ID after you identify a candidate exchange. The ID can repeat, so confirm the endpoints before treating two rows as a pair. In this UDP example, the server and client ports swap sides in the reply.
Scroll horizontally if needed to see the full table.
If the packet list looks unfamiliar, the Wireshark walkthrough explains how it relates to the packet details and bytes panes. In this exercise you will spend most of your time in the middle pane.
Read the Query Before the Answer
Select frame 1 and expand Domain Name System. Under Queries, look for the name and record type. Type A asks for an IPv4 address. AAAA asks for an IPv6 address. A browser may trigger both lookups for the same name, which is one reason to compare the record type when several entries sit close together.
The transaction ID is a value in the DNS header. The resolver echoes it in its response so the client can associate the reply with its outstanding question. Response In, by comparison, is a cross-reference Wireshark computes from the frames it reads.
When the query is selected, the only IP addresses in the network-layer header are the client and server addresses in this observed exchange. The IPv4 address the client asked for belongs in the DNS answer section of the reply.
Read the Status and Answer Separately
Select frame 2. Under Flags, the response bit is set and the reply code is No error. The Answers section contains one A record for example.com. Its value is 198.51.100.20, and its time to live (TTL) is 300 seconds.
The TTL tells a resolver how long it may cache the record. Wireshark's Time field reports how far apart the request and response appeared in this capture. Here that interval is 0.024 seconds. It includes what happened between the two observations at the capture point, so describe it as an observed round trip.
A response can carry zero answers. NXDOMAIN reports that the queried name does not exist according to that response. A No error response with an empty answer section calls for more context. An existing name can lack the requested record type, and a referral can carry information in other sections.
These replies are evidence that a DNS message came back. An empty packet list after applying a name filter calls for a different check.
What if Wireshark Shows Only One Side?
First clear any expression that hides responses. For example, dns.flags.response == 0 shows queries only. Apply dns.flags.response == 1 when you want replies only. A filter for the DNS question and transaction ID makes it easier to see the sequence together.
If the response stays missing, check where and when the packets were collected. The capture may end before the answer arrives. A monitor may see traffic in only one direction. A lost packet, retransmission, or packets on a different interface can complicate the pair.
Some DNS exchanges take place inside encrypted connections. A capture may show the connection while leaving the ordinary DNS question and answer unavailable as packet details. The guide to encrypted traffic in Wireshark shows what can still be observed in that situation.
When saving a narrow view for someone else, keep the input capture and record which frames you used. The PCAP and PCAPNG comparison shows how to check a converted copy against its source.
Record the Finding in One Sentence
A report can say that frame 2 replied to frame 1 for example.com type A, returned 198.51.100.20 with a 300-second TTL, and appeared 24 milliseconds later in this sample. Include the capture name and the transaction ID alongside that note.
This establishes what the client asked and what the resolver reported in the observed exchange. To establish whether the client used the returned address, inspect subsequent traffic for a connection to it and document any other plausible explanation for the connection.