I am trying to extract the ip addresses from a standard dns query response using "-e dns.resp.addr". Unfortunately, I also get the ip addresses from "additional records" section because the fieldname is the same: "dns.resp.addr"
Instead, I also get the ip addresses of their four nameservers. I used the display filter reference for dns but couldn’t find a solution: http://www.wireshark.org/docs/dfref/d/dns.html Is there a way to extract the addresses from the answer section only? Thanks Luke asked 04 Sep ‘12, 07:00 WireLuke |
2 Answers:
Try also specifying answered 04 Sep '12, 09:38 cmaynard ♦♦ |
Unfortunately that is not possible with tshark field extraction, as the fields in the additional records are also accessed by dns.resp.name and/or dns.resp.addr. What you can do is this:
This will print the DNS packets in full detail, like this one:
Then you extract only the required information from that output (addrs in the Answers section) with a script. Use your preferred language for that (perl/python/lua/ruby). Regards answered 10 Sep '12, 04:19 Kurt Knochner ♦ Unfortunately that is not possible with tshark field extraction, as the fields in the additional records are also accessed by dns.resp.name and/or dns.resp.addr. This could be changed though so that different filters are used. I would suggest filing a DNS enhancement bug report requesting this. (13 Sep '12, 17:57) cmaynard ♦♦ |
This works for domains which return only one address. For names with multiple addresses, I only get the first one. I would like to get the complete answer section without the "additional records" section.
Thanks anyway!