Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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

share|improve this answer

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
share|improve this answer
1  
@Aaron I think second command has syntax error, index is not recognized in XP –  erdogany Apr 7 '10 at 6:57
    
@erdogany Really? That might be an XP thing because i just ran it on windows 2003 and it worked. –  Aaron Carlson Jul 16 '10 at 21:25
    
Actually 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 2:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.