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

Change DNS settings via netsh on remote XP computers. 1

Status
Not open for further replies.
Feb 11, 2005
153
US
We are on a windows 2003 domain we have multiple PC's with static ips and DNS entries across multiple sites so driving to each is not an option. We only have Remote Control as a tool and we don't want to have to check each machines status and call each use to not log them off the PC's. The users themseleves are not admins on their machines so we dont want to send our command line information that owrks locally. I know we can do the following locally at a PC and it will clear out the 3rd DNS entry that is no longer valid.

netsh interface ip set dns name="Local Area Connection" static 192.168.1.5
netsh interface ip add dns name="Local Area Connection" 192.168.1.6 index=2

Now when I do this locally at a PC logged on with admiin rights I can get to it. When I do an netsh -r Machinename I get the [Machinename] netsh> prompt but when I type in anything past interface ip I dont get the options for set dns or add dns that I get when connected locally.
 
It is looking for a context command, not a command line. Instead of opening a Netsh console session, try:

netsh -r MachineName interface ip set dns name="Local Area Connection" static 192.168.1.5
netsh -r MachineName interface ip add dns name="Local Area Connection" 192.168.1.6 index=2

In other words, use just the command line form specifying a remote machine.

 
This does not work either -

C:\Documents and Settings\User\Desktop>netsh -r Computername interface ip set dns name="Local Area Connection" static 192.168.1.5
The following command was not found: interface ip set dns "name=Local Area Connection" static 192.168.1.5.

I just note that when I go into the interface ip there is no set dns command when connected in to another machines netsh. I have full domain admin rights so this shouldn't be a problem should it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top