Closed JaegerMaKn closed 1 month ago
cc @jpmens click here for bot help
Thanks for your review! I've applied the suggested changes
Created separate PR with just the multi-nameservers-bugfix as #8970
This will likely need a rebase to resolve the conflict once #8970 has been merged.
This now needs a rebase.
Rebased
✅ Backport PR branch: patchback/backports/stable-9/5e6b8e53274095c7a62b8b4dadf2a9c18ac2e562/pr-8966
Backported as https://github.com/ansible-collections/community.general/pull/9004
🤖 @patchback I'm built with octomachinery and my source is open — https://github.com/sanitizers/patchback-github-app.
@JaegerMaKn thanks for your contribution!
SUMMARY
Add new option
port
to thedig
lookup module to specify which port is to be used for DNS query. This is necessary for setups in which a (custom/internal) DNS server listens on a non-default port.ISSUE TYPE
COMPONENT NAME
dig
ADDITIONAL INFORMATION
dnspython accepts a port as part of the nameserver and not, like the other optioins that are currently present in the
dig
module, to be passed to thequery
function.Currently, the nameservers are passed as strings which leads dnspython to create Nameserver objects out of them using the port that is currently set in the Resolver instance. That creation of Nameserver objects is done right when the
nameservers
property is set. If a port is to be set by us, theport
attribute of the Resolver needs to be set before the nameservers are passed to the Resolver so when the nameservers are passed, that new port is used to create the Nameserver objects. Therefore, the assignment of thenameservers
property of the Resolver is moved after the argument processing so theport
attribute is (if it's given) definitely set before thenameservers
property.