How can I identity which process is sending data to a certain host on Linux?

As per title, I want to figure out the process responsible for certain traffic. I can see the traffic in wireshark, but I don't know which process it is.

Is there any straightforward way to do it? I'm thinking of using perf with kernel probes on the syscall used for resolving the hostnames but I'm wondering if there is an easier way. Thanks.


Solution 1:

ss -put | grep <port number> will tell you.