Skip to main content

windows 7 - How can I set my DNS settings using the command-prompt or PS?


Through the CLI (either cmd.exe or PowerShell) on Windows 7, how do I edit the TCP/IP DNS parameters for a specific network adapter?



Answer



netsh.exe


netsh interface ip set dns name="Local Area Connection" source=static addr=none

netsh interface ip add dns name="Local Area Connection" addr=8.8.4.4 index=1
netsh interface ip add dns name="Local Area Connection" addr=8.8.8.8 index=2

netsh interface ip set dns name="Local Area Connection" source=dhcp

Comments