Skip to content

Commit 95794f5

Browse files
authored
[client] fix Windows NRPT Policy Path (#4572)
[client] fix Windows NRPT Policy Path
1 parent 9bcd3eb commit 95794f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client/internal/dns/host_windows.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,17 @@ func (r *registryConfigurator) addDNSMatchPolicy(domains []string, ip netip.Addr
240240
// if the gpo key is present, we need to put our DNS settings there, otherwise our config might be ignored
241241
// see https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-gpnrpt/8cc31cb9-20cb-4140-9e85-3e08703b4745
242242
for i, domain := range domains {
243+
localPath := fmt.Sprintf("%s-%d", dnsPolicyConfigMatchPath, i)
244+
gpoPath := fmt.Sprintf("%s-%d", gpoDnsPolicyConfigMatchPath, i)
243245

244246
singleDomain := []string{domain}
245247

246-
if err := r.configureDNSPolicy(dnsPolicyConfigMatchPath, singleDomain, ip); err != nil {
248+
if err := r.configureDNSPolicy(localPath, singleDomain, ip); err != nil {
247249
return i, fmt.Errorf("configure DNS Local policy for domain %s: %w", domain, err)
248250
}
249251

250252
if r.gpo {
251-
if err := r.configureDNSPolicy(gpoDnsPolicyConfigMatchPath, singleDomain, ip); err != nil {
253+
if err := r.configureDNSPolicy(gpoPath, singleDomain, ip); err != nil {
252254
return i, fmt.Errorf("configure gpo DNS policy: %w", err)
253255
}
254256
}

0 commit comments

Comments
 (0)