zmap / zdns

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

all-nameservers flag cannot fetch DNS records from all nameservers #352

Open Junzhe-Suen opened 7 months ago

Junzhe-Suen commented 7 months ago

I want to use the --all-nameservers flag to iteratively query the A record of the domain name dumalinao.gov.ph., so my command is: echo "dumalinao.gov.ph." | ./zdns a --iterative --all-nameservers

{"altered_name":"dumalinao.gov.ph","data":{"results":[{"nameserver":"ns2.servconfig.com","result":{"answers":[{"answer":"74.124.213.192","class":"IN","name":"dumalinao.gov.ph","ttl":900,"type":"A"}],"protocol":"udp","resolver":"70.39.146.236:53"},"status":"NOERROR"},{"nameserver":"ns1.servconfig.com","result":{"answers":[{"answer":"74.124.213.192","class":"IN","name":"dumalinao.gov.ph","ttl":900,"type":"A"}],"protocol":"","resolver":""},"status":"NOERROR"}]},"name":"dumalinao.gov.ph.","status":"NOERROR","timestamp":"2024-01-05T08:38:26Z"}

I can see the results returned by the two nameservers: ns1.servconfig.com and ns2.servconfig.com. However, dumalinao.gov.ph. not only has these two nameservers, it also has ns1.inmotionhosting.com. and ns2.inmotionhosting.com.

dumalinao.gov.ph.      86400   IN      NS      ns2.servconfig.com.
dumalinao.gov.ph.       86400   IN      NS      ns1.servconfig.com.
;; Received 123 bytes from 52.230.26.107#53(ns1.gov.ph) in 245 ms

dumalinao.gov.ph.       14400   IN      NS      ns1.inmotionhosting.com.
dumalinao.gov.ph.       14400   IN      NS      ns2.inmotionhosting.com.
;; Received 160 bytes from 216.194.168.112#53(ns1.servconfig.com) in 59 ms

I think this is an issue about parent-child nameserver inconsistency. So how to change the code to query these four nameservers?