Scripting of DNS changes
This is a discussion about Scripting of DNS changes in the Windows Networking category; Hello all! I am relatively new around here so hopefully I will get the posting protocol right. I am in a work/school situation which requires 3 separate ip setups. The first is DHCP with the dns obtained at login.
Hello all!
I am relatively new around here so hopefully I will get the posting protocol right. I am in a work/school situation which requires 3 separate ip setups. The first is DHCP with the dns obtained at login. The second is static with primary and secondary dns servers. Finally, the third also is static with a different set of dns servers. I have been able to write a batch which changes the ip from DHCP to either of the statics depending on a passed commandline parameter, however I cannot find a way to change the dns. If it is available under netsh I cannot find it, nor can I find adequate documentation about how to script it.
I am going to try doing it by direct registry manipulation tonight, but this is undesirable for obvious reasons. Certainly if there is a manner of changing the ip, there is a manner of changing the dns, right???
Thanks,
-Brad
ps. System is an Athlon 1.2gHz on Win2k with 320mb of ram
I am relatively new around here so hopefully I will get the posting protocol right. I am in a work/school situation which requires 3 separate ip setups. The first is DHCP with the dns obtained at login. The second is static with primary and secondary dns servers. Finally, the third also is static with a different set of dns servers. I have been able to write a batch which changes the ip from DHCP to either of the statics depending on a passed commandline parameter, however I cannot find a way to change the dns. If it is available under netsh I cannot find it, nor can I find adequate documentation about how to script it.
I am going to try doing it by direct registry manipulation tonight, but this is undesirable for obvious reasons. Certainly if there is a manner of changing the ip, there is a manner of changing the dns, right???
Thanks,
-Brad
ps. System is an Athlon 1.2gHz on Win2k with 320mb of ram
Participate in our website and join the conversation
This subject has been archived. New comments and votes cannot be submitted.
Jun 14
Jun 14
0
1 minute
Responses to this topic
OP
Hello again!
I actually was able to figure it out after some good old fashioned tinkering. Id be happy to send the code to anyone who is interested.
--Brian
I actually was able to figure it out after some good old fashioned tinkering. Id be happy to send the code to anyone who is interested.
--Brian