Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 2000 秘密武器:DNSCMD DNS 管理工具 (二) — 核心指令實戰與輸出解讀

編輯:Windows Server 教學

承接上篇工具簡介,本文詳細實測 dnscmd 三大核心指令:/Info 查詢伺服器屬性、/Config 重設伺服器/區域屬性、/Statistics 顯示/清除統計資料,含完整參數表、實際輸出範例與中文註解。

指令格式基礎

dnscmd 伺服器名稱 指令 [參數]

伺服器名稱可為:本機 (.)、IP 位址、FQDN、NetBIOS 名稱。

1. /Info — 查詢伺服器屬性

dnscmd ServerName /Info [Property]
  • 不指定 Property → 列出所有屬性
  • 實測範例 (IP 172.16.12.1):
C:\>dnscmd 172.16.12.1 /info
DNS Server 172.16.12.1 Information:
Query result: 查詢結果
Server info: 服務器信息
ptr = 00074718 端口
server name = myserver.microsoft.com 服務器名稱
version = C2000005 版本
DS container = c DS容器
Configuration: 配置信息
dwLogLevel = 00000000
dwDebugLevel = 00000000
dwRpcProtocol = FFFFFFFF
...
Configuration Flags: 配置標誌
fBootMethod = 3
fAdminConfigured = 1
fAllowUpdate = 1
fDsAvailable = 1
fAutoReverseZones = 1
fRoundRobin = 1
fLocalNetPriority = 1
fBindSecondaries = 1
...
Aging Configuration:
ScavengingInterval = 0
DefaultRefreshInterval = 168
DefaultNoRefreshInterval = 168
ServerAddresses: Addr[0] = 172.16.12.1
Forwarders: Addr[0] = 172.16.4.3, forward timeout = 5
Command completed successfully.

完整輸出提供感性認識,排錯時可快速比對關鍵旗標 (如動態更新、循環輪詢、轉送器等)。

2. /Config — 重設伺服器/區域屬性

dnscmd ServerName /Config [ZoneName | ..AllZones] Property Value
  • 未指定 ZoneName → 重設伺服器屬性
  • 指定 ZoneName 或 ..AllZones → 重設區域屬性
  • Property 範例:
    • 伺服器:/EnableRegistryBoot, /RpcProtocol, /LogLevel, /EventlogLevel
    • 區域:/SecureSecondaries, /AllowUpdate, /Aging, /RefreshInterval Value, /NoRefreshInterval Value
  • Value 為 DWORD 十六進位 (如 0x1)

3. /Statistics — 顯示/清除統計資料

dnscmd ServerName /Statistics [Filter | /Clear]
  • Filter (十六進位): 單次僅能用一個,如 0x1=Time, 0x2=Query, 0x4=Query2, 0x8=Recurse, 0x10=Master, 0x20=Secondary, 0x40=WINS, 0x100=Update, 0x400=DS, 0x10000=Memory, 0x40000=Dbase, 0x80000=Records 等
  • /Clear: 清除所有統計計數器
  • 不指定 Filter → 顯示所有統計 (輸出極大,建議參考支援工具說明文件)

掌握這三大指令,即可涵蓋 DNS 伺服器狀態監控、配置調整與效能統計分析的核心需求。

Copyright © Windows教程網 All Rights Reserved