[PR #6788] [management] Exclude disconnected peers from DNS records #28994

Open
opened 2026-08-05 08:07:16 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6788
Author: @CoderSufiyan
Created: 7/15/2026
Status: 🔄 Open

Base: mainHead: fix/issue-3976-dns-peer-replacement


📝 Commits (2)

  • 9bdd173 [management] Exclude disconnected peers from DNS records
  • 3d5ca77 [management] Mark DNS fixture peers connected

📊 Changes

3 files changed (+46 additions, -1 deletions)

View changed files

📝 management/server/dns_test.go (+9 -1)
📝 management/server/types/account_components.go (+3 -0)
management/server/types/account_components_test.go (+34 -0)

📄 Description

Describe your changes

Exclude disconnected or uninitialized peers when building DNS records for a network map. This prevents DNS routes from continuing to advertise stale addresses after ephemeral routing peers are replaced.

Fixes #3976

Stack

  • This PR is independent

Checklist

  • I have performed a self-review of my own code
  • I have tested the changes locally
  • I have added or updated tests where applicable
  • I have checked for breaking changes

Documentation

  • Documentation is not needed

Validation

  • go test ./management/server/types -count=1
  • git diff --check

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • DNS record filtering now ignores peers that aren’t currently connected, so only reachable peer addresses are considered.
  • Tests

    • Added a unit test to confirm disconnected peers are excluded from filtered DNS results.
    • Updated DNS test setup to ensure peer connectivity status is persisted before DNS-related assertions run.

🔄 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/netbirdio/netbird/pull/6788 **Author:** [@CoderSufiyan](https://github.com/CoderSufiyan) **Created:** 7/15/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/issue-3976-dns-peer-replacement` --- ### 📝 Commits (2) - [`9bdd173`](https://github.com/netbirdio/netbird/commit/9bdd17371e42ee2ddfcb53fcee056a6314d3c581) [management] Exclude disconnected peers from DNS records - [`3d5ca77`](https://github.com/netbirdio/netbird/commit/3d5ca77eb31f71702043c2c2e0306017f0dd9d6f) [management] Mark DNS fixture peers connected ### 📊 Changes **3 files changed** (+46 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `management/server/dns_test.go` (+9 -1) 📝 `management/server/types/account_components.go` (+3 -0) ➕ `management/server/types/account_components_test.go` (+34 -0) </details> ### 📄 Description ## Describe your changes Exclude disconnected or uninitialized peers when building DNS records for a network map. This prevents DNS routes from continuing to advertise stale addresses after ephemeral routing peers are replaced. ## Issue ticket number and link Fixes #3976 ## Stack - [x] This PR is independent ## Checklist - [x] I have performed a self-review of my own code - [x] I have tested the changes locally - [x] I have added or updated tests where applicable - [x] I have checked for breaking changes ## Documentation - [x] Documentation is **not needed** ## Validation - `go test ./management/server/types -count=1` - `git diff --check` <!-- codesmith:footer --> --- <a href="https://app.blacksmith.sh/netbirdio/codesmith/netbird/pr/6788"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v2.svg"><img alt="View with Codesmith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"></picture></a> <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1786729376&installation_id=146802194&pr_number=6788&repository=netbirdio%2Fnetbird&return_to=https%3A%2F%2Fgithub.com%2Fnetbirdio%2Fnetbird%2Fpull%2F6788&signature=8f4bcfc55f3328674273fe8328150bfe76aa7747efe15b56b83040927c587688"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with Codesmith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"></picture></a> <sup>Need help on this PR? Tag <code>/codesmith</code> with what you need. Autofix is disabled.</sup> <!-- codesmith:autofix:disabled --> <!-- /codesmith:footer --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * DNS record filtering now ignores peers that aren’t currently connected, so only reachable peer addresses are considered. * **Tests** * Added a unit test to confirm disconnected peers are excluded from filtered DNS results. * Updated DNS test setup to ensure peer connectivity status is persisted before DNS-related assertions run. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:07:16 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#28994