Windows Server Cookbook for Windows Server 2003 and Windows 2000
Recipe 13.16. Viewing DNS Server Utilization Statistics
Problem
You want to view DNS Server utilization statistics. Solution
Using a graphical user interface
Using a command-line interface
Use the following command to display utilization statistics: > dnscmd <ServerName> /statistics
Using VBScript
' This code displays all statistics for the specified DNS Server ' ------ SCRIPT CONFIGURATION ------ strServer = "<ServerName>" ' e.g., dc1.rallencorp.com ' ------ END CONFIGURATION --------- set objDNS = GetObject("winmgmts:\\" & strServer & "\root\MicrosoftDNS") set objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name="".""") set objStats = objDNS.ExecQuery("Select * from MicrosoftDNS_Statistic ") for each objStat in objStats WScript.Echo " " & objStat.Name & " : " & objStat.Value next
Discussion
DNS Server keeps track of dozens of performance metrics. These metrics include the number of queries, updates, transfers, directory reads, and directory writes processed by the server. If you can pump these metrics into an enterprise management system, you can track DNS usage and growth over time. These statistics can also be useful to troubleshoot load-related issues. If you suspect a DNS Server is being overwhelmed with DNS update requests, you can look at the Dynamic Update Received/sec counter and see if it is processing an unusually high number of updates. Using a command-line interface
Each statistics category has an associated number (i.e., statid). You can obtain a subset of the statistics by providing a statid after the /statistics option. For a complete list of categories and their statid, run the following command: > dnscmd /statistics /?
Here is an example of viewing the Query (statid = 2) and Query2 (statid = 4) statistics: > dnscmd /statistics 6 DNS Server . statistics: Queries and Responses: ---------------------- Total: Queries Received = 14902 Responses Sent = 12900 UDP: Queries Recvd = 14718 Responses Sent = 12716 Queries Sent = 23762 Responses Recvd = 0 TCP: Client Connects = 184 Queries Recvd = 184 Responses Sent = 184 Queries Sent = 0 Responses Recvd = 0 Queries: -------- Total = 14902 Notify = 0 Update = 2207 TKeyNego = 184 Standard = 12511 A = 1286 NS = 29 SOA = 2263 MX = 0 PTR = 1 SRV = 8909 ALL = 0 IXFR = 0 AXFR = 0 OTHER = 23 Command completed successfully. Using VBScript
You can obtain a subset of statistics by adding a where clause to the WQL query. The following query would match only counters that start with Records: select * from MicrosoftDNS_Statistic where Name like 'Records%'
See Also
MSDN: MicrosoftDNS_Statistic |