zmap/zdns

use async DNS to improve performance

mutax opened this issue · 1 comments

mutax commented

While scanning through your code and reading the IMC paper I noticed that you could improve performance drastically by using async DNS - like 'regular' resolvers usually do.

Instead of waiting for a response on a socket before sending out the next request on that socket, you send out the next request - using the same udp socket for multiple queries to multiple remote servers, and us the source IP/port and query id in the received response to find the corresponding query e.g. in a list associated to the socket used.

With that you do not need to spawn so many threads and still get a LOT of performance.

While true, threads in Go are exceedingly light-weight and is the preferred way of managing this type of behavior in Go. As such, I don't think we want to go down this path at this time.