Forrest logo
back to the tshark tool

tshark:tldr:029f4

tshark: Only capture packets matching a specific capture filter.
$ tshark -f '${udp port 53}'
try on your machine

The command tshark -f '${udp port 53}' is used to capture network traffic using the tshark command-line tool.

Here is the breakdown of the command:

  • tshark: It is a command-line tool used for capturing and analyzing network traffic. It can read captured files or sniff live network packets.
  • -f '${udp port 53}': This flag specifies a display filter expression to filter the captured packets based on certain criteria. In this case, the filter is '${udp port 53}', which means to capture only UDP (User Datagram Protocol) traffic that is transmitted over port 53.

Port 53 is the well-known port for DNS (Domain Name System) traffic. DNS uses both TCP and UDP for communication, but this filter specifically captures UDP traffic. DNS is responsible for translating domain names (e.g., www.example.com) into IP addresses.

So, this command captures and displays UDP traffic on port 53, which generally indicates DNS traffic.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the tshark tool