DNS management using Powershell

DNSCMD is powerful command line utility to manage the DNS in windows environment. The details for DNSCMD comes into a rescue for such scenarios.



  • displays and changes the properties of DNS servers zones, and resource records
  • manually modifies these properties, creates and deletes zones and resource records
  • Forces replication events between DNS server physical memory DNS databases and data files.

Clearcache (DNS)

  • C:>dnscmd dc1.lab.local /clearcache

Recorddelete (PTR)

  • C:>dnscmd /recorddelete 20.20.20.in-addr.arpa. 123 PTR


  • Dnscmd /RecordAdd will not generally perform a replace.
  • D:>dnscmd /RecordAdd lab.local W10PC A
  • Add A Record for W10PC.lab.local lab.local


  • D:>dnscmd /RecordAdd lab.local test A
  • Add A Record for test. lab.local at lab.local


  • PS C:UsersAdministrator> dnscmd /enumrecords lab.local test


  • D:>dnscmd /RecordDelete lab.local test A

Recordadd (A record)

  • D:>dnscmd /RecordAdd lab.local test A


For more detailed list of command and arguments here is the technet: https://technet.microsoft.com/en-us/library/cc772069.aspx


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s