Skip to content
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

Support disabled resolved stub server mode #1493

Merged
merged 20 commits into from Jan 24, 2024
Merged

Support disabled resolved stub server mode #1493

merged 20 commits into from Jan 24, 2024

Conversation

pappz
Copy link
Contributor

@pappz pappz commented Jan 23, 2024

Describe your changes

In the case of disabled stub listener the list of name servers is unordered. The solution is to configure the resolv.conf file directly instead of dbus API.
Because third-party services also can manipulate the DNS settings the agent watch the resolv.conf file and keep it up to date.

  • apply file type DNS manager if in the name server list does not exist the 127.0.0.53 address
  • watching the resolv.conf file with inotify service and overwrite all the time if the configuration has changed and it invalid
  • fix resolv.conf generation algorithm

Issue ticket number and link

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

@pappz pappz changed the title Fix/disabled ns stub Support disabled resolved stub server mode Jan 24, 2024
@pappz pappz marked this pull request as ready for review January 24, 2024 13:03
lixmal
lixmal previously approved these changes Jan 24, 2024
client/internal/dns/file_parser_linux.go Outdated Show resolved Hide resolved
client/internal/dns/file_parser_linux.go Outdated Show resolved Hide resolved
client/internal/dns/file_parser_linux.go Outdated Show resolved Hide resolved
client/internal/dns/file_parser_linux.go Outdated Show resolved Hide resolved
client/internal/dns/file_parser_linux.go Outdated Show resolved Hide resolved
client/internal/dns/file_repair_linux.go Outdated Show resolved Hide resolved
client/internal/dns/file_repair_linux_test.go Outdated Show resolved Hide resolved
client/internal/dns/file_repair_linux_test.go Outdated Show resolved Hide resolved
client/internal/dns/file_repair_linux_test.go Outdated Show resolved Hide resolved
client/internal/dns/file_repair_linux.go Outdated Show resolved Hide resolved
lixmal
lixmal previously approved these changes Jan 24, 2024
@pappz pappz merged commit 4771fed into main Jan 24, 2024
21 checks passed
@pappz pappz deleted the fix/disabled-ns-stub branch January 24, 2024 15:47
Foosec pushed a commit to Foosec/netbird that referenced this pull request May 8, 2024
In the case of disabled stub listeren the list of name servers is unordered. The solution is to configure the resolv.conf file directly instead of dbus API.
Because third-party services also can manipulate the DNS settings the agent watch the resolv.conf file and keep it up to date.

- apply file type DNS manager if in the name server list does not exist the 127.0.0.53 address
- watching the resolv.conf file with inotify service and overwrite all the time if the configuration has changed and it invalid
- fix resolv.conf generation algorithm
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.

None yet

2 participants