Skip to content

libopendkim: wire up dkim_res_nslist so Nameservers applies to default resolver#408

Merged
thegushi merged 1 commit into
trusteddomainproject:developfrom
thegushi:fix-nameservers-default-resolver
Jun 5, 2026
Merged

libopendkim: wire up dkim_res_nslist so Nameservers applies to default resolver#408
thegushi merged 1 commit into
trusteddomainproject:developfrom
thegushi:fix-nameservers-default-resolver

Conversation

@thegushi

@thegushi thegushi commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • dkim_res_nslist() has existed since the resolver abstraction was introduced and correctly calls res_setservers(), but dkiml_dns_setns was never assigned during library init for the default resolver backend.
  • dkim_dns_nslist() checks lib->dkiml_dns_setns != NULL before calling it, so without the assignment the Nameservers config option silently did nothing -- returning DKIM_DNS_SUCCESS without touching the resolver state.
  • The only build path that wired this up was USE_UNBOUND (via dkimf_unbound_setup), so Nameservers only worked in libunbound builds. Standard distro packages (e.g., RHEL/EPEL) don't use libunbound, making the option a documented no-op in practice.
  • Fix is one line: assign dkim_res_nslist to dkiml_dns_setns alongside the other default resolver callbacks in dkim_init().

On platforms where res_setservers() is not available (HAVE_RES_SETSERVERS not defined at build time), dkim_res_nslist() already returns success without doing anything, so behavior on those platforms is unchanged.

Closes #407.

Test plan

  • Configure Nameservers pointing to a known external resolver; verify via packet capture or resolver logs that queries go to the specified server and not the system default
  • Omitting Nameservers from config: queries continue to use system resolv.conf -- no regression
  • Build without USE_UNBOUND: confirm Nameservers is now respected
  • Build with USE_UNBOUND: confirm no change in behavior (unbound path unaffected)

…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).
@thegushi thegushi merged commit bf4fa83 into trusteddomainproject:develop Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant