How to filter wireshark to see only dns queries that are sent/received from/by my computer?
Asked Answered
B

4

22

I am new to wireshark and trying to write simple queries. To see the dns queries that are only sent from my computer or received by my computer, i tried the following:

dns and ip.addr==159.25.78.7

where 159.25.78.7 is my ip address. It looks like i did it when i look at the filter results but i wanted to be sure about that. Does that filter really do what i am trying to find out? I doubted a little bit because in the filter results i also see only 1 other result whose protocol is ICMP and its info says "Destination unreachable (Port unreachable)".

Can anyone help me with this?

Thanks

Belize answered 27/11, 2013 at 19:2 Comment(4)
Try: dns and ip.addr==127.0.0.1Lanielanier
@alfasin why do i use localhost instead of my ip address? Is my filter wrong?Belize
@alfasin when i try that filter nothing is listedBelize
The title of your question is misleading... you already know how to filter, your problem is with the unreachable destination. This might help: wildpackets.com/resources/compendium/tcp_ip/unreachableLanielanier
D
17

I would go through the packet capture and see if there are any records that I know I should be seeing to validate that the filter is working properly and to assuage any doubts.

That said, please try the following filter and see if you're getting the entries that you think you should be getting:

dns and (ip.dst==159.25.78.7 or ip.src==159.57.78.7)

This filter will show only DNS traffic from 159.57.78.7 or to 159.25.78.7.

Donough answered 27/11, 2013 at 19:24 Comment(1)
Thanks, it looks like your filter and mine is the same because ip.addr refers to both source and destinationBelize
D
11

Rather than using a DisplayFilter you could use a very simple CaptureFilter like

port 53

See the "Capture only DNS (port 53) traffic" example on the CaptureFilters wiki.

Devondevona answered 27/11, 2013 at 19:58 Comment(0)
C
3

use this filter:

(dns.flags.response == 0) and (ip.src == 159.25.78.7)

what this query does is it only gives dns queries originated from your ip

Chrystel answered 15/12, 2015 at 4:46 Comment(0)
R
1

You can capture by adding filter udp==53 to see all dns queries

Reactance answered 3/1, 2023 at 13:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.