Skip to content Skip to sidebar Skip to footer

Deprecationwarning: Please Use Dns.resolver.resolver.resolve()

I am using resolver() as an alternative to socket() as I found that when multiple connections are made to different IPs it ends up stopping working. Anyway it returns a warning to

Solution 1:

faced the same problem

You should remove .resolve from my_resolver = dns.resolver.Resolver.resolve() and replace my_resolver.query() with my_resolver.resolve()

Example:

my_resolver = dns.resolver.Resolver()
    answers = my_resolver.resolve(host, "A")
    answer_txt = my_resolver.resolve(host, "TXT")

Post a Comment for "Deprecationwarning: Please Use Dns.resolver.resolver.resolve()"