Basic platform?

Former-commit-id: 423e18edc3
This commit is contained in:
Owen
2025-11-23 21:26:15 -05:00
parent 24b5122cc1
commit 50008f3c12
15 changed files with 2187 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
//go:build windows
package dns
import "fmt"
// DetectBestConfigurator returns the Windows DNS configurator
// guid is the network interface GUID
func DetectBestConfigurator(guid string) (DNSConfigurator, error) {
if guid == "" {
return nil, fmt.Errorf("interface GUID is required for Windows")
}
return NewWindowsDNSConfigurator(guid)
}
// GetSystemDNS returns the current system DNS servers for the given interface
func GetSystemDNS(guid string) ([]string, error) {
configurator, err := NewWindowsDNSConfigurator(guid)
if err != nil {
return nil, fmt.Errorf("create configurator: %w", err)
}
servers, err := configurator.GetCurrentDNS()
if err != nil {
return nil, fmt.Errorf("get current DNS: %w", err)
}
var result []string
for _, server := range servers {
result = append(result, server.String())
}
return result, nil
}