The dnscmd CMD command is a command line utility used to manage and configure DNS servers from the Windows command prompt. It is part of the Windows Server operating system and is used to manage DNS server settings, such as creating and deleting zones, adding and removing records, and setting zone properties. It can also be used to monitor the performance of DNS servers and troubleshoot DNS problems.

What is the Syntax of the dnscmd CMD Command?

The syntax of the dnscmd CMD command is as follows:

  • dnscmd [server] [command] [parameters]

Where:

Parameter Description
server The name of the DNS server to be managed. If omitted, the local computer is used.
command The command to be executed. See the list of commands below.
parameters The parameters for the command. See the list of commands below for the available parameters.

What are the Available Commands for the dnscmd CMD Command?

The dnscmd CMD command has a variety of commands available for managing and configuring DNS servers. The following is a list of the available commands:

  • addzone – Adds a new DNS zone.
  • deletezone – Deletes an existing DNS zone.
  • enlistzone – Enlists a DNS zone in Active Directory.
  • unenlistzone – Unenlists a DNS zone from Active Directory.
  • addrecord – Adds a new DNS record.
  • deleterecord – Deletes an existing DNS record.
  • setzone – Sets the properties of a DNS zone.
  • showzone – Displays the properties of a DNS zone.
  • showstats – Displays the performance statistics of a DNS server.
  • showzones – Displays a list of DNS zones.
  • showrecords – Displays a list of DNS records.
  • resetzones – Resets the properties of all DNS zones.
  • resetstats – Resets the performance statistics of a DNS server.
  • flushcache – Flushes the DNS server cache.
  • help – Displays help information for the dnscmd command.

What are Some Examples of Using the dnscmd CMD Command?

The dnscmd CMD command can be used to manage and configure DNS servers from the Windows command prompt. Here are some examples of how to use the command:

Adding a New DNS Zone

To add a new DNS zone, use the addzone command. The syntax for the command is as follows:

  • dnscmd [server] addzone [zone_name] [zone_type] [parameters]

Where:

Parameter Description
zone_name The name of the DNS zone to be added.
zone_type The type of DNS zone to be added. Possible values are: Primary, Secondary, Stub, Forwarder, and Delegation.
parameters The parameters for the command. See the list of commands below for the available parameters.

For example, to add a primary DNS zone named “example.com”, use the following command:

  • dnscmd addzone example.com Primary

Deleting a DNS Zone

To delete an existing DNS zone, use the deletezone command. The syntax for the command is as follows:

  • dnscmd [server] deletezone [zone_name] [parameters]

Where:

Parameter Description
zone_name The name of the DNS zone to be deleted.
parameters The parameters for the command. See the list of commands below for the available parameters.

For example, to delete the DNS zone named “example.com”, use the following command:

  • dnscmd deletezone example.com

Conclusion

The dnscmd CMD command is a powerful command line utility used to manage and configure DNS servers from the Windows command prompt. It has a variety of commands available for managing and configuring DNS servers, such as adding and deleting zones, adding and deleting records, setting zone properties, and more. It can also be used to monitor the performance of DNS servers and troubleshoot DNS problems.

Leave a Reply