blechschmidt / massdns

A high-performance DNS stub resolver for bulk lookups and reconnaissance (subdomain enumeration)
GNU General Public License v3.0
3.13k stars 462 forks source link

support list of dedicated resolvers/nameservers in domains file #116

Closed infosec-it-init closed 3 years ago

infosec-it-init commented 3 years ago

See #49 I finally got some time to implement it with buffer_t struct for the resolvers per entry. As I have very limited experience with coding C, it would be good to do a proper review of the code :-)

Also, you might want to add a command line option to enable this feature?

blechschmidt commented 3 years ago

Thank you for contributing and apologies for the late reply. I have added the --extended-input command line option to enable this feature.

I have made some changes to the code as I want to keep the number of allocations quite small (when the resolving process has begun at least). In particular, I have removed any heap allocation that does not directly contribute to adding the resolvers to the lookup instance. For example, instead of making a copy of the line buffer in order to split it, strtok is used. Since we don't reuse the buffer anyway, there is no need to make a full copy.