?
Solved

How to script & automate simple Windows DNS change?

Posted on 2007-07-20
4
Medium Priority
?
3,830 Views
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.  
0
Comment
Question by:pseudocyber
  • 3
4 Comments
 
LVL 26

Accepted Solution

by:
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.
Syntax:
DNSCmd.exe <DNSServerIP/Name> /RecordAdd <ZoneName> <CNameToDelete> CNAME <FQDN>

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

Batch-1:
DNSCmd.exe 172.16.96.11 /RecordAdd Training.com myweb.company.com CNAME webserver2.company.com

Batch-2:
DNSCmd.exe 172.16.96.11 /RecordAdd Training.com myweb.company.com CNAME webserver1.company.com

For more info visit:
http://technet2.microsoft.com/windowsserver/en/library/29578757-6a77-4b96-9996-20405689a0791033.mspx?mfr=true

To download Windows 2000 support tools visit:
http://www.petri.co.il/dnscmd_command_in_windows_2000_2003.htm

Hope this helps
0
 
LVL 26

Expert Comment

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

Expert Comment

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

Author Closing Comment

by:pseudocyber
ID: 31407521
Thanks.
0

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