Skip to content

Feature: Add option for global dns suffix - #3591

Merged
BornToBeRoot merged 13 commits into
mainfrom
feature/3559
Sep 7, 2026
Merged

BornToBeRoot merged 13 commits into
mainfrom
feature/3559

Conversation

@BornToBeRoot

Copy link
Copy Markdown
Owner

Changes proposed in this pull request

  • Add dns suffix to global network settings (custom suffix etc.)
  • Re-work dns server input
  • Add fallback to get the suffix from network interfaces if primary suffix fails
  • minor adjustments / bug fixes

Related issue(s)

To-Do

Contributing

By submitting this pull request, I confirm the following:

@mergify

mergify Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

DNS lists cannot be cleared, suffixes can become stale or invalid, and concurrent reconfiguration can publish inconsistent state.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds global DNS suffix resolution and modernizes custom DNS server configuration.

Changes:

  • Adds automatic/custom DNS suffix handling with adapter fallback.
  • Replaces text-based DNS servers with structured server/port entries.
  • Updates related UI, migration, localization, and documentation.
File summaries
File Description
Website/docs/application/dns-lookup.md Documents suffix fallback.
Source/NETworkManager/Views/SettingsNetworkView.xaml Adds DNS editor and suffix settings.
Source/NETworkManager/Views/ServerConnectionInfoProfileChildWindow.xaml.cs Adjusts initial focus.
Source/NETworkManager/Views/ServerConnectionInfoProfileChildWindow.xaml Supports read-only names.
Source/NETworkManager/Views/IPScannerView.xaml Sets status-column minimum width.
Source/NETworkManager/ViewModels/SettingsNetworkViewModel.cs Manages global DNS settings.
Source/NETworkManager/ViewModels/ServerConnectionInfoProfileViewModel.cs Exposes read-only name state.
Source/NETworkManager/MainWindow.xaml.cs Applies debounced DNS configuration.
Source/NETworkManager.Validators/MultipleIPAddressesValidator.cs Removes obsolete validation.
Source/NETworkManager.Utilities/DNSClientSettings.cs Adds suffix configuration fields.
Source/NETworkManager.Utilities/DNSClientHelper.cs Detects an adapter DNS suffix.
Source/NETworkManager.Utilities/DNSClient.cs Appends suffixes during lookups.
Source/NETworkManager.Settings/SettingsManager.cs Migrates legacy DNS servers.
Source/NETworkManager.Settings/SettingsInfo.cs Stores structured DNS and suffix settings.
Source/NETworkManager.Settings/GlobalStaticConfiguration.cs Adds defaults and debounce timing.
Source/NETworkManager.Models/Network/DNSLookup.cs Reuses suffix detection.
Source/NETworkManager.Localization/Resources/Strings.resx Adds “Not set” text.
Source/NETworkManager.Localization/Resources/Strings.Designer.cs Regenerates resource accessors.
Review details

Files not reviewed (1)

  • Source/NETworkManager.Localization/Resources/Strings.Designer.cs: Generated file
  • Files reviewed: 17/18 changed files
  • Comments generated: 6
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +278 to +282
private string AddDNSSuffixIfConfigured(string query)
{
return _addSuffix && !string.IsNullOrEmpty(query) && !query.Contains('.')
? $"{query}.{_settings.DNSSuffix}"
: query;
Comment on lines +25 to +31
var prioritizedAdapters = NetworkInterface.GetAllNetworkInterfaces()
.Where(nic => nic.OperationalStatus == OperationalStatus.Up &&
nic.NetworkInterfaceType != NetworkInterfaceType.Loopback &&
nic.NetworkInterfaceType != NetworkInterfaceType.Tunnel)
.OrderByDescending(nic => nic.GetIPProperties().GatewayAddresses.Count > 0)
.ThenByDescending(nic => GetInterfaceTypePriority(nic.NetworkInterfaceType))
.ThenByDescending(nic => nic.Speed);
Comment on lines +1923 to +1925
dnsSettings.DNSSuffix = SettingsManager.Current.Network_UseCustomDNSSuffix
? SettingsManager.Current.Network_CustomDNSSuffix?.TrimStart('.')
: DNSClientHelper.DetectDNSSuffix();
Comment on lines +203 to +204
([], true, true),
_profileDialogDefaultValues, info, true);
Comment on lines +69 to +71
<Binding Path="CustomDNSSuffix" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<validators:MultipleIPAddressesValidator ValidatesOnTargetUpdated="True" />
<validators:EmptyValidator ValidatesOnTargetUpdated="True" />
### Add DNS suffix (primary) to hostname

Add the primary DNS suffix to the hostname.
Add the primary DNS suffix to the hostname. If no primary DNS suffix is configured (e.g. the computer is not domain-joined), the connection-specific DNS suffix of the active network adapter is used instead.
@BornToBeRoot
BornToBeRoot requested a balanced review from Copilot September 6, 2026 23:42
@BornToBeRoot BornToBeRoot changed the title Feature/3559 Feature: Add option for global dns suffix Sep 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

DNS suffixing currently corrupts dotless IPv6 literals, alongside smaller endpoint-display and documentation issues.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • Source/NETworkManager.Localization/Resources/Strings.Designer.cs: Generated file
  • Files reviewed: 21/22 changed files
  • Comments generated: 4
  • Review effort level: Balanced

Comment on lines +276 to +278
return state.AddSuffix && !string.IsNullOrEmpty(query) && !query.Contains('.')
? $"{query}.{state.Settings.DNSSuffix}"
: query;
Comment on lines +159 to +161
private void RefreshCustomDNSServersDisplay()
{
CustomDNSServersDisplay = SettingsManager.Current.Network_CustomDNSServers.Count == 0 ? Strings.NotSet : string.Join("; ", SettingsManager.Current.Network_CustomDNSServers);
Comment thread Website/docs/changelog/next-release.md Outdated
Comment thread Website/docs/settings/network.md Outdated
@BornToBeRoot
BornToBeRoot merged commit bbf5e5e into main Sep 7, 2026
3 of 5 checks passed
@BornToBeRoot
BornToBeRoot deleted the feature/3559 branch September 7, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic DNS suffix

2 participants