Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1537
  • Last Modified:

Command line to set my Preferred and Alternate DNS Servers

Is there a command line command to set my Preferred and Alternate DNS Servers in Windows XP?

Thank you.
0
Dan788
Asked:
Dan788
  • 4
  • 2
1 Solution
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
0
 
theruckCommented:
http://support.microsoft.com/?kbid=257748
it is easy like:

netsh interface ip set dns name="Local Area Connection" static 192.168.1.1
0
 
theruckCommented:
sorry id id not look at leews answer which is same as mine and correct :)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Dan788Author Commented:
Thank you leew and theruck

This works for the Preferred, but I get the following error using Alternate.  BTW, my intent here is to email everyone a batch file (containing this command) to set there Alternate DNS server.

C:\>netsh interface ip set dns  "Local Area Connection" static 192.168.0.2 alternate
alternate is not an acceptable value for register.
0
 
theruckCommented:
use netsh interface ip add dns "Local Area Connection" 192.168.0.3 index=1
for primary and
netsh interface ip add dns "Local Area Connection" 192.168.0.2 index=2
for secondary dns

maybe you have to delte the values first so
use netsh interface ip delete dns "Local Area Connection" all
first
0
 
Dan788Author Commented:
Great!  index=2 works!

Thank you both
0
 
theruckCommented:
thank you?? and?
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now