Feature: Add option for global dns suffix - #3591
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
🟡 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.
| private string AddDNSSuffixIfConfigured(string query) | ||
| { | ||
| return _addSuffix && !string.IsNullOrEmpty(query) && !query.Contains('.') | ||
| ? $"{query}.{_settings.DNSSuffix}" | ||
| : query; |
| 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); |
| dnsSettings.DNSSuffix = SettingsManager.Current.Network_UseCustomDNSSuffix | ||
| ? SettingsManager.Current.Network_CustomDNSSuffix?.TrimStart('.') | ||
| : DNSClientHelper.DetectDNSSuffix(); |
| ([], true, true), | ||
| _profileDialogDefaultValues, info, true); |
| <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. |
There was a problem hiding this comment.
🟡 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
| return state.AddSuffix && !string.IsNullOrEmpty(query) && !query.Contains('.') | ||
| ? $"{query}.{state.Settings.DNSSuffix}" | ||
| : query; |
| private void RefreshCustomDNSServersDisplay() | ||
| { | ||
| CustomDNSServersDisplay = SettingsManager.Current.Network_CustomDNSServers.Count == 0 ? Strings.NotSet : string.Join("; ", SettingsManager.Current.Network_CustomDNSServers); |
Changes proposed in this pull request
Related issue(s)
To-Do
Contributing
By submitting this pull request, I confirm the following: