-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeprecationWarning: please use dns.resolver.resolve() instead #581
Comments
Thanks for the kind words! You may still use dns.resolver.query(); it is only a deprecation warning and it will not be removed for some time yet. It would be better, however, to switch to using dns.resolve.resolve() and explicitly enabling search if you need it. Calling dns.resolver.query() is equivalent to calling dns.resolver.resolve() with the same arguments and also passing search=True. See the description of the 'search' parameter in the documentation for more details. Basically dnspython is using a safer default as searching can be insecure or surprising. If your application needs the search behavior, and you are satisfied with its safety and security, then simply pass search=True to dns.resolver.resolve(). |
thanks. |
Where previously we used dns.resolver.query(), switch to d.r.resolve() Complete compatibility would require d.r.resolve(search=True) but this works without it so far. Perhaps see also rthalley/dnspython#581
@rthalley hello. Did you switch back to the dns.resolver.resolve method? because now I am using dns.resolver.query in my program and I got a warning.
Can you please explain whether you are using the query method anymore? |
dns.resolver.Resolver.resolve() is the newer, safer method that you should use. You are getting a deprecation warning because your code is using the older query() method. |
thanks |
hello. thanks for great project. I have made a program before and it was working without any problems. but for the past few days I've started seeing an error like this. "DeprecationWarning: please use dns.resolver.resolve() instead"
Can we no longer query with dns.resolver.query? Should we use dns.resolver.resolve instead of dns.resolver.query?
The text was updated successfully, but these errors were encountered: