Skip to content

[client] Always register NetBird with plain Linux DNS and use original servers as upstream #3967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

lixmal
Copy link
Collaborator

@lixmal lixmal commented Jun 12, 2025

Describe your changes

  • Removes the restriction that only all-domains resolvers can be registered on Linux with resolvconf and file managers
  • Registers NetBird as the sole nameserver
  • Registers original nameservers as upstream with low priority: NetBird-assigned "all domains" resolvers can take precedence
  • Replace DNS-related server IP strings with netip.Addr
  • Use resolvconf as a fallback instead of openresolv
  • Return RcodeRefused if no handler was found in the chain

Issue ticket number and link

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

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

@Copilot Copilot AI review requested due to automatic review settings June 12, 2025 17:00
Copy link
Contributor

@Copilot 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 updates the DNS configuration logic to register NetBird as the sole nameserver while passing the original nameservers as low-priority upstream handlers.

  • Removes the resolvconf restriction to allow non-all-domain resolvers on Linux
  • Adds fallback support to register original nameservers with a lower priority
  • Refactors error handling and prioritization logic in the DNS server and file configurator

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
client/internal/dns/server.go Added fallback registration, refactored error handling, and updated priority overlap handling
client/internal/dns/resolvconf_unix.go Added getter for original nameservers and simplified DNS config application
client/internal/dns/host.go Removed unused error constant
client/internal/dns/handler_chain.go Introduced PriorityFallback constant with a new negative priority value
client/internal/dns/file_unix.go Updated backup and restoration process, added retrieval of original nameservers
client/internal/dns/file_parser_unix.go Removed options timeout generation logic

Copy link

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.

1 participant