View a markdown version of this page

DNS _msd cs 区域现代化 - AWS Directory Service

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

DNS _msd cs 区域现代化

在创建混合 AD 目录之前,必须先对 DNS _msdcs 区域进行现代化改造。在现代 Active Directory 环境中,被创建为存储在 ForestDnsZones 应用程序分区中的一个单独的林级复制区域。_msdcs.<ForestRoot>在最初基于 Windows NT 4.0 或 Windows 2000(随后进行了升级)的旧环境中,_msdcs它从未分离过;它只是作为标准子域(子文件夹)直接存在于父域区域文件中。

在升级安装了 DNS 的新域控制器时,其安装过程会寻找专用的_msdcs.<ForestRoot>应用程序分区。由于它找不到独立区域,因此它会在本地自动创建一个新的空白_msdcs区域,并声称对该命名空间拥有权限。这完全切断了新 DC 读取父区域中旧子域记录的权限,并将 NS 委托更新为指向自身。

结果是架构冲突。现在,所有加入域的客户端都被引用到具有空_msdcs区域的 DC,而实际的 DC 定位器记录(、、Global Catalog 记录_ldap._tcp.dc._msdcs_kerberos._tcp.dc._msdcs、DC GUID CName)仍滞留在旧的父区域子域中,任何客户端都无法访问它们。这会破坏整个林中的 Kerberos 身份验证、LDAP 发现和站点感知的 DC 位置。

传统与现代 _msd cs 区域设计

旧版(委托子域)

在 Windows Server 2000、2003、2008 和 2008 R2 中为默认值。在此设计中,作为委托子域_msdcs存在于父区域下。父区域中的 NS 记录指向特定的 DC 对_msdcs命名空间具有权威性。

现代(独立区域)

在 Windows 服务器 2012 及更高版本中为默认设置。在此设计中,作为自己的 AD-integrated区域_msdcs.<forest>存在,通过 ForestDnsZones 应用程序分区复制到林中的所有 DC。所有 DC 均具有权威性,可以直接 read/write 记录。

如何识别 _msd cs 区域设计

您可以通过在任何域控制器上运行以下命令来确定您的_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 _msdc s 区域进行现代化改造

在开始创建 AWS 托管 Microsoft AD Hybrid 目录之前,必须执行这些步骤。所有步骤均在现有的自行管理的域控制器上执行,这些域控制器具有 DNS 管理器访问权限,具有域管理员和 DnsAdmins 权限。

  1. 创建独立_msdcs区域

    在现有的自行管理的域控制器上:

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

    这将创建_msdcs.<forest-name>为具有 Forest-wide 复制范围的专用 AD-integrated 区域。林中的所有 DC 都将通过该 ForestDnsZones 分区收到一份副本。

    等待 AD 复制传播:

    repadmin /syncall /AeD

    验证区域是否存在(在多个 DC 上运行):

    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. 强制所有 DC 重新注册 SRV 记录

    移除旧子域名并启用新的独立区域后,所有 DC 都必须将其定位器记录重新注册到新区域。

    在每个本地域控制器上运行以下命令:

    # 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. Verify

    等待 5-10 分钟进行复制,然后验证:

    确认在新的独立区域中填充的记录:

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

    您应该看到所有本地 DC 的_ldap._tcp.dc_kerberos._tcp.dc_ldap._tcp.gc、、和特定于站点的记录。

    确认 DNS 解析端到端有效:

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

    所有本地 DC 都应出现在结果中。

    确认旧的委托已从父区域中消失:

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

    这应该什么都不返回。

    有关实现 DNS _msdcs 区域现代化的更多信息,请参阅 Microsoft 核心基础设施和安全博客网站上的如何拆分子域 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

如果仍未显示记录,请使用旧父区域(可从备份或缓存这些记录的其他 DC 中获得)中的值手动创建关键记录:

# 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 分钟),然后才会过期。