How to script & automate simple Windows DNS change?

Posted on 2007-07-20
Medium Priority
Last Modified: 2010-04-21
I have to make a DNS change at a certain time - say 9:00 PM tonight ;).  It's simply changing a cname to point to a different FQDN.

So, lets say I want to change myweb.company.com  to go from webserver1.company.com to instead point to webserver2.company.com.

I know nothing about scripting, but shirley ( ;)) this is simple to do and automate?  How to do it please, in simple network engineer (not Windows engineer) terms ... ;)

DNS server is Windows 2003 server.  Normally I use MMC to do IP Address Management.  
Question by:pseudocyber
  • 3
LVL 26

Accepted Solution

Farhan Kazi earned 2000 total points
ID: 19530733
Greetings pseudocyber,

You can do this by using 'Dnscmd' command line utility comes with Windows 2000 support tools.
DNSCmd.exe <DNSServerIP/Name> /RecordAdd <ZoneName> <CNameToDelete> CNAME <FQDN>

Make a 2 batch files with following code schedule them with with Scheduled Tasks.

DNSCmd.exe /RecordAdd Training.com myweb.company.com CNAME webserver2.company.com

DNSCmd.exe /RecordAdd Training.com myweb.company.com CNAME webserver1.company.com

For more info visit:

To download Windows 2000 support tools visit:

Hope this helps
LVL 26

Expert Comment

by:Farhan Kazi
ID: 19530740
Sorry typo mistake:
DNSCmd.exe <DNSServerIP/Name> /RecordAdd <ZoneName> <CNameToAdd/Change> CNAME <FQDN>
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20255563
Any update pseudocyber?
LVL 27

Author Closing Comment

ID: 31407521

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
Most folks would know the basics of how Dropbox works, so that’s not the purpose of this article. Security is what it’s all about, so here I’ll share how I choose to secure my Dropbox Account and the Data it contains.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question