Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I change My server IP. I have about 1000 dns A record on my windows dns , and have to change the value of this records, Is it possible that run a command , script to change the IP address on all records not changing one by one?

Also, is it possible to change IP address of All sites on IIS websites?

Thanks

share|improve this question
    
I am curious how you have a thousand DNS records pointing to a single server? –  tomjedrz Oct 30 '09 at 17:25
    
I have 200 Domains, and each one has 5 A record,it's a share hsoting service –  Ashian Oct 30 '09 at 17:32
2  
To avoid such problems in the future, use CNAME instead of A. –  Max Alginin Oct 30 '09 at 18:51

2 Answers 2

up vote 3 down vote accepted

You should be able to take a copy of your dns zone file and open it with an advanced text editor, such as Notepad++ and perform a find & replace on the records. Once the file is updated, stop your dns server, replace the existing zone file with your modified one and start the dns server.

share|improve this answer
    
I just can see Export list per Zone , but I can't find how can I restore modified files. –  Ashian Oct 30 '09 at 17:58
    
Use both techniques - DNSCMD to export your zone to a text file (I'm assuming it's AD-integrated), then edit the file (find & replace) and use DNSCMD again to re-import the edited file. –  RainyRat Oct 30 '09 at 18:11
1  
I find a folde called dns ( windows\system32\dns) and the open all dns files, the replace IPs and restart dns server. –  Ashian Oct 30 '09 at 18:38
    
@Ashian .. did this work? –  tomjedrz Oct 30 '09 at 19:11
    
@tomjedrz : yes that work :) –  Ashian Oct 30 '09 at 19:51

Try using dnscmd. Test the first change from the command prompt using dnscmd. To learn the syntax, use dnscmd /?.

Then create a batch file (i.e. runme.bat) or use powershell, whichever you prefer, with all of the commands.

For IIS, use appcmd from c:\windows\system32\inetsrv. Likely, use appcmd /? to get the syntax, or post back here for more assistance on the specifics.

share|improve this answer
    
both command not running,and not recognized as internal command, which is base folder? –  Ashian Oct 30 '09 at 18:02
    
appcmd is new for IIS7, so if you are using a prior version it won't be there. adsutil.vbs is the best command line option prior to appcmd. dnscmd should be in your path on your DNS server. It won't exist on a client machine though. –  Scott Forsyth - MVP Oct 30 '09 at 18:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.