Issues with DNS Resolution Policy: Unexpected Behavior in Subnet Configuration

谭振华 0 Reputation points
2025-03-05T03:25:53.1133333+00:00

I have a domain named contoso.com, and many clients have joined the contoso.com domain. Numerous A records have been configured within the contoso.com domain. Now, it is required that the 192.168.0.0/24 network segment resolves oa.contoso.com to a different IP address. I added a scope2025 using PowerShell and added a resolution policy.

# Define constants
$zoneName = "contoso.com"  # DNS zone name
$scopeName = "Scope2025"    # Zone scope name

# Define multiple subnets
$subnets = @(
    @{ Name = "192.168.20.0X24"; Subnet = "192.168.20.0/24" }
)

# Iterate through subnets and create
foreach ($subnet in $subnets) {
    $subNetName = "Subnet-$($subnet.Name)"
    $policyName = "pol-$($subnet.Name)"

    # Create subnet
    Add-DnsServerClientSubnet -Name $subNetName -IPv4Subnet $subnet.Subnet

    # Create resolution policy
    Add-DnsServerQueryResolutionPolicy -Name $policyName -Action ALLOW -ClientSubnet "eq,$subNetName" -ZoneScope "$scopeName,1" -ZoneName $zoneName

    Write-Host "Subnet $subNetName and policy $policyName have been created."
}

However, I encountered a few issues:

Both 192.168.0.0/24 and 192.168.1.0/24 are resolving to the A record of oa.contoso.com in scope2025, even though I did not configure a resolution policy for the 192.168.1.0/24 subnet. This issue does not occur with 192.168.20/24.

The 192.168.0.0/24 network segment can only resolve records within scope2025, and the original A records in contoso.com can no longer be resolved.

Windows Server 2022
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.