Set Static IP, DNS, and WINS using the 'netsh' command

article #962, updated 3098 days ago

If you’re working remotely, you don’t want your connection to go down, so we need to do it all in one command. So:

netsh interface ip set address "Local Area Connection" static <PC-IP> <Subnet-Mask> <Default-Gateway> & netsh interface ip set dns name="Local Area Connection" static <Primary-DNS> primary & netsh interface ip add dns "Local Area Connection" <Secondary-DNS> index=2

Be sure not to include the <> characters when replacing!

Categories: