Skip to content

The resolve() function hangs if the list of hosts it is resolving contains duplicate entries #4

@balachandrannitish

Description

@balachandrannitish

If the list of hosts you're resolving contains duplicate entries, the resolve() function hangs/freezes causing the ADNS script itself to hang.

Steps to Reproduce:

  1. duplicate_host_list = ["google.com","oracle.com","google.com"]
  2. ar = AsyncResolver(duplicate_host_list)
  3. resolved_hosts = ar.resolve()

The script always hangs at step 3. If you get rid of the duplicate domain (i.e. google.com) and retry this, everything works perfectly.

I modified main() in asnc_dns.py slightly to test this. This is what it looks like,

if __name__ == "__main__":
    hosts = ["google.com","oracle.com","google.com"]
    ar = AsyncResolver(hosts, intensity=500)
    start = time()
    resolved_hosts = ar.resolve()
    end = time()
    print "It took %.2f seconds to resolve %d hosts." % (end-start, len(hosts)) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions