what is the capture filter for dns.flags.opcode==5
What is the equivalent of display filter dns.flags.opcode==5 if I want to apply it as a capture filter?
I haven't had luck generating a DNS packet with an opcode other than 0 so this hasn't been tested.
https://www.tcpdump.org/manpages/pcap...
(PACKET DATA ACCESSORS)
PACKET DATA ACCESSORS
To use the packet data in an arithmetic expression, use the following syntax:
proto [ expr : size ]
DNS RFC (https://datatracker.ietf.org/doc/html...):
The header contains the following fields: 1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ID | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |QR| Opcode |AA|TC|RD|RA| Z | RCODE | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ --- snip ---
There are 8 bytes/octets in a UDP header (0-7), then two for the DNS ID
(UDP 8-9).
Try udp port 53 && udp[10] & 0x78 == 0x28
Asked: 2025-05-15 17:21:18 +0000
Seen: 165 times
Last updated: May 15
Have you already constructed a capture filter to only capture DNS?