September 2003
Intermediate to advanced
624 pages
15h 49m
English
You want to view the zones on a server.
Open the DNS Management snap-in.
Right-click on DNS in the left pane and select Connect to DNS Server.
Enter the server you want to connect to and click Enter.
In the left pane, expand the server and click Forward Lookup Zones and Reverse Lookup Zones to view the supported zones.
> dnscmd <DNSServerName>/enumzones
' This code lists the zones that are supported by the specified server.
' ------ SCRIPT CONFIGURATION ------
strServer = "<DNSServerName>" ' e.g. dc1.rallencorp.com
' ------ END CONFIGURATION ---------
set objDNS = GetObject("winMgmts:\\" & strServer & "\root\MicrosoftDNS")
set objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name="".""")
set objZones = objDNS.ExecQuery("Select * from MicrosoftDNS_Zone " & _
"Where DnsServerName = '" & _
objDNSServer.Name & "'")
WScript.Echo "Zones on " & objDNSServer.Name
for each objZone in objZones
WScript.Echo " " & objZOne.Name
nextWhen you click on either the Forward Lookup Zones or Reverse Lookup Zones in the left pane, the right pane contains a Type column that displays the zone type for each zone.
When using the /enumzones switch without any more
parameters, it displays all zones on the server. You can specify
additional filters that limit the types of zones returned. With the
Windows 2000 version of dnscmd ...