How can I change the DNS server IP address in Windows XP from command line? I don't want to do it from UI every time I need since it requires a lot clicks.
Asked
Active
Viewed 3,102 times
2 Answers
4
FYI, You can update both the primary and secondary dns servers by using the following commands
netsh interface ip set dns name="Local Area Connection" source=static addr=10.0.0.1 register=PRIMARY
netsh interface ip add dns name="Local Area Connection" addr=10.0.0.2 index=2
-
1@Aaron I think second command has syntax error, index is not recognized in XP – yusuf Apr 07 '10 at 06:57
-
@erdogany Really? That might be an XP thing because i just ran it on windows 2003 and it worked. – Jul 16 '10 at 21:25
-
2Actually it works, take note that the 2nd one is `add dns` not `set dns`. I had the same problem earlier using `set dns` and it complaint that `index` is not a valid argument – faulty May 21 '12 at 02:56
-
thank you for highlighting this! I was also getting " 'index' is not a valid argument for this command." – Tony Sepia Jan 25 '18 at 03:03
3
In a command prompt:
netsh interface ip set dns "local area connection" static 10.0.0.1
You can list the interfaces on your PC using:
netsh interface ip show interfaces

ThatGraemeGuy
- 15,473
- 12
- 53
- 79