共用方式為


Dnscmd Examples

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

DNSCmd Examples

Example 1: Set the current time on a time stamp to resource records

To set the current time on a time stamp to resource records, type:

dnscmd reskit.com /ageallrecords test.reskit.com

The following question is displayed:

Are you sure you want to force aging on node?

Type y to apply the time. Output similar to the following displays:

DNS Server reskit.com forced aging on records at root of zone test.reskit.com:
     Status = 0 (0x00000000)
Command completed successfully.

Example 2: Display a complete list of zones on a DNS server

To see a complete list of zones on your DNS server, type:

dnscmd reskit.com /enumzones

Output similar to the following displays:

Enumerated zone list: 
     Zone Count = 6.

.                             0 DS            Up=0
0.0.10.in-addr.arpa           0 DS   Rev      Up=1
0.in-addr.arpa                1 file Rev Auto Up=0
255.in-addr.arpa              1 file Rev Auto Up=0
reskit.com                    1 DS            Up=0 
test.reskit.com               1 file          Up=1 

Command completed successfully.

Example 3: Display a list of autocreated zones on a DNS server

To display a list of autocreated zones that are also reverse lookup zones on the DNS server, type:

dnscmd reskit.com /enumzones /auto-created /reverse

Output similar to the following displays:

Enumerated zone list: 
     Zone Count = 2.
0.in-addr.arpa                1 file Rev Auto Up=0 
255.in-addr.arpa              1 file Rev Auto Up=0 

Command completed successfully.

Example 4: Display the IsSlave setting from a DNS server

To display the IsSlave setting from a DNS server, type:

dnscmd reskit.com /info isslave

Output similar to the following displays:

Query result:
Dword: 0 (00000000)
Command completed successfully.

Example 5: Display the RecursionTimeout setting from a DNS server

To display the RecursionTimeout setting from a DNS server, type:

dnscmd reskit.com /info recursiontimeout

Output similar to the following displays:

Query result:
Dword: 15 (0000000F)
Command completed successfully.

Example 6: Delete the records from a node

To delete the records in a node, type:

dnscmd reskit.com /nodedelete test.reskit.com node /tree

The following question displays:

Are you sure you want to delete node's subtree? y

Type y to delete the subtree.

Output similar to the following displays:

DNS Server reskit.com deleted node at node.test.reskit.com:
     Status = 0 (0x00000000)
Command completed successfully.

To delete the records in a node using the host, type:

dnscmd reskit.com /NodeDelete test.reskit.com host /F

Output similar to the following displays:

DNS Server reskit.com deleted node at host.test.reskit.com:
     Status = 0 (0x00000000)
Command completed successfully.

Example 7: Display time statistics for a DNS server

To display time statistics for a DNS server, type:

dnscmd reskit.com /statistics 00000001

Output similar to the following displays:

DNS Server reskit.com statistics:

DNS Server Time Statistics:
Server start time 3/7/2001 1:07:31 PM
Seconds since start 8482
Stats last cleared 3/7/2001 1:07:31 PM
Seconds since start 8482

Command completed successfully.

Example 8: Display NbstatMem statistics for a DNS server

To display NbstatMem statistics for a DNS server, type:

DNSCmd reskit.com /Statistics 00200000

Output similar to the following displays:

DNS Server reskit.com statistics:

NBStat Memory Usage:
NBStat Buffers:
     Alloc = 0
     Free = 0
     NetAllocs = 0
     Memory = 0
     Used = 0
     Returned = 0
     InUse = 0
     InFreeList = 0

Command completed successfully.

Example 9: Delete a zone from a DNS server

To delete the test.reskit.com zone from a server, type:

dnscmd reskit.com /zonedelete test.reskit.com

The following question is displayed:

Are you sure you want to ZoneDelete? (y/n)

Type y to delete the zone.

Output similar to the following displays:

DNS Server reskit.com deleted zone test.reskit.com:
        Status = 0 (0x00000000)
Command completed successfully.

Example 10: Export zone resource records list to a file

To export the resource record list from the test.reskit.com zone on the reskit.com DNS server, type:

dnscmd reskit.com /zoneexport test.reskit.com test.reskit.com.dns

Output similar to the following displays:

DNS Server reskit.com exported zone
     test.reskit.com to file 
C:\Windows\System32\DNS\test.reskit.com.dns
Command completed successfully.

Example 11: Display RefreshInterval setting from the registry

To display the values in the RefreshInterval entry in the registry, type:

dnscmd reskit.com /zoneinfo test.reskit.com refreshinterval

Output similar to the following displays:

Zone query result:
Dword: 168 (000000A8)
Command completed successfully.

Example 12: Display Aging setting from the registry

To display the values in the Aging entry in the registry, type:

dnscmd reskit.com /zoneinfo test.reskit.com aging

Output similar to the following displays:

Zone query result:
Dword: 0 (00000000)
Command completed successfully.

See Also

Concepts

Dnscmd Overview
Dnscmd Syntax
Alphabetical List of Tools
Spcheck Overview
Nltest Overview
Netdom Overview
Netdiag Overview
Netcap Overview
Httpcfg Overview
Dnslint Overview
Dhcploc Overview
Dcdiag Overview
Browstat Overview