[PR #1526] [MERGED] always retry on DNS error response from name server #2389

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1526
Author: @peterthejohnston
Created: 7/26/2021
Status: Merged
Merged: 8/4/2021
Merged by: @bluejekyll

Base: mainHead: retry-on-errors


📝 Commits (3)

  • 58b0afe retry on all DNS error response codes
  • 724ddff return error response from highest priority name server
  • e167528 Merge branch 'main' into retry-on-errors

📊 Changes

4 files changed (+110 additions, -40 deletions)

View changed files

📝 crates/resolver/src/config.rs (+6 -2)
📝 crates/resolver/src/error.rs (+20 -19)
📝 crates/resolver/src/name_server/name_server_pool.rs (+1 -1)
📝 tests/integration-tests/tests/name_server_pool_tests.rs (+83 -18)

📄 Description

This PR makes the two changes proposed in #1519:

  • In the resolver, always try other name servers when we receive a response with an error code. (i.e. only fail the query terminally if we have already tried all of them.)
  • Eventually return the error received from the first name server, so in the case of a "legitimate" error, we prefer the response from the highest priority server we queried.

I do have two outstanding questions:

  • For some reason, ResponseCode::BADMODE does not lead to a retry in this this test. Any idea what's going on here, or whether ResponseCode::BADMODE has some kind of special treatment I'm unaware of?
  • Where can I add an integration test for the "return first error received" behavior? In name_server_pool_tests? If so, I think I'll need to pull in RetryDnsHandle from the trust-dns-proto crate there.

resolves #1519


🔄 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/1526 **Author:** [@peterthejohnston](https://github.com/peterthejohnston) **Created:** 7/26/2021 **Status:** ✅ Merged **Merged:** 8/4/2021 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `main` ← **Head:** `retry-on-errors` --- ### 📝 Commits (3) - [`58b0afe`](https://github.com/hickory-dns/hickory-dns/commit/58b0afec04bc2870f0625d1ea95922fb547fd2b6) retry on all DNS error response codes - [`724ddff`](https://github.com/hickory-dns/hickory-dns/commit/724ddffea6488e6de0a41789520cad2d8eec116e) return error response from highest priority name server - [`e167528`](https://github.com/hickory-dns/hickory-dns/commit/e167528f979dcc407ad638701df349b28c95438a) Merge branch 'main' into retry-on-errors ### 📊 Changes **4 files changed** (+110 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `crates/resolver/src/config.rs` (+6 -2) 📝 `crates/resolver/src/error.rs` (+20 -19) 📝 `crates/resolver/src/name_server/name_server_pool.rs` (+1 -1) 📝 `tests/integration-tests/tests/name_server_pool_tests.rs` (+83 -18) </details> ### 📄 Description This PR makes the two changes proposed in #1519: - In the resolver, always try other name servers when we receive a response with an error code. (i.e. only fail the query terminally if we have already tried all of them.) - Eventually return the error received from the first name server, so in the case of a "legitimate" error, we prefer the response from the highest priority server we queried. I do have two outstanding questions: - For some reason, `ResponseCode::BADMODE` does not lead to a retry in this [this test](https://github.com/bluejekyll/trust-dns/compare/main...peterthejohnston:retry-on-errors?expand=1#diff-90f333e308fae6ca92b573fb451e69b70155c72e3f8d1a7f0c836062d0e7b8d1R372). Any idea what's going on here, or whether `ResponseCode::BADMODE` has some kind of special treatment I'm unaware of? - Where can I add an integration test for the "return first error received" behavior? In [name_server_pool_tests](https://github.com/bluejekyll/trust-dns/blob/main/tests/integration-tests/tests/name_server_pool_tests.rs)? If so, I think I'll need to pull in `RetryDnsHandle` from the trust-dns-proto crate there. resolves #1519 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 08:51:07 +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#2389
No description provided.