Search code examples
javanetworkingdnsjpcap

capturing dns packets using java


I want to log the websites visited in a system. So i decided to record the packets send by the system. I am using Jpcap API. I am able to record a lot of packets. Now what i want to do is i want to filter only DNS packets. I think that will be able to log the websites.

I want a way to filter the DNS packets. How can I do it?


Solution

  • i found it easy processing all the packets in port 53 and so i used this filter

    udp dst port 53

    tanx jack for ur hint