Windows Tools

DNSCmd Examples

Overview | Syntax | Examples | Related Tools Open Command Prompt

Example 1: Set the Current Time on a Timestamp to Resource Records

To set the current time on a timestamp 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

Results similar to the following output display:


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 Auto-Created 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

Results similar to the following output display:


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

If you want to display the IsSlave setting from a DNS server, type:

dnscmd reskit.com /info isslave

Results similar to the following output display:


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

Results similar to the following output display:


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

Results similar to the following output display:


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

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

Results similar to the following output display:


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

Results similar to the following output display:

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

Results similar to the following output display:

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 apply the time.

Results similar to the following output display:


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

Results similar to the following output display:


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

Results similar to the following output display:


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

Results similar to the following output display:


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