How can I easily administer DNS servers by using the command prompt?

A GUI interface is great for novice administrators but is cumbersome if you have to perform the same task over and over again. Command line tools can be more efficient than GUI tools. Dnscmd.exe is one of the support tools from Support.cab, which is located in the support’tools directory on the Windows 2000 CD.

Dnscmd is provided as a command-line interface for managing DNS servers. This tool can be used to script batch files, to help automate management and update of existing DNS server configurations or to perform setup and configuration of new DNS servers on your network.

DNSCmd displays and changes the properties of DNS servers, zones, and resource records. It manually modifies these properties, creates and deletes zones and resource records, and forces replication events between DNS server physical memory and DNS databases and data files. Some operations of this tool work at the DNS server-level while others work at the zone-level.

You can use Dnscmd on any Windows 2000 or XP computer as long as the user that is running the application is a member in the Administrators or Server Operators group on the target computer. Both the user account and the server computer must be members of the same domain or reside within trusted domains.

Sponsored Content

Maximize Value from Microsoft Defender

In this ebook, you’ll learn why Red Canary’s platform and expertise bring you the highest possible value from your Microsoft Defender for Endpoint investment, deployment, or migration.

Dnscmd.exe can be used to:

  • Get DNS server info;
  • Initiate server scavenging;
  • Enumerate and view zone info;
  • Create, delete, pause, and resume zones;
  • Change zone type (standard primary, standard secondary, AD integrated);
  • Add, delete, and enumerate records in a zone.

For example, to create a new standard primary zone called dpetri.net on a server named srv1.dpetri.net and stored in dpetri.net.dns files:

​dnscmd srv1.dpetri.net /ZoneAdd dpetri.net /Primary /file dpetri.net.dns

The syntax for adding DNS A records is similar:

​Dnscmd server_name /RecordAdd zone_name computer_name A IP_address

To add an A record for comp1 with an IP address of in the dpetri.net zone on srv1.dpetri Windows Server 2003:

​Dnscmd srv1.dpetri.net /RecordAdd dpetri.net comp1 A

To manually force zone replication:

​Dnscmd server_name /ZoneRefresh zone_name


Download Windows 2000 SP4 Support Tools (11.24mb)

Related Topics:

External Sharing and Guest User Access in Microsoft 365 and Teams

This eBook will dive into policy considerations you need to make when creating and managing guest user access to your Teams network, as well as the different layers of guest access and the common challenges that accompany a more complicated Microsoft 365 infrastructure.

You will learn:

  • Who should be allowed to be invited as a guest?
  • What type of guests should be able to access files in SharePoint and OneDrive?
  • How should guests be offboarded?
  • How should you determine who has access to sensitive information in your environment?

Sponsored by: