Skip to content

feat: add ability to configure Recursion Desired (RD) bit for DNS read queries only #552

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dmachard
Copy link

This PR introduces a new configuration option: recursive (Boolean), which allows users to control whether the Recursion Desired (RD) bit is set for DNS read (resolution) queries.

Purpose

In our current architecture, DNS update requests are sent to an authoritative DNS server, while resolution (read) queries are sent to a recursive resolver. However, without this change, read queries are rejected by our recursive resolver because the Recursion Desired (RD) flag is set to 0 by default. Recursive resolvers expect this flag to be explicitly set to 1 in order to process and resolve the query.

By introducing the recursive configuration option, we allow users to control the RD bit for read queries only, ensuring compatibility with recursive resolvers and avoiding rejected requests.

This change increases flexibility for mixed DNS infrastructures where update and resolution paths differ.

New setting

The following configuration field has been added under the update block:

  • recursive (Boolean): Whether DNS resolution queries should be made recursively. When set to true, the DNS server is expected to perform full resolution and return a complete answer. When set to false, the server may return a referral to other name servers. Defaults to false. This value can also be sourced from the DNS_UPDATE_RECURSIVE environment variable.

Additional Notes

  • This setting only affects read queries, not dynamic updates.
  • No changes were made to the provider plugin behavior or logic unrelated to this flag.
  • Documentation has been updated accordingly.
  • Unit tests have been added to cover both recursive and non-recursive query behavior.

@dmachard dmachard requested a review from a team as a code owner May 11, 2025 08:27
Copy link

hashicorp-cla-app bot commented May 11, 2025

CLA assistant check
All committers have signed the CLA.

@dmachard
Copy link
Author

@bbasata Any chance to get some feedback or to approve the tests running on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant