Tuesday, March 11, 2008

DNSCMD POWERFULL DNS MANAGEMENT IN WINDOWS



DNSCMD is powerful command line utility to manage the DNS in windows environment. Okay I need to say thanks to Paul Yu (Microsoft Consulting Services,Public Sector/Federal Practice) for giving me the directions with DNSCMD. After he listen to my complains about the DNS MMC, he said why arent you using DNSCMD, and this is how I start using it.One of the key points with windows is the GUI that everyone loves. The GUI may become insufficient in a large environment such where I am at, to manage the DNS. (Over 20.000 DNS records). Those of you use and know UNIX will smile and understand the power of simple management of UNIX command line. The windows DNS MMC may become insufficient and frustrating in some scenarios, therefore it is good to have more powerful command line utility to manage the large DNS databases. So here it is DNSCMD comes into a rescue for such scenarios.

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.

So open up CMD window and practice below commands. (PS: My domain name is SMTP25.org, so whenever you see SMTp25.org, replace it with your own DNS name space name. Also bear in mind my IP address range for my domain is 10.10.10.X so you will have to replace this with your own as well.)

Clearcache (DNS)

  • C:\>dnscmd dc1.smtp25.org /clearcache
  • dc1.smtp25.org completed successfully.
  • Command completed successfully.

Recorddelete (PTR)

  • C:\>dnscmd /recorddelete 10.10.10.in-addr.arpa. 123 PTR
  • Are you sure you want to delete record? (y/n)y
  • Deleted PTR record(s) at 10.10.10.in-addr.arpa.
  • Command completed successfully.

RecordAdd

  • Dnscmd /RecordAdd will not generally perform a replace.
  • D:\>dnscmd /RecordAdd SMTP25.org MytestPC A 10.10.10.102
  • Add A Record for MytestPC.SMTP25.org SMTp25.org
  • Command completed successfully.

RecordAdd

  • D:\>dnscmd /RecordAdd SMTP25.org test A 10.10.10.101
  • Add A Record for test.SMTP25.orgat SMTP25.org
  • Command completed successfully.

enumrecords

  • PS C:\Users\Administrator> dnscmd /enumrecords smtp25.org test
  • Returned records:
  • @ 3600 CNAME test.test.com.
  • Command completed successfully.

RecordDelete

  • D:\>dnscmd /RecordDelete SMTP25.org test A
  • Are you sure you want to delete record? (y/n) y
  • Deleted A record(s) at SMTP25.org
  • Command completed successfully.

Recordadd (A record)

  • D:\>dnscmd /RecordAdd SMTP25.orgtest A 10.10.10.103
  • Add A Record for test.SMTP25.orgat SMTP25.org
  • Command completed successfully.

Technet

Oz ozugurlu,

Systems Engineer

MCITP (EMA), MCITP (SA),

MCSE 2003 M+ S+ MCDST

Security Project+ Server+

oz@SMTp25.org

http://smtp25.blogspot.com (Blog)


No comments: