Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Network Connection Configurations

Posted on June 25, 2013October 26, 2015 By David Kittell

If you are on Windows Vista/7/8 you will need to create the batch file and then run it as administrator.

In the examples below you will need to first know what the connection name is for your network connection(s)

When you click on the start menu or Windows key on your keyboard in the search type in “ncpa.cpl” and hit enter and that will tell you all the connections you have. Depending on what one you use or want to modify you may need to update the name in the below examples from “Local Area Connection” or “Wireless Network Connection” to something else.

Rarely is this needed unless you have already set static IP addresses

@echo off
netsh interface ip set address name="Local Area Connection" source=dhcp
netsh interface ip set dns name="Local Area Connection" source=dhcp

When setting a static IP address you will need to also set the static DNS

@echo off
netsh interface ip set address name="Local Area Connection" source=static addr=10.0.0.54 mask=255.255.255.0
netsh interface ip set address name="Local Area Connection" gateway=10.0.0.1 gwmetric=0
netsh interface ip set dns name="Local Area Connection" source=static addr=208.67.222.222
netsh interface ip add dns name = "Local Area Connection" addr =208.67.220.220
ipconfig /all

If you choose to keep DHCP for your IP Address but have static DNS this will be what you need to use.

@echo off
netsh interface ip set dns name="Local Area Connection" source=static addr=208.67.222.222
netsh interface ip add dns name="Local Area Connection" addr=208.67.220.220
netsh interface ip set dns name="Wireless Network Connection" source=static addr=208.67.222.222
netsh interface ip add dns name="Wireless Network Connection" addr=208.67.220.220
ipconfig /release
ipconfig /renew
ipconfig /flushdns

OpenDNS Default Servers
Primary: 208.67.222.222
Secondary: 208.67.220.220

OpenDNS FamilyShield DNS Servers
Primary: 208.67.222.123
Secondary: 208.67.220.123

Google Default Servers
Primary: 8.8.8.8
Secondary: 8.8.4.4

Originally Posted on June 25, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code Windows Batch

Post navigation

Previous post
Next post

Related Posts

PowerShell – Find a file

Posted on October 10, 2019

If you run into a need to find a file on your computer/server this script should help make things a bit easier Get-ChildItem -Path f:\ -Filter 2019-10-07.log -Recurse -ErrorAction SilentlyContinue -Force Function Format-FileSize() { Param ([int]$size) If ($size -gt 1TB) { [string]::Format("{0:0.00} TB", $size / 1TB) } ElseIf ($size -gt…

Read More

Proxy Switch

Posted on June 18, 2015October 26, 2015

Recently had a need to be able to switch on/off proxy at will and got tired of going to Internet Explorer options to set/change it. Hopefully someone else will get benefit from this nice tool. Open Visual Studio File -> New Project -> Visual C# – Windows -> Windows Forms…

Read More

Ubuntu – Install GUI Desktop From Terminal

Posted on March 18, 2016March 18, 2016

sudo apt-get –assume-yes update && sudo apt-get –assume-yes upgrade && sudo apt-get –assume-yes autoremove sudo apt-get –assume-yes install ubuntu-desktop build-essential sudo chown -R [user-name]:[user-name] /home/[user-name] sudo startx Make sure that you do the chown command otherwise you may not be able to login. Example would be this for username demo…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories
  • Raspberry Pi - Remove Default Apps
  • PowerShell - Change Windows CD/DVD Drive Letter
©2025 David Kittell | WordPress Theme by SuperbThemes