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.

LAB-0002

DNSCMD

  • 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

RecordAdd

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

RecordAdd

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

enumrecords

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

RecordDelete

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

Recordadd (A record)

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

 

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

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s