You want to enable DNS debug logging to troubleshoot issues related to DNS queries or updates.
18.104.22.168 Using a graphical user interface
22.214.171.124 Using a command-line interface
Use the following command to enable debug logging. You have to add together the event codes you want logged and specify the result in hex for the log level. The available event codes can be found in Table 15-3.
> dnscmd <DNSServerName> /Config /LogLevel <EventFlagSumInHex>
Use the following command to specify the location of the log file:
> dnscmd <DNSServerName> /Config /LogFilePath <DirectoryAndFilePath>
Use the following command to log only entries that pertain to certain IP addresses:
> dnscmd <DNSServerName> /Config /LogIPFilterList <IPAddress1>[,<IPAddress2> . . . ]
Use the following command to specify the maximum log file size:
> dnscmd <DNSServerName> /Config /LogFileMaxSize <NumberOfBytesInHex>
126.96.36.199 Using VBScript
' This code enables DNS debug logging. ' ------ SCRIPT CONFIGURATION ------ strServer = "<DNSServerName>" ' e.g. dc1 ' The log level must be in decimal, not hex like dnscmd intLogLevel = <EventFlagSumInDecimal> ' e.g. 65535 arrFilterList = Array("<IPAddress1>") ' e.g. 192.168.1.12 strFilePath = <DirectoryAndFilePath> ' e.g. c:\dnslog.txt intFileSize = <NumberOfBytesInDecimal> ' e.g. 50000000 ' ------ END CONFIGURATION --------- set objDNS = GetObject("winMgmts:\\" & strServer & "\root\MicrosoftDNS") set objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name="".""") objDNSServer.LogLevel = intLogLevel objDNSServer.LogIPFilterList = arrFilterList objDNSServer.LogFilePath = strFilePath objDNSServer.LogFileMaxSize = intFileSize objDNSServer.Put_ WScript.Echo "Enabled DNS Debug Logging on " & strServer
With the DNS Server debug log, you can record all DNS operations received and initiated by the server, including queries, updates, zone transfers, etc. If you need to troubleshoot a particular host, you can use the LogIPFilterList setting in dnscmd or the WMI DNS Provider to restrict the log to operations performed only for or by that host.
The most important debug log setting is the log level. With the DNS Console, you can select from a list of available options. With Windows Server 2003, the DNS Console provides an intuitive interface for selecting the required options. On Windows 2000, you are presented with a list of check boxes and you have to figure out which ones need to be used in conjunction with one another. You have a similar issue with CLI and VBScript solutions, where you need to determine what log level you want to set.
Table 15-3 contains all of the event codes with their hexadecimal and decimal values.
DNS debug logging can come in handy if you want to look at the dynamic update requests a particular DNS server is processing. For example, if a client or DHCP server is attempting to dynamically register records, you can enable the Update Transactions log category on the DNS server you think should be processing the updates. If you don't see any update transactions, that can indicate another server is processing the dynamic update requests.
15.6.4 See Also