-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide option to perform reverse DNS lookup of IP addresses #245
Comments
I'm confused. What would it do with the looked up names? |
Sorry, let me clarify. Here is some example output from tcpdump:
Observe how it prints out hostnames instead of IP addresses. Whereas here is some example output from tcpflow:
Observe how it prints out IP addresses instead of hostnames.
I would like it to print them out in the console output. |
so Do you want to cache the hostname? What if you are runnon on a pcap file and the mapping of the hostname to DNS name has changed? Do you want the old mapping or the new mapping? Should it learn the DNS from DNS packets in the pcap file? What if DNS packets in the pcap file disagree with the current mapping - which should it use? |
I only use tcpflow in the console print mode (
I assume that would be more performant, so probably
Good question. I wonder what tcpdump does in this case? Does it use hostnames in the pcap file or does it only use IP addresses in the pcap file? Anyway, I understand that there are some intricacies to work out for this feature. I apologize that I don't feel that I have the expertise to properly answer them. My personal primary use case is simply for printing out hostnames to console output. |
Certainly limiting this to the |
Good point. I don't have a super strong opinion here. I wonder what the performance impact of not doing separate caching would be?
I could try to take a stab. Caveat is that it might take me a few months to find the time. In the offhand chance that you felt the urge to implement it sooner, I wouldn't stop you. Another caveat is that I have very little experience with C / C++ :) I'd gladly take any pointers you have though! |
You should rely on the caching built into the DNS system for most cases. This would be a great way for you to get more experience with C/C++! I am happy to give you pointers. You should start by writing a stand-alone program (lookup.cpp) that takes an IP address provided on the command line and prints the hostname. Once you have that, then it is a simple matter to add the option to the tcpflow option processing system to turn of the hostname display, and then to add the display and make it the default (to match tcpdump). Also, do you know that running reverse DNS means that people can learn that you are wiretapping them? |
I love tcpflow, and generally reach for it more often than tcpdump. One small issue I have with tcpflow is it cannot automatically perform reverse DNS on the ip addresses it prints out. Particularly, I'd find this feature useful when running tcpflow with the console print
-c
option.For example,
tcpdump
does this by default. It can be disabled in tcpdump via the-n
option:The text was updated successfully, but these errors were encountered: