Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Change DNS on 200 Computers

Status
Not open for further replies.

gtownlady

MIS
Nov 21, 2002
11
0
0
US
We have been having problems with our DNS servers off-site becoming unavailable. I was asked to build our own DNS server. Now I have the task of pointing all 200 workstations to the new DNS server. I know how to write scripts to run at logon time to execute registry changes. However, this registry entry contains a unique qualifier and I am uncertain how to reference this 'unique qualifier' so that the registry entry for "NameServer" can be located for each workstation. We are using static IP addresses.
 
I had asked third parties on your issue, and so far, you are gonna have to set it manually, if there's a way, it might be a utility. I hope someone can enlighten us with a better solution.

============================
There is no place like 127.0.0.1
 
Im just wondering why you are using static ips for 200 workstations it seems like alot of excess trouble to use them. I would suggest switching to a DHCP dynamic setup then any future changes can be done from 1 server.

 
Have you gone through the sample scripts at the microsoft scriptcenter on technet?


In the networking section is a script for configuring DNS search order.

There is also the netsh command line utility that could be of use to you. Search here, MS, Google for netsh to get more help in using that utility.

If you need to stay with static IP, you could start using DHCP reservations to get the desired result while still having the benefit of DHCP to maintain the other settings.
 
I also agree with Faithless. If you did DHCP Dynamic any changes you made would auto be detected by the clients. And DHCP is very simple to setup as long as you got a win2k server.
 
Heres a script that might help you

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard in colNetCards
arrDNSServers = Array("192.168.1.100", "192.168.1.200")
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
Next


Just change the IP's.

 
I had looked at the sample scripts but when it said you needed WMI installed, I wigged out. I think I confused myself.
FaiTHLeSS's script is basically the same as the sample scripts. Thanks everyone!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top