zmap / zdns

Fast DNS Lookup Library and CLI Tool
Apache License 2.0
891 stars 121 forks source link

issue using multiple resolvers with--name-servers #381

Closed m4il3r17 closed 2 months ago

m4il3r17 commented 2 months ago

first of all i would thanks the team for this awesome tool, keep it up.

i have an issue using multiple resolvers, i have a file contains like 10 resolver IPs and also have 10 domains in a file domains.txt and i used this command to make it work: cat domains.txt | zdns A --name-server-mode --name-servers=@resolvers.txt --timeout=3 --result-verbosity=normal --output-file all_result.json but i get an error saying: TA[0000] unable to parse name server: 192.185.50.24 but when i try with just 1 IP resolver inside my resolver.txt file the command works, for multiple resolver IPs i get the error i just mention anyone can help?

phillip-stephens commented 2 months ago

Hey @m4il3r17! Thanks for the issue, let me take a look at this.

So starting off, I think your issue is you don't need the --name-server-mode to do what you're describing. If you want to just use a file of resolvers to resolve domains.txt, drop the name-server-mode flag. That flag is intended to - "Treats input as nameservers to query with a static query rather than queries to send to a static name server" which doesn't seem to be what you're doing. So just: cat domains.txt | zdns A --name-servers=@resolvers.txt --timeout=3 --result-verbosity=normal --output-file all_result.json

When I tried the above locally it worked.

That being said, that error could definitely be improved, so if you could provide the following, I can try to give a more helpful error.

  1. The contents of the resolvers.txt file with multiple resolvers
  2. What version of ZDNS you're using? Git tag, main, from a package manager, etc.
m4il3r17 commented 2 months ago

There @phillip-stephens Thank you for the quick reply. somehow i found the issue. i was saving the resolver IPs using windows OS while running zdns in UNIX system which make zdns fail to parse the file so i used sed command to fix my file and run again and works perfectly. and yes you are right i was also wrong with "name-server-mode" flag.

Thanks again!