libopendkim: wire up dkim_res_nslist so Nameservers applies to default resolver#408
Merged
thegushi merged 1 commit intoJun 5, 2026
Conversation
…t resolver dkim_res_nslist() has always existed and correctly calls res_setservers(), but dkiml_dns_setns was never assigned for the default resolver backend. The result was that dkim_dns_nslist() silently skipped the call and returned success, so the Nameservers config option had no effect unless the daemon was built with USE_UNBOUND (the only path that wired this up).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dkim_res_nslist()has existed since the resolver abstraction was introduced and correctly callsres_setservers(), butdkiml_dns_setnswas never assigned during library init for the default resolver backend.dkim_dns_nslist()checkslib->dkiml_dns_setns != NULLbefore calling it, so without the assignment theNameserversconfig option silently did nothing -- returningDKIM_DNS_SUCCESSwithout touching the resolver state.USE_UNBOUND(viadkimf_unbound_setup), soNameserversonly worked in libunbound builds. Standard distro packages (e.g., RHEL/EPEL) don't use libunbound, making the option a documented no-op in practice.dkim_res_nslisttodkiml_dns_setnsalongside the other default resolver callbacks indkim_init().On platforms where
res_setservers()is not available (HAVE_RES_SETSERVERSnot defined at build time),dkim_res_nslist()already returns success without doing anything, so behavior on those platforms is unchanged.Closes #407.
Test plan
Nameserverspointing to a known external resolver; verify via packet capture or resolver logs that queries go to the specified server and not the system defaultNameserversfrom config: queries continue to use system resolv.conf -- no regressionUSE_UNBOUND: confirmNameserversis now respectedUSE_UNBOUND: confirm no change in behavior (unbound path unaffected)