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

Open
opened 2025-11-20 08:04:18 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/818

State: closed
Merged: No


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
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/818 **State:** closed **Merged:** No --- ## 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
saavagebueno added the pull-request label 2025-11-20 08:04:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2890