若您所建立的 DNS Service 未跟 Active Directory 整合,則您建立的 DNS 為標準主要區,若是跟 Active Directory 整合則為 Active Directory 整合主要區,本文為說明備份 DNS 標準主要區。
如何備份 DNS 標準主要區?
如何還原 DNS 標準主要區?
Windows Server 2003
您可將下面內容貼至筆記本後存檔為 .bat 並配合排定的工作來達成自動備份 DNS 標準主要區資料的目的,以下實作為利用 xcopy、regedit 指令來自動備份 DNS 標準主要區
rem ----- 將匯出機碼時間寫入 log 紀錄中 ----- echo 開始匯出機碼及複製 .dns >> D:\log\reg\%date:~0,4%%date:~5,2%%date:~8,2%.log TIME /T >> D:\log\reg\%date:~0,4%%date:~5,2%%date:~8,2%.log rem ----- 開始匯出機碼及複製 .dns ----- rem /S 複製每個目錄及其包含的子目錄,不複製空目錄 C:\WINDOWS\regedit.exe /e D:\dns\%date:~0,4%%date:~5,2%%date:~8,2%\DNS_Server.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server" C:\WINDOWS\regedit.exe /e D:\dns\%date:~0,4%%date:~5,2%%date:~8,2%\DNS.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS" xcopy C:\WINDOWS\system32\dns D:\dns\%date:~0,4%%date:~5,2%%date:~8,2%\ /S >> D:\log\reg\%date:~0,4%%date:~5,2%%date:~8,2%.log rem ----- 將結束匯出機碼及複製 .dns時間寫入 log 紀錄中 ----- echo 結束匯出機碼及複製 .dns >> D:\log\reg\%date:~0,4%%date:~5,2%%date:~8,2%.log TIME /T >> D:\log\reg\%date:~0,4%%date:~5,2%%date:~8,2%.log
[Windows 2003 DNS Server 備份及還原-Allen 電腦學習手札-新浪部落]