_msdcs.** (例:_msdcs.contoso.com)在 DC2 (現在的唯一 DC+DNS) 上以管理員身分執行:
dnscmd /clearcache
ipconfig /flushdns
net stop netlogon
net stop dns
net start dns
net start netlogon
ipconfig /registerdns
原理:清除快取 → 停止 Netlogon (釋放動態註冊鎖) → 重啟 DNS 服務 (載入新建 _msdcs 區域) → 啟動 Netlogon (觸發 SRV 記錄動態註冊) → 強制客戶端註冊 A/AAAA 記錄。
在 DNS 主控台展開 _msdcs.contoso.com 區域,確認存在:
_ldap._tcp、_kerberos._tcp、_kpasswd._tcp 等 SRV 記錄指向 DC2dc、gc、pdc 等 CNAME/A 記錄_sites、_tcp、_udp 結構完整若父域區域 (contoso.com) 也缺失,同樣建立 AD 整合主要區域,並執行上述命令組合。子域委派記錄 (NS+Glue A) 需手動補充。
repadmin /showrepl DC2
repadmin /syncall /AdeP
# 確認 DomainDnsZones、ForestDnsZones 複寫正常
adsiedit.msc,連線至 DomainDnsZones 與 ForestDnsZones 命名內容CN=MicrosoftDNS 容器下是否有殘留的舊 DC 物件repadmin /syncall 強制複寫DNS 主控台 → 伺服器屬性 → 「進階」→「啟動時載入區域資料」改為「從登錄」→ 重啟 DNS 服務 → 改回「從 Active Directory」→ 重啟。強制重新從 AD 讀取區域資料。
| 措施 | 說明 |
|---|---|
| 所有 DC 部署 DNS | 避免單點故障,DC1/DC2 皆為 DNS 伺服器,區域 AD 整合雙主複寫 |
| 啟用 DNS 區域備份 | 雖 AD 自動複寫,但建議腳本定期 dnscmd /zoneexport 導出區域檔離線保存 |
| 監控關鍵 SRV 記錄 | Nagios/Zabbix 定期查詢 _ldap._tcp.dc._msdcs.domain 確保解析正常 |
| 文件化恢復流程 | 將本文流程納入 IT 災難恢復手冊,季度演練 |