[PR #4693] [CLOSED] Apply DNS server update only on changes #23903

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/4693
Author: @hurricanehrndz
Created: 10/23/2025
Status: Closed

Base: mainHead: feat_dsn_server_update_on_change


📝 Commits (3)

  • 9272227 Apply DNS server update only on changes
  • ccce298 fix: reduce complexity
  • 2bb74d4 Add tests for DNSConfig comparison

📊 Changes

2 files changed (+550 additions, -2 deletions)

View changed files

📝 client/internal/engine.go (+91 -2)
📝 client/internal/engine_test.go (+459 -0)

📄 Description

Add configuration tracking and comparison logic to avoid updating the DNS server when the configuration hasn't changed. This prevents potential DNS resolution disruptions and unnecessary processing cycles.

Changes:

  • Add lastDNSConfig field to Engine struct to track applied configuration
  • Implement dnsConfigsEqual() for deep comparison of DNS configurations
  • Only call UpdateDNSServer when configuration actually changes

Describe your changes

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__


🔄 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/4693 **Author:** [@hurricanehrndz](https://github.com/hurricanehrndz) **Created:** 10/23/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat_dsn_server_update_on_change` --- ### 📝 Commits (3) - [`9272227`](https://github.com/netbirdio/netbird/commit/92722270cce5820db5b900dbcc727918c66d5f09) Apply DNS server update only on changes - [`ccce298`](https://github.com/netbirdio/netbird/commit/ccce298c4c112a0b3dd88a4af8a2979c9ec127c0) fix: reduce complexity - [`2bb74d4`](https://github.com/netbirdio/netbird/commit/2bb74d4a7677235cac6306d0dddebf22d23cf1b8) Add tests for DNSConfig comparison ### 📊 Changes **2 files changed** (+550 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/engine.go` (+91 -2) 📝 `client/internal/engine_test.go` (+459 -0) </details> ### 📄 Description Add configuration tracking and comparison logic to avoid updating the DNS server when the configuration hasn't changed. This prevents potential DNS resolution disruptions and unnecessary processing cycles. Changes: - Add lastDNSConfig field to Engine struct to track applied configuration - Implement dnsConfigsEqual() for deep comparison of DNS configurations - Only call UpdateDNSServer when configuration actually changes ## Describe your changes ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ --- <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 06:08:00 -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#23903