Batch File Script to change IP addresses
- General Networking
- General Windows
- IT Programming

- Facebook Opens a new window
- Twitter Opens a new window
- Reddit Opens a new window
- LinkedIn Opens a new window

- Spiceworks General Support |
- General Linux |
- Microsoft Exchange
This batch file script will allow you to set a static or dhcp ip address on a spicific adapter on your pc.
I created this script because I have to change the IP address on my laptop for field troubleshooting. If you have any question please feel free to contact me.

4 Steps total
Step 1: verify the name of your network connection.

The script is very specific to the name of the connection that it is making changes to. Go to: Network Connection in the control pannel.
Make a note of the name of the connection that you are anting to control. in my case I am working with the LAN connection. By default that connections are called Local Area Connection (1) etc.
Step 2: Copy this script.
Here is the script that is going to do the work for you. Open Notepad and paste the script into notepad
Script Beginning:
@echo off echo Choose: echo [A] Set Static IP echo [B] Set DHCP echo. :choice SET /P C=[A,B]? for %%? in (A) do if /I "%C%"=="%%?" goto A for %%? in (B) do if /I "%C%"=="%%?" goto B goto choice :A @echo off echo "Please enter Static IP Address Information" echo "Static IP Address:" set /p IP_Addr=
echo "Default Gateway:" set /p D_Gate=
echo "Subnet Mask:" set /p Sub_Mask=
echo "Setting Static IP Information" netsh interface ip set address "LAN" static %IP_Addr% %Sub_Mask% %D_Gate% 1 netsh int ip show config pause goto end
:B @ECHO OFF ECHO Resetting IP Address and Subnet Mask For DHCP netsh int ip set address name = "LAN" source = dhcp
ipconfig /renew
ECHO Here are the new settings for %computername%: netsh int ip show config
pause goto end :end
Script END!
Step 3: Save the script
Select File Save-AS. in the file type box make sure you select All Files. When you name the file make sure it has a .bat file extension.
Step 4: Enjoy the script
The script when clicked on will display a simple menu. You choose static IP or DHCP. either selection will change the IP address of the adapter you selected.
25 Comments

If there is a way to add a file to this How to I will add the batch file to the post.

Scott, you could add the batch file (now) into the Script Center, then add the link as a reference...

Is there a way to change DNS for Static IP?
The short answer is yes. example: netsh interface ip set dns "Local Area Connection" static 192.168.0.200
To change it back to dynamilcy get DNS you can set the interface to get a dhcp address or use the following command.
netsh interface ip set dns "Local Area Connection" dhcp

For Windows XP SP3 and above I use the netsh command. Especially powerful in Vista/Windows7/Server 2008.
To change from DHCP to Static I use this script ..
interface ip set address name="Local Area Connection" source=static addr=10.135.150.210 mask=255.255.255.0 interface ip set address name="Local Area Connection" gateway=10.135.150.254 gwmetric=0 interface ip set dns name="Local Area Connection" source=static addr=10.100.14.249 register=NONE interface ip add dns name="Local Area Connection" addr=10.100.12.249 index=2 interface ip set wins name="Local Area Connection" source=static addr=none
The script syntax varies with windows versions, mine is for windows 7
can I use this script in ubuntu linux

Is there a way to determine what the name of the connection is? and then insert it into the script?
As in, I have about 100 PCs that I will soon be changing to DHCP they are in AD, so this script would be awesome. Only problem I see is that IF the LOCAL AREA CONNECTION is not what the name of the active connection is, then those PCs won't be changed.
If there was some way to pole the PC in question as to what it's active connection name is, and enter it as a variable and not have user interaction this would be perfect for my needs.
Thank you very much, Scott. It works well for my needed. Just a quick question.I modified your script. I added the dns on the static setting. It worked fine. But I don't know how to change back the original DNS when select option B. Could you help, please? Thanks, again.
Command line is great, but I recommend to use some tool for that, simplify and automate. I'm using Maxidix IP Switcher for example, it is the simplest way for fast switching between IP settings. I also know that the other program Wifi Suite can switch settings even automatically when you connecting to wireless network.
Ah! Brilliant ! I was searching for a script like this. But, I am a noob in scripting. Please help me out Scott. My problem is I have a Internet static IP address for my LAN and I have another Internet Connection which uses DHCP and I have connected to a switch.
So, if the static IP address reads No Internet Access for about 5 mins I want a script to automatically switch to my 2nd Internet Connection which uses DHCP. In short, static should automatically switch to DHCP when it reads 'No Internet Access'... Please help me!
how about script to set "Obtain DNS server address automatically" for windows 7.

thanks for this how-to.

I think that our LAN will be cleaner this way! Will try to implement it here.
just copy the below code and paste the script into notepad. I can use netsh to change my entire IP address (IP address, subnet mask, and gateway gwmetric (as 1 in normal, [for secondary ip address for the same nic mentions as 2 in gwmetric ).
@echo off echo "Setting Static IP Information" netsh interface ip set address "Local Area Connection" static 192.168.0.111 255.255.0.0 192.168.0.1 1 netsh int ip show config goto end :end
end of script
- Buying Guides
Complete Guides by How-To Geek
Our latest product roundups, reader favorites, more from how-to geek, latest geek news, latest reviews, across lifesavvy media.
Join 425,000 subscribers and get a daily digest of news, geek trivia, and our feature articles.
By submitting your email, you agree to the Terms of Use and Privacy Policy .
How to Change Your IP Address From the Command Prompt in Windows
Walter Glenn is a former Editorial Director for How-To Geek and its sister sites. He has more than 30 years of experience in the computer industry and over 20 years as a technical writer and editor. He's written hundreds of articles for How-To Geek and edited thousands. He's authored or co-authored over 30 computer-related books in more than a dozen languages for publishers like Microsoft Press, O'Reilly, and Osborne/McGraw-Hill. He's also written hundreds of white papers, articles, user manuals, and courseware over the years. Read more...

It’s easy enough to change an IP address on your PC using Control Panel, but did you know you can also do it from the Command Prompt?
Changing your IP address with the Control Panel interface isn’t difficult, but it does require clicking through a number of different windows and dialog boxes. If you’re a fan of the Command Prompt, though, you can get it done more quickly using the netsh command, which is just one of the great network utilities built into Windows .
The netsh command allows you to configure just about any aspect of your network connections in Windows. To work with it, you’ll need to open Command Prompt with administrative privileges. In Windows 10 or 8.1, right-click the Start menu (or press Windows+X on your keyboard) and choose “Command Prompt (Admin).” In previous versions of Windows, search Start for “command prompt” and then right-click the result and choose “Run as Administrator.”
RELATED: How to Find Your Private and Public IP Addresses
View Your Network Information
Before you change your IP address and related information, you’ll need to find the full name of the network for the interface you want to change. To do this, type the following command:
RELATED: How to Enable CTRL+C / Ctrl+V for Pasting in the Windows Command Prompt
Scroll down until you see the interface you’re looking for. In our example, we’re going to modify the Wi-Fi interface, which on our machine is just named “Wi-Fi.” You’ll also see other default names that Windows assigns to interfaces, such as “Local Area Connection,” “Local Area Connection* 2,” and “Ethernet.” Just find the one you’re looking for and make note of the exact name. You can also copy and paste the name to Notepad and then back into Command Prompt later to make things easier.
Change Your IP Address, Subnet Mask, and Default Gateway
With the interface name in hand, you’re ready to change the IP Address, subnet mask, and gateway. To do this, you’ll issue a command using the following syntax:
So, for example, your command might look something like the following:
where the info is replaced by whatever you want to use. In our example, the command does the following:
- Uses the interface name “Wi-Fi”
- Sets the IP address to 192.168.3.1
- Sets the subnet mask to 255.255.255.0
- Sets the default gateway to 192.168.3.1
And if you’re using a static IP address but want to switch to using an IP address assigned automatically by a DHCP server–such as your router–you can use the following command instead:
Change Your DNS Settings
RELATED: The Ultimate Guide to Changing Your DNS Server
You can also use the netsh command to change the DNS servers used by a network interface. Third-party DNS servers–like Google Public DNS and OpenDNS –can be faster and more reliable than the DNS servers provided by your ISP. Whatever your reason for changing your DNS server , you can do it either at the router so it affects all the devices that get their information from the router or at the individual device. If you want to change the DNS servers for just one PC, it’s easy to do with the netsh command.
You’ll need to use the command twice: once to set your primary DNS server and once to set your secondary, or backup, DNS server. To set your primary DNS server, use the following syntax:
So, for example, your command might look something like the following (in which we set it to Google’s primary public DNS server, 8.8.8.8):
To set your secondary DNS server, you’ll use a very similar command:
So, continuing our example, you might set your secondary DNS as the Google Public DNS secondary server, which is 8.8.4.4:
And just like with the IP address, you can also change it so that the network interface grabs its DNS settings automatically from a DHCP server instead. Just use the following command:
And there you have it. Whether you like typing at the command prompt better or just want to impress your coworkers, now you know all the command line magic you need for changing your IP address settings.
- › How to Find Your IP Address From CMD (Command Prompt)
- › How to Change Your IP Address
- › How to Change Your IP Address Using PowerShell
- › E-Win Champion Series CPG Fabric Gaming Chair Review: It Gets the Job Done
- › Should You Buy a Projector for Gaming?
- › We Let ChatGPT Create AI Art, Here’s What It Made
- › Alienware Has New Gaming Keyboards, Mice, Monitors, and More
- › The Best PS5 Accessories of 2023
- Stack Overflow Public questions & answers
- Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
- Talent Build your employer brand
- Advertising Reach developers & technologists worldwide
- About the company
Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Batch commands to change IP and DNS
I have written few commands in batch to execute them on choice basis. I am using 2 IP addresses for which I have to change IPv4 and DNS every time I switch between IPs.
I have done this code and this works correctly if I execute line by line but in batch they give errors.

- What kind of errors do you get? – TDG Oct 9, 2015 at 12:06
- use variables with surrounding % (at the beginning and at the end) %NO makes no sense, it should be %NO% . Remove the @echo off to see, which line is generating the errormessage. – Stephan Oct 9, 2015 at 13:04
- yes sorry & i have uploaded the image link which is output after executed batch – Taranjeet Singh Oct 9, 2015 at 13:05
- You need goto :eof before both :BUZZ and :BSNL to not fall into the wrong block of code unintentionally... – aschipfl Oct 9, 2015 at 13:49
- Thanks for the script. This made my day.! +1 – CodeMonkey Jan 18, 2021 at 3:44
2 Answers 2
As stated in comments you need to add something that stop the script continuing when the job is done. ( goto:EOF or exit /b 0 )
Also the last command are malformed with quotes “Ethernet” should be "Ethernet"
- the label :retry should be moved before the set /p , otherways you create an endless loop. – Stephan Oct 9, 2015 at 17:23
I checked this before doing a script to change between a static IP and dynamic so I thought of adding my solution in case it´s useful.
There are two options also to check the status of the network interfaces and to check the current IP.
Everything for the interface called "Ethernet".
Because this needs to run as admin, what I did was this: this bat was stored in my folder, C:/workset/scripts/ then I created a shortcut, copied this on the Desktop. Then the shortcut, I went to Properties and there I checked the option to Run as admin and also just becase, changed the icon to a cool one. So now I can run it from the desktop as any other program and it runs as admin from the start.
There should be an error handling but I dont have time, so this is it.
Another note: tbh, at the end I just removed all the options and created one to change to the static IP and another to the dynamic IP so now I just run them faster.
- Lol bro this question was ages ago. Thanks for help but i don't need it any more – Taranjeet Singh Oct 1, 2020 at 21:42
- 1 My reason to add it was that if in the future I´m searching for this again I can find it, or someone else looking for the info. A lot of times I´m looking for something and find solutions in questions made a long time ago so I find very useful when people post their solutions at any time :) – testfailed Oct 5, 2020 at 10:39
Your Answer
Sign up or log in, post as a guest.
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service , privacy policy and cookie policy
Not the answer you're looking for? Browse other questions tagged windows batch-file cmd netsh or ask your own question .
- The Overflow Blog
- How Intuit democratizes AI development across teams through reusability sponsored post
- The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie...
- Featured on Meta
- We've added a "Necessary cookies only" option to the cookie consent popup
- Launching the CI/CD and R Collectives and community editing features for...
- Staging Ground Beta 1 Recap, and Reviewers needed for Beta 2
- The [amazon] tag is being burninated
- Temporary policy: ChatGPT is banned
Hot Network Questions
- What sort of strategies would a medieval military use against a fantasy giant?
- Replacing broken pins/legs on a DIP IC package
- How do I align things in the following tabular environment?
- Voronoi-Lloyd ASCII art
- Theoretically Correct vs Practical Notation
- Why do many companies reject expired SSL certificates as bugs in bug bounties?
- A limit involving the quotient of two sums
- If a law is new but its interpretation is vague, can the courts directly ask the drafters the intent and official interpretation of their law?
- Resistance against timing attacks of AES candidates
- Biodiversity through radiation
- BASIC line input buffer location on ZX Spectrum
- About an argument in Famine, Affluence and Morality
- Why does Jesus turn to the Father to forgive in Luke 23:34?
- What is pictured in this SHERLOC camera?
- "We, who've been connected by blood to Prussia's throne and people since Düppel"
- Why does hooking voltmeter to two transformers show 0 voltage?
- Can the Spiritual Weapon spell be used as cover?
- Checking system vs. SEPA and the like
- Partner is not responding when their writing is needed in European project application
- Who owns code in a GitHub organization?
- How can I find out which sectors are used by files on NTFS?
- Spacing in tuplets (in sheet-music)
- Why do small African island nations perform better than African continental nations, considering democracy and human development?
- A-Z related to countries
Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy .

- Activision Blizzard
- M365 Roadmap

How to modify your hosts file in Windows 10 (and why you might want to)

Modify your hosts file in Windows 10
Here’s how you can modify Hosts files in Windows 10, and map domain names to server IP addresses of your choice.
- Open Notepad with administrator privileges
- Browse to C:WindowsSystem32driversetchosts (Or paste this into the address bar)
- Open the file
- Make your changes
Windows 10 still retains the old computing standard of having a hosts file for rudimentary hostname mapping. In simpler terms, the hosts file provides a mechanism to map domain names (such as “onmsft.com”) to server IP addresses of your choice.
Windows refers to the hosts file each time it connects over a network using a hostname. If it finds an entry for the hostname in the hosts file, it will contact the server specified in the file. Otherwise – and in the vast majority of cases – it will resolve the hostname using DNS (domain name service), which is the process used on the Internet to obtain the server IP address behind a domain name.
While it may sound technical, the hosts file is a really simple approach to network routing – and it’s easy to add your own entries. To get started, you just need to open the file. It resides in Windows’ internal “System32” folder, so to save your edits you’ll need administrator access.

The quickest way to open the file is using Notepad with administrator privileges. Search for Notepad (press the Start button and type its name) and right-click the app to display the context menu. Click “Run as administrator” to launch a privileged instance of the app. Note you may need to reauthenticate yourself or get an administrator’s password if you’re not already logged in as one.

With Notepad open in administrator mode, you’re ready to open the file. Click File > Open and browse to the file at C:WindowsSystem32driversetchosts (you can copy and paste this into the address bar at the top of the Open window). If you do browse through the folders graphically, remember to change the file type filter to “All Files” so the hosts file shows up.
Now you’re ready to edit the file. If you’ve never opened the hosts file before, all you’ll see is a short section of text describing its purpose and how to make edits. The introduction provides a useful overview of how the file is structured, but we’ll cover the basics here.

The hosts file is a simple mapping of IP addresses and hostnames. Each entry goes on a newline, with the IP address (that’s the numerical address) first, followed by a space or tab character and then the hostname (or domain). You can add comments to the file by placing a “#” character at the start of the line – this will make Windows ignore the line when reading the file.
Therefore, if you want to point “microsoft.com” to the IP 1.2.3.4, you’d write “1.2.3.4 microsoft.com” on a new line. Each time you try to visit microsoft.com, you’ll find yourself instead at the (non-existent) 1.2.3.4 website.

At this point, you may be wondering why you’d ever need to edit the hosts file. While it is more useful to technical users, there are also a few more general cases in which it might have value. One example is if you wanted to block a certain website, for example Google. By adding an entry for “google.com” to the hosts file, you can force Windows to point the address to a different location – so users won’t be able to visit the site.
To achieve this example, add a line such as “0.0.0.0 www.google.com” to the file. Save the file and try and visit Google in your browser. You should find the site fails to load.

Remember that this is a far from infallible way to block a site – another user could simply reverse the hosts file edit themselves. In addition, some software may employ its own techniques to lookup hostnames which might ignore the hosts file.
One far more realistic application of the hosts file is to block websites which serve up ads or spyware. Although we won’t be listing any here, if you map the addresses of prominent ad providers to an unused internal IP address (such as 127.0.0.1), you’ll suddenly be browsing an ad-free internet – in every browser.
Windows will resolve the ad URLs to an address that no longer points to the providers’ servers. Just remember that every address you add must be the hostname only (example.com), not the full web address (http://www.example.com).
That’s all about the hosts file. While you’re unlikely to use it outside of a development or network environment, it does have practical applications which could be of use to every PC consumer. You should also know that the hosts file also exists on Mac and Linux systems with the same syntax, albeit in a different location.
Microsoft to disable outdated TLS 1.0, 1.1 for Edge and IE early next year
Microsoft test new cortana ui for android and ios with v3.0 beta, join our team.
OnMSFT.com is built on:
Wordpress GeneratePress Azure
Theme thanks to heather.


Home About Contact Us Join our team!
© Copyright 2014 - 2023 OnMSFT.com LLC
- Allen-Bradley PLC
- CompactLogix
- ControlLogix
- Automation Direct
- Mitsubishi PLC
- Phoenix Contact
- Schneider Electric
- Siemens PLC
- FactoryTalk ViewStudio ME
- PanelBuilder32
- PanelView (1200)
- PanelView (standard)
- PanelView 5000
- PanelView 800
- PanelView Component
- PanelView Enhanced
- PanelView Plus
- PanelView Plus 6
- PanelView Plus 7
- IFM HMI Controllers
- Mitsubishi HMI
- Siemens HMI
- Basic Panels
- Comfort Panels
- Unified Comfort Panels
- Motion Controllers and Servos
- Starters and Contactors
- Variable Frequency Drives
- Allen-Bradley VFDs
- Altivar VFDs
- Account details
- EBay Affiliate Link
- Amazon Affiliate Link

- Have A Question?
- Submit News Tips
- Write For Us
- Our Community
- Our Courses
- Sponsor & Advertise
- Media Guide

Industrial PLCs based on Arduino and Raspberry PI (P143)
Why does my compactlogix’s ip address keep changing (qa0221), how to download tia portal for free (2023, t007), what to do when rslinx’s ethernet/ip driver won’t find your device (t006), why won’t the bootp-dhcp utility disable bootp (qa0210), numeric & string input colors & styles in factorytalk view studio (t009), export, edit, and import factorytalk view studio tags (t008), rockwell i/o and hmi product update (p142), unable to load activex control, newer version required (qa0214), how to import viewme projects into viewse (t005), strain gauge force sensor technology (p127), rfid technology and products (p112), snap signal from banner – a comprehensive iiot productivity solution (p94), p+f usi-safety rated ultrasonic sensor (p87), first look: retroreflective sensor with io-link, pepperl+fuchs obr7500-r100-2ep-io, can i message a powerflex 525 from a controllogix (qa0208), siemens et 200sp motor starters (p137), using siemens vfds with a-b plcs (p130), siemens vfds and servo drives (p119), siemens motion control (p95), cnc automation: what’s new (p141), factorytalk linx (p140), openplc (p139).
- 7 Industrial Automation
Using Batch Files to change your PC’s IP address

Most of us in the industrial automation world connect to our company (or home) network using DHCP. But we also need to connect to our automation device networks via static IP address, resulting in many trips to the control panel to change our IP address settings.
But when you have multiple systems it becomes challenging to remember what IP address settings you need for each system.
To address this Darrell created several batch files that, when “double clicked,” change his Windows XP system's IP address settings to match the system he needs to connect to. This not only saves him the time required to manually change these settings in the control panel, it also helps his colleagues (who connect less often) quickly chose the right IP address settings for the many systems they need to connect to.
Below I'll paste in the contents of two of Darrell's batch files which he was kind enough to share with our readers. The first is used for connecting in his office network via DHCP, and the second is used to connect to one of his automation systems (I've edited the text of the second file to remove the actual system's IP address settings.)

Text File name:
Office LAN Network Settings.bat
Text File Contents:
ECHO This file is brought to you by DARRELL CLARK!
ECHO Resetting IP Address and Subnet Mask For DHCP netsh int ip set address name = “Local Area Connection” source = dhcp
ECHO Here are the new settings for %computername%: netsh int ip show config

Automation System 1 Network Settings.bat
ECHO Resetting IP Address and Subnet Mask For ********* automation system
netsh interface ip set address name=”Local Area Connection” source=static addr=192.168.100.2 mask=255.255.255.0
To use the above text in a batch file on Windows XP, simply copy the text and paste it into Notepad. Then change the settings to match your requirements and save the file with a name which represents your system and ends with the .BAT file extension.
I hope Darrell's batch files can be of some help for you. Admittedly, they are written for a Windows XP system so if you've created similar batch files for Windows 7 we've love to hear from you! You can leave your comments to this article by using the “post a comment or question” link below.
Until next time, Peace ✌️
Shawn M Tierney Technology Enthusiast & Content Creator
Have a question? Join my community of automation professionals and take part in the discussion! You'll also find my PLC , HMI, and SCADA courses at TheAutomationSchool.com .
Sponsor and Advertise: Get your product or service in front of our 75K followers while also supporting independent automation journalism by sponsoring or advertising with us! Learn more in our Media Guide here , or contact us using this form .
- Recent Posts
- Automation This Morning for March 3, 2023 - March 3, 2023
- Automation This Morning for March 2, 2023 - March 2, 2023
- Industrial PLCs based on Arduino and Raspberry PI (P143) - March 1, 2023
(3,858 views)

RELATED ARTICLES MORE FROM AUTHOR

Automation Business Value Growth (P129)

Process Control Monitoring and Diagnostics (P126)

Symphoni Automated Assembly (P123)

Elite Automation and AMR Applications (P120)

Manufacture Local (P116)

Interviewing Marc LeVine on Job Skills Needed in Industrial Automation (P108)
[…] Using Batch Files to change your PC’s IP address […]
Thanks Will 🙂
Shawn Tierney
Join my free community to follow along! You can also become a member and support our work at: Automation.Locals.com
[…] NOTE: The newest version of this article is located at our sister site, The Automation Blog […]
LEAVE A REPLY Cancel reply
Save my name, email, and website in this browser for the next time I comment.

How To Enable Legacy PLCs In Integrated Architecture Builder

Micro800: Create and Download Ladder Logic (Video, TAM S3 47)

DH-485 Comms Hardware and RSLinx Setup (Video, TAS 25)

iQagent: Augmented Reality for Industrial Automation (P92)
Change TCP/IP settings
TCP/IP defines how your PC communicates with other PCs.
To make it easier to manage TCP/IP settings, we recommend using automated Dynamic Host Configuration Protocol (DHCP). DHCP automatically assigns Internet Protocol (IP) addresses to the computers on your network if your network supports it. If you use DHCP, then you don't have to change your TCP/IP settings if you move your PC to another location, and DHCP doesn't require you to manually configure TCP/IP settings, such as Domain Name System (DNS) and Windows Internet Name Service (WINS).
To enable DHCP or change other TCP/IP settings
Select Start , then type settings . Select Settings > Network & internet .
Do one of the following:
For a Wi-Fi network, select Wi-Fi > Manage known networks . Choose the network for which you want to change the settings.
For an Ethernet network, select Ethernet , then select the Ethernet network you’re connected to.
Next to IP assignment , select Edit .
Under Edit network IP settings or Edit IP settings , select Automatic (DHCP) or Manual .
To specify IPv4 settings manually
Under Edit network IP settings or Edit IP settings , choose Manual , then turn on IPv4 .
To specify an IP address, in the IP address, Subnet mask , and Gateway boxes, type the IP address settings.
To specify a DNS server address, in the Preferred DNS and Alternate DNS boxes, type the addresses of the primary and secondary DNS servers.
To specify if you want to use an encrypted (DNS over HTTPS) or unencrypted connection to the DNS server or servers you specify, for DNS over HTTPS , choose the setting you want:
Off : All DNS queries will be sent to the DNS server unencrypted in plaintext over HTTP.
On (automatic template) : DNS queries will be encrypted and sent to the DNS server over HTTPS. DNS queries will use the default settings for the automatic template or try to discover them automatically.
On (manual template) : DNS queries will be encrypted and sent to the DNS server over HTTPS. They’ll use the settings you enter in the DNS over HTTPS template box.
If you use DNS over HTTPS (automatic or manual template), turn Fallback to plaintext on or off:
When it’s turned on, a DNS query will be sent unencrypted if it can’t be sent over HTTPS.
When it’s turned off, a DNS query won’t be sent if it can’t be sent over HTTPS.
To specify IPv6 settings manually
Under Edit network IP settings or Edit IP settings , choose Manual , then turn on IPv6 .
To specify an IP address, in the IP address , Subnet prefix length , and Gateway boxes, type the IP address settings.
When you select Automatic (DHCP) , the IP address settings and DNS server address setting are set automatically by your router or other access point (recommended).
When you select Manual , you can manually set your IP address settings and DNS server address.
When you’re done, select Save .
Note: To install IPv4, run Command Prompt as an administrator, type netsh interface ipv4 install , and then press Enter .
Select Start , then select Settings > Network & Internet .
For a Wi-Fi network, select Wi-Fi > Manage known networks . Choose the network you want to change the settings for, then select Properties.
For an Ethernet network, select Ethernet , then select the Ethernet network you’re connected to.
Under IP assignment , select Edit .
Under Edit IP settings , select Automatic (DHCP) or Manual .
Under Edit IP settings , choose Manual , then turn on IPv4 .
To specify an IP address, in the IP address, Subnet prefix length , and Gateway boxes, type the IP address settings.
To specify a DNS server address, in the Preferred DNS and Alternate DNS boxes, type the addresses of the primary and secondary DNS servers.
Under Edit IP settings , choose Manual , then turn on IPv6 .
When you select Automatic (DHCP) , the IP address settings and DNS server address setting are set automatically by your router or other access point (recommended).
When you select Manual , you can manually set your IP address settings and DNS server address.
When you’re done, select Save .
In Windows 8.1, select the Start button, start typing View network connections , and then select View network connections in the list.
In Windows 7, open Network Connections by selecting the Start button, and then selecting Control Panel . In the search box, type adapter , and then, under Network and Sharing Center , select View network connections .
Right-click the connection that you want to change, and then select Properties . If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
Select the Networking tab. Under This connection uses the following items , select either Internet Protocol Version 4 (TCP/IPv4) or Internet Protocol Version 6 (TCP/IPv6) , and then select Properties .
To specify IPv4 IP address settings, do one of the following:
To get IP settings automatically using DHCP, select Obtain an IP address automatically , and then select OK .
To specify an IP address, select Use the following IP address , and then, in the IP address, Subnet mask , and Default gateway boxes, type the IP address settings.
To specify IPv6 IP address settings, do one of the following:
To get IP settings automatically using DHCP, select Obtain an IPv6 address automatically , and then select OK .
To specify an IP address, select Use the following IPv6 address , and then, in the IPv6 address, Subnet prefix length , and Default gateway boxes, type the IP address settings.
To specify DNS server address settings, do one of the following:
To get a DNS server address automatically using DHCP, select Obtain DNS server address automatically , and then select OK .
To specify a DNS server address, select Use the following DNS server addresses , and then, in the Preferred DNS server and Alternate DNS server boxes, type the addresses of the primary and secondary DNS servers.
To change advanced DNS, WINS, and IP settings, select Advanced .

Need more help?
Join the discussion.
ASK THE COMMUNITY >
Get support
CONTACT US >
Was this information helpful?
Thank you for your feedback.

IMAGES
VIDEO
COMMENTS
I can use netsh to change my entire IP address (IP address, subnet mask, and gateway gwmetric (as 1 in normal, [for secondary ip address for the same nic mentions as 2 in gwmetric ). Script Beginning: @echo off echo "Setting Static IP Information"
In Windows 10 or 8.1, right-click the Start menu (or press Windows+X on your keyboard) and choose “Command Prompt (Admin).” In previous versions of Windows, search Start for “command prompt” and then right-click the result and choose “Run as Administrator.” RELATED: How to Find Your Private and Public IP Addresses
How to change the IP address in Windows using the Control Panel In both Windows 11 and Windows 10, you can also change your IP address from the Control Panel. Open the Control Panel and click or tap on “View network status and tasks” under “Network and Internet.” View network status and tasks in Control Panel
ECHO Changing IP to 192.X.X.X and subred mask to 255.X.X.X netsh interface ip set address name= "Ethernet" static 192.X.X.X 255.X.X.X TIMEOUT /T 2 /NOBREAK > NUL ECHO ____________________________ netsh interface ip show config name="Ethernet" TIMEOUT /T 2 /NOBREAK > NUL GOTO MENU :DYNAMIC ECHO _______________________________ ECHO.
Click File > Open and browse to the file at C:WindowsSystem32driversetchosts (you can copy and paste this into the address bar at the top of the Open window). If you do browse through the folders ...
netsh interface ip set address name=”Local Area Connection” source=static addr=192.168.100.2 mask=255.255.255.0 ECHO Here are the new settings for %computername%: netsh int ip show config pause To use the above text in a batch file on Windows XP, simply copy the text and paste it into Notepad.
Type “notepad” into the Windows 10 desktop search box and select the appropriate item from the results. With the text editor open, type in these commands: ipconfig /release ipconfig /renew arp...
To enable DHCP or change other TCP/IP settings. Select Start, then type settings. Select Settings > Network & internet. Do one of the following: For a Wi-Fi network, select Wi-Fi > Manage known networks. Choose the network for which you want to change the settings. For an Ethernet network, select Ethernet, then select the Ethernet network you ...
In this video I am explaining how to change the IP address of your windows computer easily by creating batch files. You can also use the commands directly on command prompt to change...