dnsmon-go
dnsmon-go copied to clipboard
Cannot use "any" as interface name.
I have tried to use "any" interface to capture traffic but it's not working. Any way to fix this?
:wave: hey @elico sorry for the delay. Does any mean all in your case? How did you expect this to work?
dnsmon attempts to listen to a given interface, and any is usually not an interface name. If you don't specify an interface, it attempts to listen on the first one with an assigned address, ref the snippet below:
https://github.com/jonpulsifer/dnsmon-go/blob/7c417cdecb3fcac59859610ef0ec627ce8677a82/main.go#L52-L66
@j0npulsifer Indeed I have seen this piece of code.
I did assumed that it makes sense from an admin point of view to have a function which will open "simultaneously" all the interfaces available on the system.
I do not know how libpcap implements the "any" function which tcpdump -i any uses but, what do you thing about this idea?
I'll take a look at the tcpdump implementation, good idea!