[PR #1556] [MERGED] correct behavior around trust_nx_responses #2411

Closed
opened 2026-03-16 08:52:28 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1556
Author: @peterthejohnston
Created: 9/22/2021
Status: Merged
Merged: 9/23/2021
Merged by: @djc

Base: mainHead: main


📝 Commits (1)

  • 6d7df2f Correct behavior around trust_nx_responses

📊 Changes

3 files changed (+43 additions, -88 deletions)

View changed files

📝 crates/resolver/src/name_server/name_server.rs (+3 -9)
📝 tests/integration-tests/src/mock_client.rs (+4 -2)
📝 tests/integration-tests/tests/name_server_pool_tests.rs (+36 -77)

📄 Description

In this change which moved the trust_nx_responses config from a configuration on the Resolver to a configuration at the name server level, the option was also renamed from distrust_nx_responses. There were some places in the codebase where the corresponding boolean value was not also flipped, unintentionally changing the semantics. This has led to some confusing behavior. For example, in this name_server_pool_test, where distrust_nx_responses was previously set to false, trust_nx_responses was left as false in the change, where it should have been changed to true.

This PR fixes a bug where retry behavior doesn't occur unless trust_nx_responses is set to true (due to an error response not being considered a ResolveError), and reworks the tests to accurately test the current behavior. It also consolidates the test_distrust_nx_responses and test_retry_on_error_response tests into one test, as they exercised the same functionality.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/1556 **Author:** [@peterthejohnston](https://github.com/peterthejohnston) **Created:** 9/22/2021 **Status:** ✅ Merged **Merged:** 9/23/2021 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`6d7df2f`](https://github.com/hickory-dns/hickory-dns/commit/6d7df2fc8da2f8072a87d158930e42aa6804f170) Correct behavior around trust_nx_responses ### 📊 Changes **3 files changed** (+43 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `crates/resolver/src/name_server/name_server.rs` (+3 -9) 📝 `tests/integration-tests/src/mock_client.rs` (+4 -2) 📝 `tests/integration-tests/tests/name_server_pool_tests.rs` (+36 -77) </details> ### 📄 Description In [this change](https://github.com/bluejekyll/trust-dns/pull/1212) which moved the [`trust_nx_responses`](https://docs.rs/trust-dns-resolver/0.21.0-alpha.2/trust_dns_resolver/config/struct.NameServerConfig.html#structfield.trust_nx_responses) config from a configuration on the Resolver to a configuration at the name server level, the option was also renamed from `distrust_nx_responses`. There were some places in the codebase where the corresponding boolean value was not also flipped, unintentionally changing the semantics. This has led to some confusing behavior. For example, in [this name_server_pool_test](https://github.com/bluejekyll/trust-dns/pull/1212/files#diff-90f333e308fae6ca92b573fb451e69b70155c72e3f8d1a7f0c836062d0e7b8d1L250), where `distrust_nx_responses` was previously set to `false`, `trust_nx_responses` was left as `false` in the change, where it should have been changed to `true`. This PR fixes a bug where retry behavior doesn't occur unless `trust_nx_responses` is set to true (due to an error response not being considered a `ResolveError`), and reworks the tests to accurately test the current behavior. It also consolidates the `test_distrust_nx_responses` and `test_retry_on_error_response` tests into one test, as they exercised the same functionality. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 08:52:28 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#2411
No description provided.