Skip to content

Conversation

@Exobitt
Copy link

@Exobitt Exobitt commented Oct 28, 2025

Describe your changes

In some cases, the Windows client does not clean up DNS and NRPT policies in the registry.
This can break the user's DNS resolution when using split-horizon DNS.
If these entries are not properly removed, the user may lose access to domains configured under the split-horizon setup.

Issue ticket number and link

N/A

Stack

Windows

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)
    It happens in the uninstaller

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

Copilot AI review requested due to automatic review settings October 28, 2025 11:17
@CLAassistant
Copy link

CLAassistant commented Oct 28, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a bug where the Windows client fails to clean up DNS and NRPT (Name Resolution Policy Table) policies from the registry during uninstallation, which can break DNS resolution for users with split-horizon DNS configurations.

  • Adds PowerShell script execution during uninstallation to remove Netbird-related DNS policy registry entries
  • Implements registry cleanup with error handling and service restart
  • Ensures proper cleanup of NRPT entries to prevent DNS resolution issues after uninstallation
Comments suppressed due to low confidence (3)

client/installer.nsis:1

  • [nitpick] The regex pattern uses 'netbird' (lowercase) but the comment and description reference 'Netbird' (capitalized). Consider using a case-insensitive match that explicitly matches the actual product name, such as '^(?i)netbird' or clarifying the expected naming convention in the registry keys.
!define APP_NAME "Netbird"

client/installer.nsis:1

  • The Write-Host cmdlets with -ForegroundColor may not display properly in the NSIS installer context since the PowerShell is executed with -WindowStyle Hidden. Consider removing the color parameters or using Write-Output for better compatibility with the installer's logging mechanism.
!define APP_NAME "Netbird"

client/installer.nsis:1

  • The Write-Host cmdlets with -ForegroundColor may not display properly in the NSIS installer context since the PowerShell is executed with -WindowStyle Hidden. Consider removing the color parameters or using Write-Output for better compatibility with the installer's logging mechanism.
!define APP_NAME "Netbird"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

@lixmal
Copy link
Collaborator

lixmal commented Oct 30, 2025

Hi @Exobitt, thank you for the contribution.

Is this required?

For context: the client cleans up the registry on shutdown. Or in case of a crash, on startup, based on the state file.

The only two scenarios where this is a problem are:

  • The state file becomes corrupted for some reason
  • NetBird is uninstalled after a crash and doesn't get the chance to clean up
    The registry entries are volatile, so a reboot will also clean them up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants