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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Static Addresses - Wish to set DNS server using script. 1

Status
Not open for further replies.

mizzy

IS-IT--Management
Jun 28, 2001
277
AU

Hi there,

All my workstations are configured with static addresses(long story). Is it possible to change the DNS setting on these workstatiosn(XP&2000) using a command line script at logon or do I have to use a group policy or do I have to visit 100 PC's and change the DNS setting manually?

Currently these workstations are logging on to an NT4 domain. I'm prepping them for the AD.

Many thanks
 
The VBS guys will give you a good script for this. As you are in a NT 4 network, the netsh command maybe your friend here. Just need to place it in your logon script.
have a look at for how to use netsh.

Note the "netsh interface ip set dns "Local Area Connection" static 192.168.0.200" example part.

Claudius (What certifications??)
 
I usually do not like using netsh for this type of scripting to many clients. The reason is that you have to identify the network connection name. What if there are multiple network connections/ Or if one is renamed? It will not work. I prefer to use vb because it can loop thru all adapters or connections.

Tell me exactly how you want your settings to be and how they are now. I'll see if i can give you some code to work.

-DJ
 

Many thanks for all your help.

All the workstations are in 192.168.1.0/24

Most of the the workstations only have one connection "Local Area Connection". There are one or two guys in accounts with modems for banking s/w.

Around 20 of the workstations already have two DNS servers set(required for an app they use). The rest do not have a DNS.(I've noticed netsh removes any existing DNS settings, but I guess I could use forwarding to get around that).

The new DNS server(DNS intergrated into AD, with Dynamic updates) will be 192.168.1.40/24. Other than that thats it.



Regards

p.s By the way. The reason for doing this will allow me to migrate the workstations from the NT4 domain to the 2003 domain(which will have a DNS server 192.168.1.40). To do this I'm using the Active Directory Migration Tool. Currently I do not have a DNS server in my office, those 20 workstations mentioned above are pointing to a DNS server on the internet.
 
as long as you setup all your scope options in DHCp to give out the right info for DNS/WINS/Gateway IP addresses, you'll be fine...

Aftertaf
________
Regain control of your PC, at
 
aftertaf,
What part of the original post "All my workstations are configured with static addresses" didn't you understand? Changing the DNS server address in the DHCP scope won't help here, as they ARE NOT USING DHCP!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top