The current code performs an NS lookup against a name server for a given domain, d. With this list of name servers, it then sends a single lookup to each one. This works fine if there's only one layer of name servers, but this is not always the case.
Consider trying to query for an A record for google.com to a root server. The root server would provide a list of .com gTLD servers and we'd query each one for google.com's A record. None would have it, and so we'd exit.
IMO, we should change this function to get all name servers at all levels of recursion and query them all. So in the prior example, we'd continue to query all .com gTLD servers for the NS for google.com until we reached the authoritative name servers. We could then query all of these for the A record.
That or we should remove --all-nameservers as a CLI option since it's misleading, IMO.
The current code performs an NS lookup against a name server for a given domain, d. With this list of name servers, it then sends a single lookup to each one. This works fine if there's only one layer of name servers, but this is not always the case.
Consider trying to query for an A record for
google.com
to a root server. The root server would provide a list of.com
gTLD servers and we'd query each one forgoogle.com
's A record. None would have it, and so we'd exit.IMO, we should change this function to get all name servers at all levels of recursion and query them all. So in the prior example, we'd continue to query all
.com gTLD
servers for the NS forgoogle.com
until we reached the authoritative name servers. We could then query all of these for the A record.That or we should remove
--all-nameservers
as a CLI option since it's misleading, IMO.