View a markdown version of this page

DNS _msdcs區域現代化 - AWS Directory Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

DNS _msdcs區域現代化

現代化 DNS _msdcs區域是建立混合 AD 目錄之前的必要先決條件。在現代 Active Directory 環境中, _msdcs.<ForestRoot> 會建立為儲存在 ForestDnsZones 應用程式分割區中的獨立全樹系複寫區域。在最初建置於 Windows NT 4.0 或 Windows 2000 (及後續升級) 的舊版環境中,永遠_msdcs不會分開;它直接以標準子網域 (子資料夾) 的形式存在於父網域區域檔案內。

在 DNS 已安裝的情況下提升新的網域控制器時,其安裝程序會尋找專用_msdcs.<ForestRoot>應用程式分割區。由於它找不到獨立區域,因此會自動在本機建立新的空白_msdcs區域,並對該命名空間宣告授權。這會完全中斷新的 DC 讀取父區域中的舊版子網域記錄,並更新 NS 委派以指向本身。

結果是架構衝突。所有加入網域的用戶端現在都稱為具有空白_msdcs區域的 DC,而實際的 DC 定位器記錄 (_ldap._tcp.dc._msdcs_kerberos._tcp.dc._msdcs、Global Catalog 記錄、DC GUID CNAMEs) 會保留在舊父區域子網域中,沒有任何用戶端可以連接它們。這會中斷整個樹系的 Kerberos 身分驗證、LDAP 探索和網站感知 DC 位置。

傳統與現代_msdcs區域設計

舊版 (委派的子網域)

Windows Server 2000、2003、2008 和 2008 R2 中的預設值。在此設計中, 會以委派子網域的形式_msdcs存在於父區域下。父區域中的 NS 記錄會指向特定 DCs,做為_msdcs命名空間的授權。

現代 (獨立區域)

Windows Server 2012 和更新版本中的預設值。在此設計中, 以自己的 AD 整合區域_msdcs.<forest>存在,透過 ForestDnsZones 應用程式分割區複寫至樹系中的所有 DCs。所有 DCs 都是授權的,可以直接讀取/寫入記錄。

如何識別_msdcs區域設計

您可以在任何網域控制站上執行下列動作來識別您的_msdcs區域設計:

  1. 列出所有 DNS 區域並尋找 _msdcs

    Get-DnsServerZone | Where-Object { $_.ZoneName -like "*_msdcs*" }

    現代設計 (不需要任何動作) — 您將看到 _msdcs.<forest-name> 列為主要區域:

    ZoneName ZoneType IsAutoCreated IsDsIntegrated IsReverseLookupZone IsSigned -------- -------- ------------- -------------- ------------------- -------- _msdcs.premier.local Primary False True False False

    舊版設計 (需要轉換)_msdcs.<forest-name> 將不會出現在區域清單中。相反地, 僅以委派子網域的形式_msdcs存在於您的樹系區域下。您可以透過檢查委派 NS 記錄來確認這一點:

    Get-DnsServerResourceRecord -ZoneName "<forest-name>" -Name "_msdcs" -RRType NS

    如果這會傳回 NS 記錄,您的環境會使用舊版委派子網域設計。

  2. 其他驗證 — 確認區域類型:

    # This will succeed on modern design Get-DnsServerZone -Name "_msdcs.<forest-name>" # If you get an error like "Zone _msdcs.<forest-name> was not found", you have the legacy design

如何現代化 DNS _msdcs區域

必須先執行這些步驟,才能開始建立 AWS Managed Microsoft AD Hybrid 目錄。所有步驟都會在具有 DNS Manager 存取權的現有自我管理網域控制器上執行,並具有網域管理員和 DnsAdmins 權限。

  1. 建立獨立_msdcs區域

    在現有的自我管理網域控制站上:

    dnscmd localhost /ZoneAdd "_msdcs.<forest-name>" /DsPrimary /dp /forest

    這會建立_msdcs.<forest-name>為具有全森林複寫範圍的專用 AD 整合區域。樹系中的所有 DCs都會透過 ForestDnsZones 分割區收到副本。

    等待 AD 複寫傳播:

    repadmin /syncall /AeD

    驗證區域是否存在 (在多個 DCs上執行):

    Get-DnsServerZone -Name "_msdcs.<forest-name>"
  2. 從父區域移除舊委派

    舊的_msdcs子網域節點及其記錄仍然存在於父區域中。必須移除這些項目,才能從新的獨立區域專門提供 DNS 查詢。

    # Remove the _msdcs subtree (NS delegation + all child records) from the parent zone dnscmd localhost /NodeDelete <forest-name> _msdcs /tree /f
    重要

    只有在步驟 1 確認已成功建立獨立區域之後,才能執行此步驟。如果您略過步驟 1,刪除舊記錄會導致立即中斷。

  3. 強制所有 DCs 重新註冊 SRV 記錄

    移除舊的子網域並備妥新的獨立區域後,所有 DCs 都必須將其定位器記錄重新註冊到新區域。

    在每個內部部署網域控制器上執行下列項目:

    # Flush DNS cache ipconfig /flushdns # Restart Netlogon — this triggers re-registration of all SRV, CNAME, and A records net stop netlogon net start netlogon # Force host record registration ipconfig /registerdns
  4. 確認

    等待 5-10 分鐘進行複寫,然後驗證:

    確認填入新獨立區域中的記錄:

    Get-DnsServerResourceRecord -ZoneName "_msdcs.<forest-name>" -RRType SRV

    您應該會看到所有現場部署 DCs _ldap._tcp.dc_ldap._tcp.gc、、 _kerberos._tcp.dc和網站特定記錄。

    確認 DNS end-to-end運作:

    Resolve-DnsName "_ldap._tcp.dc._msdcs.<forest-name>" -Type SRV Resolve-DnsName "_kerberos._tcp.dc._msdcs.<forest-name>" -Type SRV

    所有內部部署 DCs都應出現在結果中。

    確認舊委派已從父區域移除:

    Get-DnsServerResourceRecord -ZoneName "<forest-name>" -Name "_msdcs" -RRType NS -ErrorAction SilentlyContinue

    這應該不會傳回任何內容。

    如需現代化 DNS _msdcs區域的詳細資訊,請參閱 Microsoft Core Infrastructure and Security Blog 網站上的如何分割子網域 DNS 記錄並將其遷移至專用 DNS 區域

疑難排解

如果新的獨立區域在步驟 3 之後保持空白:

如果 Netlogon 認為記錄已存在,則可能不會重新註冊。強制重新註冊乾淨:

# Delete the Netlogon DNS registration cache Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\DnsAvoidRegisterRecords" -ErrorAction SilentlyContinue # Restart Netlogon again net stop netlogon net start netlogon

如果記錄仍未出現,請使用舊父區域 (可從備份或其他快取它們DCs 取得) 的值手動建立關鍵記錄:

# Example: SRV record for LDAP DC locator Add-DnsServerResourceRecord -ZoneName "_msdcs.<forest-name>" -Name "_ldap._tcp.dc" -Srv -DomainName "dc1.<forest-name>" -Priority 0 -Weight 100 -Port 389 # Example: SRV record for Kerberos DC locator Add-DnsServerResourceRecord -ZoneName "_msdcs.<forest-name>" -Name "_kerberos._tcp.dc" -Srv -DomainName "dc1.<forest-name>" -Priority 0 -Weight 100 -Port 88

如果應用程式在轉換後仍然失敗:

在受影響的應用程式伺服器和用戶端電腦上排清 DNS 快取:

ipconfig /flushdns

負 DNS 快取項目 (從中斷期間) 在過期前可能持續最多 900 秒 (15 分鐘)。