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

Bash – Mass NSlookup

Posted on July 19, 2018

When you are moving from one server public IP to another you could use some help knowing things are changed. This bash script will do an NSLookup on various DNS servers. #!/bin/sh # Digkittell.net.sh # # # Created by David Kittell on 1/6/18. # netDomain="kittell.net" dnsServerList="68.94.156.132|10.40.20.1|8.8.8.8|192.168.10.21|192.168.10.20|10.40.20.6|208.67.220.220|9.9.9.9|209.18.47.61|4.2.2.2|168.63.129.16|172.26.38.1" clear echo "AT&T DNS…

Read More

Folder Exists

Posted on December 14, 2013October 26, 2015

Public Function FolderExists(ByVal FolderPath As String) As Boolean Dim f As New IO.DirectoryInfo(FolderPath) Return f.Exists End Function If FolderExists("c:windows") = False Then ‘Folder Does’t Exist Else ‘Folder Does Exist End If Originally Posted on December 14, 2013Last Updated on October 26, 2015 All information on this site is shared with…

Read More

Calculate BMI

Posted on April 16, 2014October 26, 2015

static int CalculateBMI(int weight, int height) { return (weight * 703) / (height * height); } Originally Posted on April 16, 2014Last 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…

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