共用方式為


DNS 伺服器地理位置原則無法如預期般運作

適用於: Windows Server 2019,所有版本的 Windows Server 2019 Datacenter:Azure 版本 - 預覽

徵狀

假設組織使用 AD 整合區域 (其內部工作站和伺服器的預設區域範圍) 名為 contoso.com。 組織想要為其分支實作地理位置 DNS 結構,讓特定站台中的用戶端可以從其本機子網存取內部網路服務。

DNS 區域的設定類似下列結構。

子網路 IPv4 位址空間 區域範圍名稱
NorthAmericaSubnet 192.168.3.0/24 NorthAmericaZoneScope
CentralAmericaSubnet 192.168.6.0/24 CentralAmericaZoneScope
SouthAmericaSubnet 192.168.7.0/24 SouthAmericaZoneScope

組織會使用下列 Windows PowerShell Cmdlet 來註冊主機位址 (A) 記錄:

Add-DnsServerResourceRecord -ZoneName "contoso.com" -A -Name "www" -IPv4Address "192.168.3.40" -ZoneScope "NorthAmericaZoneScope"
Add-DnsServerResourceRecord -ZoneName "contoso.com" -A -Name "www" -IPv4Address "192.168.6.40" -ZoneScope "CentralAmericaZoneScope"
Add-DnsServerResourceRecord -ZoneName "contoso.com" -A -Name "www" -IPv4Address "192.168.7.40" -ZoneScope "SouthAmericaZoneScope"

組織會使用下列 PowerShell Cmdlet 來定義原則:

Add-DnsServerQueryResolutionPolicy -Name "NorthAmericaPolicy" -Action ALLOW -ClientSubnet "eq,NorthAmericaSubnet" -ZoneScope "NorthAmericaZoneScope,1" -ZoneName "contoso.com"
Add-DnsServerQueryResolutionPolicy -Name "CentralAmericaPolicy" -Action ALLOW -ClientSubnet "eq,CentralAmericaSubnet" -ZoneScope "CentralAmericaZoneScope,1" -ZoneName "contoso.com"
Add-DnsServerQueryResolutionPolicy -Name "SouthAmericaPolicy" -Action ALLOW -ClientSubnet "eq,SouthAmericaSubnet" -ZoneScope "SouthAmericaZoneScope,1" -ZoneName "contoso.com"

預期的結果是用戶端會先嘗試在區域範圍中,然後在預設區域範圍中找出要求的資源。 不過,組織設定這些原則之後,來自已定義子網的用戶端就無法成功解析預設區域範圍 (contoso.com) 中裝載的記錄。 例如,客戶端無法解 析 hostA.contoso.com。 當它收到這類要求時,DNS 伺服器會傳回「伺服器失敗」訊息。

原因

在此情況下,傳入的授權查詢會根據優先順序的順序,根據適當的區域層級原則集進行評估。 似乎很直覺,任何不符合原則的查詢都會從預設區域範圍自動提供服務。 不過,這不是真的。 相反地,任何不相符的查詢會觸發名稱解析失敗。 也就是說,如果 DNS 伺服器從用戶端子網原則中指定的用戶端收到 hostA.contoso.com 的名稱解析查詢,DNS 伺服器只會檢查相關的區域範圍。

解決方案

若要設定原則,讓 DNS 伺服器除了檢查區域範圍之外還會檢查預設區域範圍,請使用更精確的 DnsServerQueryResolutionPolicy 語句,如下所示:

Add-DnsServerQueryResolutionPolicy -Name "NorthAmericaPolicy" -Action ALLOW -ClientSubnet "eq,NorthAmericaSubnet" -ZoneScope "NorthAmericaZoneScope,1" -ZoneName "contoso.com" -FQDN "www.contoso.com"

注意事項

您必須為適當區域範圍包含的每一筆記錄建立語 DnsServerQueryResolutionPolicy 句。