[PR #5515] [MERGED] [management] Add stable domain resolution for combined server #23207

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5515
Author: @mlsmaycon
Created: 3/5/2026
Status: Merged
Merged: 3/6/2026
Merged by: @mlsmaycon

Base: mainHead: add-single-mode-auto-resolve-domain


📝 Commits (1)

  • 7afc22d [management] Add stable domain resolution for combined server

📊 Changes

3 files changed (+134 additions, -8 deletions)

View changed files

📝 combined/cmd/root.go (+3 -5)
📝 management/internals/server/server.go (+68 -3)
management/internals/server/server_resolve_domains_test.go (+63 -0)

📄 Description

Describe your changes

The combined server was using the hostname from exposedAddress for both singleAccountModeDomain and dnsDomain, causing fresh installs to get the wrong domain and existing installs to break if the config changed.
Add resolveDomains() to BaseServer that reads domain from the store:

  • Fresh install (0 accounts): uses "netbird.selfhosted" default
  • Existing install: reads persisted domain from the account in DB
  • Store errors: falls back to default safely

The combined server opts in via AutoResolveDomains flag, while the
standalone management server is unaffected.

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/__

Summary by CodeRabbit

  • New Features

    • Added automatic domain resolution for self-hosted deployments. Fresh installations default to the standard self-hosted domain, while existing installations automatically read domain information from account data.
  • Tests

    • Added test coverage for domain resolution behavior across fresh installs, existing installations, and error scenarios.

🔄 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/5515 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 3/5/2026 **Status:** ✅ Merged **Merged:** 3/6/2026 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `add-single-mode-auto-resolve-domain` --- ### 📝 Commits (1) - [`7afc22d`](https://github.com/netbirdio/netbird/commit/7afc22d2ef7c92001f846b89484a25abf108fc36) [management] Add stable domain resolution for combined server ### 📊 Changes **3 files changed** (+134 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `combined/cmd/root.go` (+3 -5) 📝 `management/internals/server/server.go` (+68 -3) ➕ `management/internals/server/server_resolve_domains_test.go` (+63 -0) </details> ### 📄 Description ## Describe your changes The combined server was using the hostname from exposedAddress for both singleAccountModeDomain and dnsDomain, causing fresh installs to get the wrong domain and existing installs to break if the config changed. Add resolveDomains() to BaseServer that reads domain from the store: - Fresh install (0 accounts): uses "netbird.selfhosted" default - Existing install: reads persisted domain from the account in DB - Store errors: falls back to default safely The combined server opts in via AutoResolveDomains flag, while the standalone management server is unaffected. ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] 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/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added automatic domain resolution for self-hosted deployments. Fresh installations default to the standard self-hosted domain, while existing installations automatically read domain information from account data. * **Tests** * Added test coverage for domain resolution behavior across fresh installs, existing installations, and error scenarios. <!-- 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 06:06:55 -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#23207