Learn how Wireshark’s DNS display filters reveal A-record traffic and related CNAME steps. Record type 1 marks A queries, while type 5 marks CNAMEs—useful clues when following how a hostname resolves to an IPv4 address across a DNS exchange.

Multiple Choice

Which display filter shows only DNS A record queries and their responses?

DNS uses numeric codes to identify the type of records in a query or response. An A record has code 1 and a CNAME has code 5. When tracing how a hostname resolves to an IPv4 address, you may encounter both an A query and CNAME-related steps in the same exchange. Filtering on both codes ensures you see the A-resolution path and any CNAME-related pieces that can appear as part of that process, giving you a complete view of the flow. Filtering only on the A code would miss the CNAME steps that can accompany or precede the final A result, while filtering only on the CNAME code would miss the actual A queries. The remaining option that includes both 1 and 5 best captures the relevant DNS exchanges for A-record resolution.

Reading DNS A and CNAME Traffic in Wireshark

A hostname can look simple on the surface: type it into a browser, and a page appears. Behind that moment, DNS may send several messages to turn the name into an IP address. Wireshark makes those exchanges visible, but the right display filter matters. If you’re tracing IPv4 name resolution, A records are central—and CNAME records may be part of the story too.

The filter dns.qry.type in (1, 5) can help show DNS messages whose query type is A or CNAME. The numbers are DNS type codes: 1 means A, and 5 means CNAME. Used thoughtfully, this filter can make it easier to follow a resolution path without filling the packet list with unrelated DNS traffic.

A quick look at DNS record types

A DNS query asks for information about a name. Its record type tells the resolver what kind of information it wants.

An A record maps a hostname to an IPv4 address. For example, a query for www.example.net might ask for its A record and receive an address such as 192.0.2.25. An AAAA record, by contrast, maps a hostname to an IPv6 address. A CNAME record says that one hostname is an alias for another.

These records can work together. A user-facing name might point to an alias, which then resolves to an IPv4 address. Picture a parcel being sent through a forwarding address: the first name doesn’t provide the destination itself, but it directs the lookup to another name. That’s the basic role a CNAME can play.

What dns.qry.type in (1, 5) shows

Wireshark’s display filter dns.qry.type in (1, 5) matches DNS messages with a query type of 1 or 5. In plain terms, it looks for A-type and CNAME-type questions.

That can be useful when examining a sequence of DNS exchanges. You may see a client ask for an A record, receive a response that includes an alias, and then see another lookup related to that alias. Keeping both types in view can help reveal how the resolution unfolded.

The filter also includes responses to matching queries when those packets carry the corresponding query fields. So, it can show both sides of many A and CNAME exchanges—not just the initial request. Still, it’s worth knowing what the filter checks: dns.qry.type refers to the type requested in the DNS question, not necessarily the type of every record carried in the answer.

That detail matters. Suppose a client asks for an A record, and the DNS response provides a CNAME as part of the answer. The response’s query type is still A: the client asked for an A lookup, even though the answer includes a CNAME record. The filter can match that response because its question has type 1.

Query type isn’t the same as answer type

DNS packets contain several kinds of information, and Wireshark exposes them through different fields. It’s easy to mix up the question’s requested type with the record types found in the response.

  • dns.qry.type identifies the type asked for in the DNS question.

  • dns.resp.type identifies the type of a resource record in the response.

So, if the goal is to find A and CNAME queries, dns.qry.type in (1, 5) is a natural filter. If the goal is to find A and CNAME records in DNS responses, a filter based on dns.resp.type is more directly relevant, such as dns.resp.type in (1, 5).

The distinction is a bit like reading a restaurant order and the meal that arrives. The order says what was requested; the plate shows what was served. Often they match, but not always—and DNS aliases are one reason they may differ.

Why include CNAME traffic?

Filtering only for A queries with dns.qry.type == 1 is a good choice when you want to focus narrowly on IPv4 lookups. It can also show a response to an A query that contains a CNAME answer, because the response is tied to that A question.

Including type 5 broadens the view to messages where the client specifically asks for CNAME information. That may help when you’re following a chain of aliases or investigating how a name points to another name. But it doesn’t mean every CNAME answer will appear only under type 5. A CNAME can appear in the answer to an A query, too.

This is the small wrinkle that makes DNS captures interesting: query type and answer-record type describe different things. A filter should reflect which one you’re trying to inspect.

Narrow the view when the packet list gets busy

For a focused look at A queries and their responses, use:


dns.qry.type == 1

To include A- and CNAME-type questions, use:


dns.qry.type in (1, 5)

If you want to show only DNS responses to A-type questions, add the response flag:


dns.flags.response == 1 && dns.qry.type == 1

And for responses to either A- or CNAME-type questions:


dns.flags.response == 1 && dns.qry.type in (1, 5)

These filters answer slightly different questions. The first focuses on queries and their associated messages; the response-flag version narrows the display to response packets. Wireshark filter syntax can vary in small ways across versions, so if a filter doesn’t parse, check the field autocomplete and the display-filter reference built into the application.

Follow the exchange, not just one packet

A single DNS packet rarely tells the whole story. Start with the query, then inspect its response and note the transaction ID, queried name, and record types in the answer section. If the answer contains a CNAME, look for the name it points to and check whether another DNS exchange follows.

It also helps to keep the capture context in mind. A DNS response may arrive from a local resolver rather than directly from an authoritative server. Cached answers can shorten the visible chain, while encrypted DNS traffic may not appear as readable DNS fields in an ordinary packet capture. Those details don’t make filtering less useful; they simply shape what the capture can show.

The key is to be precise about the field. dns.qry.type in (1, 5) is useful for viewing A- and CNAME-type questions and the messages associated with them. For a closer look at answer records themselves, inspect dns.resp.type. With that distinction clear, Wireshark’s packet list becomes less like a wall of data and more like a readable map of how a hostname finds its way to an address.