[PR #818] [CLOSED] fix: check if dns listener can bind before switching #13039

Closed
opened 2026-08-05 02:07:19 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/818
Author: @Thunderbottom
Created: 4/19/2023
Status: Closed

Base: mainHead: dns-listener-fix


📝 Commits (1)

  • 2fc9ed1 fix: check if dns listener can bind before switching

📊 Changes

2 files changed (+35 additions, -12 deletions)

View changed files

📝 client/internal/dns/server_nonandroid.go (+34 -11)
📝 client/internal/dns/server_test.go (+1 -1)

📄 Description

Describe your changes

Currently, there's no check if DNS listener with custom address can bind to the specified IP:Port. In cases where the DNS listener fails to bind, the system's resolvconf is still changed even though the DNS listener is not running. This causes DNS to spectacularly fail on the client system until the user runs netbird down, replacing the netbird resolvconf with the original file.

This PR tries to fix the issue by not letting netbird change resolvconf if the DNS listener fails to bind in any case.

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)
  • Extended the README / documentation, if necessary

🔄 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/818 **Author:** [@Thunderbottom](https://github.com/Thunderbottom) **Created:** 4/19/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `dns-listener-fix` --- ### 📝 Commits (1) - [`2fc9ed1`](https://github.com/netbirdio/netbird/commit/2fc9ed1ca318cc909f71b7238b8458684cbfa4c1) fix: check if dns listener can bind before switching ### 📊 Changes **2 files changed** (+35 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/dns/server_nonandroid.go` (+34 -11) 📝 `client/internal/dns/server_test.go` (+1 -1) </details> ### 📄 Description ## Describe your changes Currently, there's no check if DNS listener with custom address can bind to the specified `IP:Port`. In cases where the DNS listener fails to bind, the system's `resolvconf` is still changed even though the DNS listener is not running. This causes DNS to spectacularly fail on the client system until the user runs `netbird down`, replacing the netbird `resolvconf` with the original file. This PR tries to fix the issue by not letting netbird change `resolvconf` if the DNS listener fails to bind in any case. ### Checklist - [X] 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) - [ ] Extended the README / documentation, if necessary --- <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 02:07:19 -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#13039