How-To Geek

How to change your ip address from the command prompt in windows.

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?

Quick Links

Launch command prompt as admin to use netsh, view your network information with command prompt, change your ip address, subnet mask, and default gateway, change your dns settings in command prompt, key takeaways.

  • You must launch Command Prompt, PowerShell, or Terminal as admin to use netsh.
  • Use the "netsh interface ipv4 show config" command to find the full name of the network interface you want to change.
  • Modify your IP address, subnet mask, and default gateway using the command "netsh interface ipv4 set address". You can also change DNS settings using "netsh interface ipv4 set dns".

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 .

We're going to use the netsh command, but it requires that Command Prompt be launched as administrator to work. The netsh command allows you to configure just about any aspect of your network connections in Windows.

To launch Command Prompt (or PowerShell) as Admin, open up the Start Menu, search "cmd," hover over the result, then click "Run as Administrator."

In Windows 10 or Windows 11, you can also right-click the Start menu (or press Windows+X on your keyboard) to open the Power User Menu and choose "PowerShell (Admin)."

You can (and should ) use PowerShell for this instead.

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:

netsh interface ipv4 show config

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.

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:

netsh interface ipv4 set address name="YOUR INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY

So, for example, your command might look something like the following:

netsh interface ipv4 set address name="Wi-Fi" static 192.168.3.8 255.255.255.0 192.168.3.1

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:

netsh interface ipv4 set address name="YOUR INTERFACE NAME" source=dhcp

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:

netsh interface ipv4 set dns name="YOUR INTERFACE NAME" static DNS_SERVER

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):

netsh interface ipv4 set dns name="Wi-Fi" static 8.8.8.8

To set your secondary DNS server, you'll use a very similar command:

netsh interface ipv4 set dns name="YOUR INTERFACE NAME" static DNS_SERVER index=2

So, continuing our example, you might set your secondary DNS as the Google Public DNS secondary server, which is 8.8.4.4:

netsh interface ipv4 set dns name="Wi-Fi" static 8.8.4.4 index=2

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:

netsh interface ipv4 set dnsservers name"YOUR INTERFACE NAME" source=dhcp

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.

change ip address windows 7 command line

Contribute to the Windows forum! Click  here  to learn more  💡

May 10, 2024

Contribute to the Windows forum!

Click  here  to learn more  💡

Windows 7 Top Forum Contributors: Bill Smithers  -  LemP   ✅

Windows 7 Top Forum Contributors:

Bill Smithers  -  LemP   ✅

Windows 7 Forum Top Contributors: Learn More

Windows 7 Forum Top Contributors:

  • Search the community and support articles
  • Search Community member

Ask a new question

Changing the preferred IP address in windows 7

Report abuse.

Reported content has been submitted​

Replies (10) 

Anoop P K

You may manually assign the default gateway and the IP address and check if it works fine. Before assigning the IP address and the Default gateway manually, make a note of the IP address on the computer. To do this open Command prompt and type ipconfig and press enter. This will display the IP address, make a note of it.

To assign the IP address and default gateway manually, follow the steps below:

a)        In system tray, right click network icon. Choose Open Network and Sharing Center.

b)        Right click on Local Area Connection and click on Properties.

c)        Double click Internet Protocol Version 4 (TCP/IPv4) and assign the IP address manually.

Example: Old IP address is 192.168.0.1

d)        Change the IP address to 192.168.0.50

e)        Let the Subnet mask and default gateway be the same.

f)         Subnet mask = 255.255.255.0

g)        Default gateway, usually would be 192.168.0.1 or 192.168.1.1

h)        Click on Apply and Ok, restart the computer, and verify if it helps to fix the issue.

2 people found this reply helpful

Was this reply helpful? Yes No

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

Thanks for your feedback.

1 person found this reply helpful

191 people found this reply helpful

Hi,   If you are on a router you can reserve an IP in the DHCP settings or you can hardset the IP in Windows 7 to an address range within what the router uses.

7 people found this reply helpful

Nirmal S

Are the computers connected to a Domain?

3 people found this reply helpful

Jessen P

The issue you have posted would be better suited in the TechNet Forums. I would recommend posting your query in the link below.

Windows 7 IT Pro Category

Hah, that was pretty good. :)

This site has some more info - someone says it's not possible to change it -

http://superuser.com/questions/470585/how-to-force-windows-7-to-ask-for-a-fresh-ip-address-from-dhcp-server

58CherrySunburst

Just a quick note. I don't think it's really critical to the Q&A here, but the example given for the default gateway is potentially misleading in this answer.

So, while the router's interface acting as the default gateway could be any IP address in the subnet, it does HAVE TO BE in the same subnet. So since this example is a 255.255.255.0 mask, then the default gateway would have to be 192.168.0.XXX where XXX is any valid host IP address NOT currently being used. Note that the word "valid host" in this case implies that it is NOT 0 and NOT 255.

Specifically, given this mask and the example IPs, the default gateway cannot have a third octet value of 1.

Question Info

  • Network & internet
  • Norsk BokmĂ„l
  • Ελληνικά
  • Русский
  • עברית
  • العربية
  • ไทย
  • 한국어
  • 中文(简体)
  • 中文(繁體)
  • 日本語

WindowsLoop

How to Change IP Address in Command Prompt (Renew IP)

To renew or change the IP address, you can use the netsh command. Here’re the steps to change the IP address in Command Prompt in Windows 10.

When connected to a network, the Windows computer will automatically get a new IP address as long as it is configured to “ Obtain an IP address automatically “. Generally, having the IP address auto-assigned is pretty helpful as you don’t have to configure any extra settings to connect to a network. For instance, you can just plug-in the ethernet cable or connect to a WiFi network and you are ready to go thanks to the auto-config option in Windows 10.

Though Windows can automatically obtain an IP address without any hassle, there might times where you need a specific IP address. For example, to share files in your local network, having a static IP address is really helpful. This eliminates the need to reconfigure the IP address every time you want to access the network drive. In these kinds of cases, you need to change the IP address in Command Prompt .

Thankfully, with just a couple of commands, you change the IP address from Command Prompt. Here are the exact steps you should follow.

Steps to Change IP Address in Command Prompt

To change the IP address from the Windows Command Prompt, there are two major steps. First, you need to know the network interface name and then use it to set the IP address. It is pretty easy. Follow the steps as shown below and you will be good.

  • First, press the Windows key to open the Start menu .
  • Now, type “ Command Prompt ” in the search bar.
  • Right-click on the Command Prompt and select the “ Run as administrator ” option.
  • Execute the below command to get the network interface name. netsh interface ipv4 show config

Change-ip-address-in-command-prompt-040920

  • Once you have the interface name, execute the below command while replacing “IP_Address”, “Subnet_Mask”, and “Gateway” with the actual IP address you want to assign, subnet mask, and gateway respectively. netsh interface ipv4 set address name="Interface_Name" static IP_ADDRESS SUBNET_MASK GATEWAY
  • After assigning the IP address, close the command prompt window .

That is all. It is that simple to change the IP address in the command prompt.

Note: You can get the subnet mask and gateway addresses from the router or from your ISP.

If you want the IP address to be assigned automatically, execute the below command. This will set the network interface from Static IP to DHCP. DHCP will automatically get a new IP address from the router.

That is all. I hope that helps. If you are stuck or need some help comment below and I will try to help as much as possible. If you like this article, check out how to change the network name in Windows 10 .

About The Author

Avatar for Bashkarla

Leave a Comment Cancel Reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

change ip address windows 7 command line

site logo

Change IP Address and DNS Servers using the Command Prompt

Just because it's more fun

Author avatar

The Command Prompt application, sometimes referred to as command shell, is found in most Windows NT-based operating systems. Its purpose is to execute specific commands for troubleshooting or solving specific Windows issues, performing advanced administrative functions, and automating tasks via batch files and scripts.

That said, you can also use it to change your IP address when you want to spoof it to bypass geoblocks or online bans on sites that impose such restrictions on their content, or change your Domain Name System (DNS) servers for troubleshooting reasons or to make surfing more secure and faster.

Change IP Address and DNS Servers using the Command Prompt image 1

In this guide, we’re going to show you how to change your IP address and DNS servers using the Command Prompt in Windows 10.

How To Change IP Address Using Command Prompt

An IP address holds information about your device, location, your internet service provider (ISP), and browser information.

Changing it is useful when you have a malfunctioning router that’s providing addresses used by a different computer on the network or an invalid address is accidentally configured.  It’s also helpful when you want to install a new router and reconfigure your home network to use the default IP address range.

Change IP Address and DNS Servers using the Command Prompt image 2

The first step to changing your IP address is to find the network name for the interface you want to change. 

  • Open an elevated Command Prompt by typing CMD in the search bar and clicking on Run as Administrator .

Change IP Address and DNS Servers using the Command Prompt image 3

  • Next, type netsh interface ipv4 show config in the command prompt window, press Enter, and scroll down to the interface you want.

Change IP Address and DNS Servers using the Command Prompt image 4

In our case, we’ll be modifying the WiFi interface, but you can pick the correct interface for your case. Make note of the interface name.  

  • To change the IP address, type this command: netsh interface ipv4 set address name=”YOUR INTERFACE NAME” static IP_ADDRESS SUBNET_MASK GATEWAY

In our example, this command would look like this: netsh interface ipv4 set address name=”Wi-Fi” static 192.168.0.173 255.255.255.0 192.168.0.0

Change IP Address and DNS Servers using the Command Prompt image 5

This command will use the Wi-Fi interface, set the IP address to 192.168.0.173, set the subnet mask to 255.255.255.0 and set the default gateway to 192.168.0.0.

If you want to switch to using an IP address automatically assigned by a DHCP server instead of a static IP address, use the netsh interface ipv4 set address name=”YOUR INTERFACE NAME” source=dhcp command.

How To Change DNS Servers Using Command Prompt

 A DNS server holds public IP addresses and related hostnames in a database, and is used to resolve or translate the hostnames to IP addresses. The server does this by running special software to communicate with other servers through special protocols based on certain requests from the computer. 

The conversion process is thoroughly vetted and verified, and it happens quickly behind the scenes so as to obtain information corresponding to the server that the computer is looking for, and then tells the original connecting computer where to go so that it can connect to that server.  

Change IP Address and DNS Servers using the Command Prompt image 6

There are several reasons why you’d want to change your default DNS server , but the main ones are:

  • Boost your privacy when getting around a firewall, bypassing geoblocks or ISP blocks on a website
  • Increase security
  • Parental controls like blocking websites from your router
  • Speed your surfing, which your own ISP’s DNS servers may not offer because they’re not always reliable or up-to-date

Note : You can change DNS servers individually for your home network on your router or on computers, smartphone, and Chromebook, among other devices

How To Change DNS Servers With Command Prompt

Follow the steps below to learn how to change DNS servers using Command Prompt.

  • Open an elevated Command Prompt by typing CMD in the search bar, and clicking Run as Administrator .

Change IP Address and DNS Servers using the Command Prompt image 7

  • Type netsh and press Enter .

Change IP Address and DNS Servers using the Command Prompt image 8

  • Next, type interface ip show config and press Enter .

Change IP Address and DNS Servers using the Command Prompt image 9

  • Find the network interface whose DNS server you want to change, and enter the netsh interface ipv4 set dns name=”YOUR INTERFACE NAME” static DNS_SERVER . This will set your primary DNS server.

From our example above, we changed the IP address for the “Wi-Fi” interface, so we’ll use the same example to change DNS servers. 

For purposes of this guide, we’ll use Google’s primary public DNS server, 8.8.8.8. The command will look something like this: netsh interface ipv4 set dns name=”Wi-Fi” static 8.8.8.8

Change IP Address and DNS Servers using the Command Prompt image 10

  • Next, type the netsh interface ipv4 set dns name=”YOUR INTERFACE NAME” static DNS_SERVER index=2 command to set the secondary DNS server. Again, we’ll use Google’s public DNS secondary server, 8.8.8.8  as an example, which will look like this: netsh interface ipv4 set dns name=”Wi-Fi” static 8.8.4.4 index=2.

Change IP Address and DNS Servers using the Command Prompt image 11

Note : You can use the netsh interface ipv4 set dnsservers name”YOUR INTERFACE NAME” source=dhcp command if you want the network interface to automatically pick DNS settings from a DHCP server. Continuing with our example, this command would look like this: netsh interface ipv4 set dnsservers name”Wi-Fi” source=dhcp

Command Prompt is a great tool to use when you want to change IP addresses and DNS servers. It’s faster and saves you the hassle of having to click through several windows and dialog boxes from the Control Panel interface just to get to the IPv4 Properties dialog box to do the same thing. 

Was this guide helpful? Let us know by dropping your comment in the section below.

' src=

Elsie is a technology writer and editor with a special focus on Windows, Android and iOS. She writes about software, electronics and other tech subjects, her ultimate goal being to help people out with useful solutions to their daily tech issues in a simple, straightforward and unbiased style. She has a BCom degree in Marketing and currently pursuing her Masters in Communications and New Media. Read Elsie's Full Bio

Read More Posts:

change ip address windows 7 command line

  • Network Fundamentals
  • Network Cabling
  • Ethernet Protocol
  • TCP-UDP Protocol
  • IP Protocol
  • Supernetting & CIDR
  • ICMP Protocol
  • Domain Name System (DNS)
  • Spanning Tree Protocol (STP)
  • VLAN Networks
  • Network Address Translation
  • Cisco Routers
  • Cisco Switches
  • Cisco Firewalls
  • Cisco Wireless
  • Cisco CallManager-CCME
  • Cisco Data Center (Nexus/UCS)
  • Cisco Services & Technologies
  • Palo Alto Networks
  • F5 Networks
  • Microsoft 365 Security
  • SASE & SD-WAN
  • Security Service Edge (SSE)
  • Web Application Vulnerability Scanners
  • VPN Services & Guides
  • Windows Servers
  • Windows Workstations (XP, 7, 8, 10, 11)
  • Linux - Unix
  • Virtualization & VM Backup
  • OpManager - Network Monitoring & Management
  • ManageEngine Firewall Analyzer

EventLog Analyzer

  • Network Protocol Analyzers
  • IP PBX - Unified Communications
  • Security Articles
  • Reviews & Interviews
  • GFI Network Security
  • OpenMosix - Linux Supercomputer
  • More Reading

Firewall.cx

All-in-one protection

change ip address windows 7 command line

Free Download

Ransomware protection.

change ip address windows 7 command line

Download Now!

change ip address windows 7 command line

Free Download!

Get 2 vms for free.

change ip address windows 7 command line

Manage your Network!

How to change & configure an ip address or set to dhcp, using the command prompt in windows 7.

Not many users are aware that Windows 7 provides more than one way to configure a workstation’s network adaptor IP address or force it to obtain an IP address from a DHCP server . While the most popular method is configuring the properties of your network adaptor via the Network and Sharing Center , the less popular and unknown way for most users is using the netsh Command Prompt. In this tutorial, we show you how to use the Command Prompt netsh command to quickly and easily configure your IP address or set it to DHCP .  Competent users can also create simple batch files (.bat) for each network (e.g home, work etc) so they can execute them to quickly make the IP address, Gateway IP and DNS changes.

In order to successfully change the IP address via Command Prompt , Windows 7 requires the user to have administrative rights . This means even if you are not the administrator, you must know the administrative password , since you will be required to use the administrative command prompt .

Opening The Administrative Command Prompt On Windows 7

To open the administrative command prompt in Windows 7 , first click on the Start icon. In the search dialog box that appears, type cmd and right-click on the cmd search result displayed. On the menu that Windows brings up, click on the Run as administrator option as shown in the below screenshot:

windows-7-change-ip-address-via-cmd-prompt-1

Depending on your User Account Control Settings ( UAC ), Windows may ask for confirmation. If this happens, simply click on Yes and Windows will present the CLI prompt running in elevated administrator privileged mode :

windows-7-change-ip-address-via-cmd-prompt-2

Using The ‘netsh’ Command Prompt To Change The IP Address, Gateway IP & DNS

At the Administrative Command Prompt , type  netsh interface ip show config , which will display the network adapters available on your system and their names. Note down the name of the network adaptor for which you would like to set the static IP address.

windows-7-change-ip-address-via-cmd-prompt-3

In our example, we’ll be modifying the IP address of the interface named Wireless Network Connection , which is our laptop’s wireless network card.

Even if the Wireless Network Connection is set to be configured via DHCP , we can still configure a static IP address. Following is the command used to configure the interface with the IP address of 192.168.5.50 with a subnet mask of 255.255.255.0 and finally a Gateway of 192.168.5.1 :

Next, we configure our primary DNS server using the netsh command with the following parameters:

Note: When entering a DNS server, Windows will try to query the DNS server to validate it. If for any reason the DNS server is not reachable (therefore not validated), you might see the following error:

To configure the DNS server without requiring DNS Validation , use the validate=no parameter at the end of the command:

This command forces the DNS server setting without any validation and therefor no error will be presented at the CLI output in case the DNS server is not reachable.

To verify our new settings, use the netsh command with the following parameters:

At this point, we should see the network settings we configured, as shown below:

windows-7-change-ip-address-via-cmd-prompt-4

Using The 'netsh' Command Prompt To Set The Network Interface Card To DHCP

You can use the netsh command to switch your current adapter from static to DHCP.  To switch your network adaptor from static IP configuration to DHCP, use the following command:

Windows will not return any confirmation after the command is entered, however if the network adaptor has successfully obtained an IP address and has Internet connection, there should not be any network icon with an exclamation mark in the taskbar notification area as shown below:

windows-7-change-ip-address-via-cmd-prompt-5

Finally, to verify that DHCP is enabled and we’ve obtain an IP address, use the netsh command with the following parameters:

This article showed how to configure a Windows 7 network interface with an IP address , Gateway and DNS server , using the Administrative Command Prompt . We also showed how to set a Windows 7 network interface to obtain an IP address automatically from a DHCP server .

Your IP address:

185.80.150.64

  • All-in-one protection for Microsoft 365

All-in-one protection for Microsoft 365

FREE Hyper-V & VMware Backup

FREE Hyper-V & VMware Backup

Wi-Fi Key Generator

Follow firewall.cx.

Please enable the javascript to submit this form

Network and Server Monitoring

Network and Server Monitoring

Recommended Downloads

  • Network Management - Monitor & Alert
  • Free Hyper-V & VMware Backup

Bandwidth Monitor

  • Patch Manager Plus

Firewall Analyzer

Cisco password crack.

Decrypt Cisco Type-7 Passwords on the fly!

Decrypt Now!

Bandwidth Monitor

Free PatchManager

Free PatchManager

Security Podcast

Hornet-Security-The-Swarm-Podcast

Related Articles

How to enable & use windows 8 startup settings boot menu (workstations, tablet & touch devices), how to view hidden files & folders in windows 7, configuring windows 7 to provide secure wireless access point services to wi-fi clients - turn windows into an access point, revealing & backing up your windows 8 – windows 8.1 pro license product key, microsoft windows xp - end of life / end of support.

  • Editor's Choice: Tech Gifts for Mom
  • Amazon Prime Tech Deals!

Release and Renew Your IP Address in Microsoft Windows

Use the IPconfig command to fix common networking errors

  • Massachusetts Institute of Technology
  • University of Illinois

change ip address windows 7 command line

  • Western Governors University
  • The Ultimate Laptop Buying Guide

What to Know

  • Release an IP address: Open Command Prompt , enter ipconfig /release , and press Enter .
  • Renew an IP address: Open Command Prompt , enter ipconfig /renew , and press Enter .

Releasing and renewing the IP address on a computer with the Windows operating system resets the underlying IP connection, which often eliminates common IP-related issues, at least temporarily. It works in a few steps to disengage the network connection and refresh the IP address. Instructions apply to Windows 10, Windows 8.1, Windows 8, and Windows 7.

Windows: Release and Renew IP Addresses 

Under normal conditions, a device can use the same IP address indefinitely. Networks usually reassign correct addresses to devices when they first join. However, technical glitches with DHCP and network hardware can lead to IP conflicts and other problems that prevent the networking system from working correctly.

When to Release and Renew the IP Address

Scenarios in which releasing the IP address and then renewing it might be beneficial include:

  • When connecting a computer to a modem.
  • When physically moving a computer from one network to another, such as from an office network to home or home to a hotspot.
  • When experiencing an unexpected network outage.

Release and Renew an IP Address With Command Prompt

Here's how to release and renew the address of any computer running the Windows operating system.

Open Command Prompt . The quickest method is to press Win + R to open the Run box dialog, enter cmd , and then press Enter .

Enter ipconfig /release and press Enter .

In the command results, the IP address line shows 0.0.0.0 as the IP address. This is normal because the command releases the IP address from the network adapter . During this time, your computer has no IP address and cannot access the internet.

Enter ipconfig /renew and press Enter to get a new address.

When the command is finished, a new line appears at the bottom of the Command Prompt screen that contains an IP address.

More Information About IP Release and Renew

Windows may receive the same IP address after renewal as it had before. This phenomenon is normal. The desired effect of deleting the old connection and starting a new one occurs independently of which address numbers are involved.

Attempts to renew the IP address may fail. One possible error message may read:

  • An error occurred while renewing interface [interface name]: unable to contact your DHCP server. Request has timed out.

This error indicates that the DHCP server may be malfunctioning or is unreachable. Reboot the client device or the server before proceeding.

Windows also provide a troubleshooting section in Network and Sharing Center and Network Connections. These troubleshooting tools run diagnostics that include an equivalent IP renewal procedure if it detects that it's needed.

Get the Latest Tech News Delivered Every Day

  • How to Find Your IP Address on Windows 10
  • How to Find Your IP and MAC Addresses in Windows
  • How to Find the MAC Address of Your Laptop
  • How to Find Your IP Address in Windows
  • NETGEAR Default Password List (May 2024)
  • How to Find an IP Address in Command Prompt
  • How to Find a Modem's IP Address
  • 3 Ways to Find Your Roku IP Address (With or Without the Remote)
  • How to Change the IP Address on Your Android
  • What It Means When You See the 0.0.0.0 IP Address
  • How to Resolve Limited or No Connectivity Errors in Windows
  • How to Find Your IP Address
  • How to Identify Network Hardware IP Addresses on a Local Network
  • How to Fix a 169 IP Address Error
  • What Is an IP Address?
  • What Is an IP Address Conflict?
  • Latest News

How to Change Your IP Address From the Command Prompt in Windows

How to Change Your IP Address From the Command Prompt in Windows

Using the Control Panel tool to change your IP address isn't hard, but you do have to click through a number of different windows and dialog boxes. Bu

Using the Control Panel tool to change your IP address isn’t hard, but you do have to click through a number of different windows and dialog boxes. But if you like the Command Prompt, you can do it faster by using the netsh command, one of the many great network apps that come with Windows.

  • 1 Launch Command Prompt as Admin to Use Netsh
  • 2 View Your Network Information with Command Prompt
  • 3 Change Your IP Address, Subnet Mask, and Default Gateway
  • 4 Change Your DNS Settings in Command Prompt

Launch Command Prompt as Admin to Use Netsh

We’ll use the netsh tool, which needs tool Prompt to be opened as an administrator for it to work. The netsh command in Windows lets you change almost every part of your network links.

To run Command Prompt (or PowerShell) as Admin, open the Start menu, look for “cmd,” hover over the result, and then click “Run as Administrator.”

Opening Command Prompt on Window 10

You can also right-click the Start menu or press Windows+X on your computer to open the Power User Menu and select “PowerShell (Admin)” in Windows 10 or Windows 11.

View Your Network Information with Command Prompt

Before you can change your IP address and other related information, you’ll need to find the full name of the network for the device you want to change. Type the following instructions to do this:

Command Prompt Interface

Keep scrolling down until you find the layout you want. In our case, we’ll change the Wi-Fi interface, which on our computer is simply called “Wi-Fi.” Windows gives ports other names by default, like “Local Area Connection,” “Local Area Connection* 2,” and “Ethernet.” Just look for the one you want and write down the exact name. To make things easier, you can also copy and paste the name into Notepad and then back into Command Prompt.

Change Your IP Address, Subnet Mask, and Default Gateway

With the interface name in hand, you can 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 are using a static IP address but want to switch to an IP address that is automatically given by a DHCP server, like your router, you can use the following command:

Change Your DNS Settings in Command Prompt

You can also change a network interface’s DNS servers with the netsh tool. DNS servers from companies other than your ISP, like Google Public DNS and OpenDNS, can be faster and more secure. No matter why you want to change your DNS server, you can do it at the router or on each individual device. If you do it at the router, the change will affect all the devices that get their information. With the netsh tool, it’s easy to change the DNS servers for just one PC.

You’ll need to use the command twice: once to set your main DNS server and again to set your secondary, or backup, DNS server. Use the following code to set your main DNS server:

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 change it so that the network interface immediately gets its DNS settings from a DHCP server instead. Just type in the following:

And that’s the end of it. Whether you prefer working at the command prompt or just want to show off to your coworkers, you now know how to change your IP address settings with command line magic.

Is it possible to change your IP address?

You can change your IP address by using the Tor browser, a VPN, or a proxy server, or by changing the settings on your computer. Is it against the law to change your IP address? It may or may not be allowed to change your IP address. It depends on how you do it and where you are.

How do I change my IP address settings?

  • Select Start, then select Settings > Network & Internet.
  • Do one of the following: For a Wi-Fi network, select Wi-Fi > Manage known networks. …
  • Under IP assignment, select Edit.
  • Under Edit IP settings, select Automatic (DHCP) or Manual. …
  • When you’re done, select Save.

Does a VPN change your IP?

A VPN changes your real IP address, so it looks like you’re connecting to the internet from a different place: the real location of the VPN server, instead of where you are. This is just one reason why so many people use VPNs.

RECOMMENDED FOR YOU

change ip address windows 7 command line

How To : Change your IP address from the Windows command line

Change your IP address from the Windows command line

Need to change your IP address? In this how-to, you'll find instructions for changing your IP address from the Windows command prompt with the ipconfig console application. For step-by-step instructions, take a look. NB: Changing your IP will not protect your identity; it's merely a simple expedient for getting around certain problems ones might encounter while using the Internet.

Just updated your iPhone? You'll find new emoji, enhanced security, podcast transcripts, Apple Cash virtual numbers, and other useful features. There are even new additions hidden within Safari. Find out what's new and changed on your iPhone with the iOS 17.4 update.

are you using a dongle on 3 network in the yorkshire area

Its Great here for newbies.....

Share Your Thoughts

How to : rotate the display on linux, mac, & windows computers, how to : create an admin user account using cmd prompt (windows), how to : lock folder without any software with password, how to : change the time display from military time in windows, how to : remove empty folders, duplicate files, broken shortcuts, and old bookmarks from your computer, how to : use the memory in the windows calculator, how to find the c : drive on my mac, how to : change a zip file to a ipsw file, how to : wipe the data from a microsoft windows xp pc with dban, how to : create a bootable usb drive for ubuntu using mac or windows, how to : install windows xp from a dos bootable flash drive, how to : identify your system specifications in windows xp, how to : create a new windows partition with gparted software, how to : download the adobe shockwave plug-in for firefox, how to : open .iso files on your pc using daemon tools program, how to : set up advanced desktop effects in ubuntu linux and use rotate cube, how to : browse and open files and folders on a microsoft windows pc, how to : simulate firefox os for smartphones on your pc, how to : turn off your system firewall without admin privileges, how to : share local drives and folders using oracle vm virtualbox with a guest windows os.

  • All Features
  • All Hot Posts
  • PRO Courses Guides New Tech Help Pro Expert Videos About wikiHow Pro Upgrade Sign In
  • EDIT Edit this Article
  • EXPLORE Tech Help Pro About Us Random Article Quizzes Request a New Article Community Dashboard This Or That Game Popular Categories Arts and Entertainment Artwork Books Movies Computers and Electronics Computers Phone Skills Technology Hacks Health Men's Health Mental Health Women's Health Relationships Dating Love Relationship Issues Hobbies and Crafts Crafts Drawing Games Education & Communication Communication Skills Personal Development Studying Personal Care and Style Fashion Hair Care Personal Hygiene Youth Personal Care School Stuff Dating All Categories Arts and Entertainment Finance and Business Home and Garden Relationship Quizzes Cars & Other Vehicles Food and Entertaining Personal Care and Style Sports and Fitness Computers and Electronics Health Pets and Animals Travel Education & Communication Hobbies and Crafts Philosophy and Religion Work World Family Life Holidays and Traditions Relationships Youth
  • Browse Articles
  • Learn Something New
  • Quizzes Hot
  • This Or That Game
  • Train Your Brain
  • Explore More
  • Support wikiHow
  • About wikiHow
  • Log in / Sign up
  • Computers and Electronics
  • Operating Systems

How to Change Your IP Address (Windows)

Last Updated: March 13, 2020 Tested

This article was written by Stan Kats and by wikiHow staff writer, Jack Lloyd . Stan Kats is the COO and Chief Technologist for The STG IT Consulting Group in West Hollywood, California. Stan provides comprehensive technology & cybersecurity solutions to businesses through managed IT services, and for individuals through his consumer service business, Stan's Tech Garage. Stan has over 7 years of cybersecurity experience, holding senior positions in information security at General Motors, AIG, and Aramark over his career. Stan received a BA in International Relations from The University of Southern California. The wikiHow Tech Team also followed the article's instructions and verified that they work. This article has been viewed 2,546,046 times.

This wikiHow teaches you how to change both your public IP address and your private IP address on a Windows computer. Your public IP address is the address that your computer broadcasts to other networks, while your private IP address is your computer's specific address within your own wireless network. Changing either of these may fix connection issues.

Step 1 Unplug your router and modem.

  • You may want to check your current IP address before doing this.
  • Simply unplugging the router and modem from the wall will work.

Step 2 Disable your computer's Wi-Fi.

  • Click Wi-Fi in the pop-up window.

Step 3 Wait for five minutes.

  • You may want to check your IP address again to make sure it has changed.

Step 6 Contact your ISP.

Renewing the Address

Step 1 Open Start icon.

  • If you aren't an administrator on your current computer, you won't have this option and thus won't be able to renew your computer's IP address.

Step 5 Click Yes when prompted.

Changing the Address

Step 1 Open the Settings...

  • IP address - Usually, your device's IP address will be "192.168.1.X" (or a similar set of numbers), wherein "X" is specific to your device. Change the "X" value to a number between 1 and 100. Make sure you don't use the same IP address as another device on your network (e.g., your phone).
  • Subnet prefix length - This depends on your IP address, but will usually be "255.255.255.X".
  • Gateway - This is your router's IP address.
  • Preferred DNS - Your preferred DNS address (for example: "208.67.222.222" for the OpenDNS server, or "8.8.8.8" for Google's server).
  • Alternate DNS - A secondary DNS address (for example: "208.67.220.220" for the OpenDNS server, or "8.8.4.4" for Google's server).

Step 9 Click Save.

Expert Q&A

Stan Kats

  • You'd change your public IP address in the event that you were kicked out of a gaming service (e.g., Steam), while you'd change your private IP address to fix website loading errors. Thanks Helpful 1 Not Helpful 0
  • Using a proxy server will not change your IP address in the traditional sense, but it will alter the IP address that others can see. Thanks Helpful 0 Not Helpful 0
  • You can also use a browser like Tor to hide your IP address, though such browsers can be dangerous and are often slower than average. Thanks Helpful 0 Not Helpful 0

change ip address windows 7 command line

  • If you choose an in-use IP address for your computer when changing its private IP address, the device that is currently using that address will get kicked off of the network. Thanks Helpful 0 Not Helpful 0

You Might Also Like

Surf the Web Anonymously with Proxies

  • ↑ http://www.whatismyip.com/ip-faq/how-to-change-your-ip-address/

About This Article

Stan Kats

1. Unplug your router and modem. 2. Disable your Wi-Fi. 3. Wait 5 minutes. 4. Plug the router and modem back in. 5. Re-enable Wi-Fi. Did this summary help you? Yes No

  • Send fan mail to authors

Is this article up to date?

Am I a Narcissist or an Empath Quiz

Featured Articles

How to Get a Nice Body

Trending Articles

Confront a Cheater

Watch Articles

Make Sugar Cookies

  • Terms of Use
  • Privacy Policy
  • Do Not Sell or Share My Info
  • Not Selling Info

wikiHow Tech Help Pro:

Level up your tech skills and stay ahead of the curve

How to Set a Static IP Address on a Windows PC

You can learn how to set up a static IP address on your computer. Here's how.

While most of the internet runs on dynamic addresses these days, static addresses are sometimes helpful to use as well. Whether you need to run a server of your own, set up external devices or services, or are just simply looking to explore, before you get your hands dirty, you need to know your way around and be super careful while setting up an IP address.

Moreover, there's more than one way to go about this. So, one by one, let's look at all the ways you can easily set up a static IP address on your Windows.

Static IP Addresses: The Whys and Hows

An IP address of a computer that stays the same over time is known as a Static IP address . This is in contrast to a dynamic IP Address, which is an address that can tweak over time.

Today, most devices use a dynamic IP address because of their ease of use and management. However, in rare cases, Static IP addresses can become handy. Some of those cases include:

  • When you have external devices that you can only connect to your network through your IP address.
  • When you connect to other networks through a VPN.
  • Static IP addresses can make hosting a server somewhat easier.

Because of a slew of such benefits, using a Static IP address can make your life super easy in some situations. So, now let's look at the different methods you can use to set up a static IP address for yourself.

How to Set a Static IP Address on Windows 11

Like most things on Windows, you have multiple ways to do this. Let's look at the most straightforward method first, which is using Windows Settings.

Here's how you can set a static IP Address using the Windows settings:

  • Head to the Start menu search bar, type in 'settings,' and select the best match. Alternatively, press the Windows Key + I to launch the Settings menu.
  • Then head to Network & internet settings .
  • Look for the Properties button. It's right next to your connection settings.
  • Scroll down and look for the IP assignment section. Then click on Edit .
  • In the new Edit IP settings dialog box, click on the scroll-down menu and select Manual .
  • Toggle on the switch for the IPv4 button.
  • Fill in all the network details here, including the IP address , Subnet mask , Gateway , and then click on Save .

Follow the above steps meticulously, and your Windows 11 will have a new static IP address from here on.

How to Set Up a Static IP Address on Windows 10

The basics of setting up an IP Address in Windows 10 are similar. Even though the implementation of steps might differ here and there, you have to follow a pattern that's pretty much the same. Here's how:

  • Open the Windows 10 Settings.
  • Click on Network & Internet .
  • Depending on how you are connected to the Internet, select Wi-Fi or Ethernet .
  • Select the current network connection.
  • Toggle on the IPv4 switch.
  • Set up the static IP address here and fill in other relevant information, such as the Preferred DNS , Default Gateway , etc.
  • Click on Save .

After you are done, you will have a new static IP address on your PC from here on.

How to Set Up a Static IP With Command Prompt

The above method, using the Settings GUI, is only one of the ways to tweak your IP address settings. For those of you who tilt more towards a command line rather than a simple click-and-play GUI, luckily, alternatives exist. For instance, you can also use the Command prompt, and set up the address with just a few commands.

To change up your IP address through your Command Prompt, follow the below steps:

  • Head to the Start menu search bar, type in 'cmd,' and launch the cmd as administrator.
  • Type in the following command in the cmd and hit Enter : ipconfig /all
  • Subnet mask
  • Default Gateway
  • DNS Servers
  • Type in the following command to assign static IP address on your Windows and hit Enter : netsh interface ip set address name= "Ethernet1" static 10.1.4.220 255.255.255.0 10.1.4.1 In the above command, replace Ethernet1 with the name of your adapter, and change 10.1.4.220 255.255.255.0 10.1.4.1 with the device IP address, subnet mask, and default gateway address corresponding to your network configuration
  • Now type the following command to set up a DNS server address and hit Enter : netsh interface ip set dns name= "Ethernet1" static 10.1.4.1

That's it. Your new static IP address will be set up from here.

How to Set Up a Static IP Address With PowerShell

PowerShell is another tool primarily handy for power users, designed to give them more control and management capabilities through task automation. If any of the above methods fail, you can also use PowerShell to set up the Static IP Address. Here’s how you can get started:

  • Head to the Start menu search bar, type in ‘powershell,’ and run it as administrator.
  • Type the following command to view your current network configuration and press Enter : Get-NetIPConfiguration
  • InterfaceIndex
  • IPv4Address
  • IPv4DefaultGateway
  • Type in the following command to set up a static IP address and hit Enter : New-NetIPAddress -InterfaceIndex 10 -IPAddress 10.1.4.119 -PrefixLength 24 -DefaultGateway 10.1.4.1
  • Here, replace all values of information. Replace the InterfaceIndex number (10) with the number assigned to your adapter. Similarly, replace the above IPAddress with a static IP address that you want to set.
  • Finally, type in the following command to assign the DNS server address and hit Enter : Set-DnsClientServerAddress -InterfaceIndex 10 -ServerAddresses 10.1.4.1

Again, replace the InterfaceIndex number (10) with your network’s corresponding number. Also, replace the ServerAddress with the DNS IP address.

You will have a new static IP address as soon as you finish all the above steps.

Setting up a Static IP Address on a Windows PC

Setting up your static IP address doesn't have to be complicated. If you follow the above methods we have laid out above, you should be done without any significant difficulties.

And while static IP address has their uses, dynamic addresses are undoubtedly necessary. So, before you make an important switch, ensure you understand their significant differences well.

change ip address windows 7 command line

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 .

Facebook

Need more help?

Want more options.

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

change ip address windows 7 command line

Microsoft 365 subscription benefits

change ip address windows 7 command line

Microsoft 365 training

change ip address windows 7 command line

Microsoft security

change ip address windows 7 command line

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

change ip address windows 7 command line

Ask the Microsoft Community

change ip address windows 7 command line

Microsoft Tech Community

change ip address windows 7 command line

Windows Insiders

Microsoft 365 Insiders

Find solutions to common problems or get help from a support agent.

change ip address windows 7 command line

Online support

Was this information helpful?

Thank you for your feedback.

Windows Command Line

Check IP address from CMD

Ipconfig command is used to find the IP address of a system from command line. Run the command ipconfig  to print IP addresses for all network adapters installed on the system.

If you are interested in just knowing the IP address and not bothered about all other details printed by the command, you can use findstr to filter out unwanted details.

Here, it shows IP addresses for various interfaces installed on the computer, it includes IPv6 interfaces as well.

If the system is connected to a DHCP configured network then you can release the IP obtained from DHCP.

The above command works for IPv4. To release IPv6 address the command is given below.

Not show DHCP in my computer

I run cmd / ipconfig using an admin account and it displays the Default Gateway 86.187.161.242, but as it’s a dynamic IP address it both changes each log in and always times out after about 20 seconds. How can I extend the time out to say a minute?

Default Gateway = Router If you login on your firmware of the router and go to your DHCP server settings. And change your Client Lease Time. That should do the trick. ( https://www.wikihow.com/Configure-a-Router-to-Use-DHCP )

If the default gateway it self changes after 20 seconds. Then I suggest to contact your ISP provider. Or google how to set a static IP to your default gateway.

i want to get only ip 192.168.x.x but it’s showing me like IPv4 Address. . . . . . . . . . . : 192.168.x.x i dont want (IPv4 Address. . . . . . . . . . . :) this part and also i want this in a vbscript that can store this value in a variable please help .

To find simply the ip, version 4, you can use this command: ipconfig | findstr /C:”IPv4″

To find ip, version 6: ipconfig | findstr /C:”IPv6″

for /f “tokens=14*” %%i in (‘ipconfig ^| findstr /i ipv4 ^| findstr /i /v autoconfiguration’) do set ipaddress=%%i

informative

Leave a Comment

More Recent Posts

  • Add new user account from command line (CMD)
  • Delete directory from command line [Rmdir]
  • TaskKill: Kill process from command line (CMD)
  • Kill Chrome from command line
  • Find windows OS version from command line
  • How to check if Windows 32 or 64 bit?
  • Get Windows install date
  • User questions about fixing javac not recognized error
  • How to Kill process from PowerShell
  • Fix WMIC invalid alias verb error

E-mail Newsletter

  • Automation (2)
  • Batch Files (9)
  • Command Line Errors (2)
  • Command prompt (3)
  • Directories (5)
  • Download (1)
  • Network (6)
  • PowerShell (5)
  • Remote access (7)
  • Run commands (28)
  • System Configuration (28)
  • System information (21)
  • Uncategorized (43)
  • User Accounts (23)
  • User Settings (9)
  • Windows Commands (34)
  • Windows shortcuts (4)

Android Police

How to find your ip address.

Write down your IP address; you're gonna need it later

Whether you use a Google Pixel phone , Chromebook, desktop, or another device to connect to the internet, you'll encounter something that requires your IP address. Any networking activity requires knowing your IP address. It makes troubleshooting easier with internet service providers (ISPs) and tech support for software or hardware that requires an internet connection. Also, you'll need it to remotely access your devices or share your network with other devices, such as a printer. Here's how to find your IP address on a Mac, Windows, Android, or iOS device.

What is the IP address?

Your device's unique position on the internet is marked by an IP (Internet Protocol) address, a numerical code allocated by your internet service provider (ISP). This code functions similarly to a residential address but for your online presence, distinguishing your device from billions of others.

Devices within your local network have private (local) IP addresses but share a common public IP address the internet service provider (ISP) allocates to your router. IPv4 and IPv6 are the two common versions of IP addresses.

IPv4 uses a 32-bit format that offers around 4.3 billion unique addresses. However, due to the internet's growth, IPv4 addresses are running out . In response to this shortage, IPv6 was introduced, using a 128-bit format to provide a virtually limitless number of addresses.

IPv6 addresses are in hexadecimal, shown as 2001:0db8:85a3::8a2e:0370:7334. The transition to IPv6 is ongoing, with IPv4 and IPv6 addresses currently being used on the internet. Dual-stack technology allows devices to run IPv4 and IPv6 simultaneously.

IP address explained in practice

When you type example.com into your browser, your device first needs to find the IP address of the server hosting example.com. This is done through a Domain Name System (DNS) lookup.

Your device queries a DNS server, which translates the domain name into a public IP address of the website's server. Your device sends the request to access the website to your router. This request includes the destination server's public IP address (obtained from the DNS lookup) and is sent from your local network to the internet.

The request carries your network's public IP address as the current source IP. This is because the internet does not recognize private IP addresses for routing. The server hosting example.com receives the request and sends the requested data back to the source IP address specified in the request, which is your router's public IP address.

The router uses your device's private IP to deliver the data to the correct device on your local network and loads the data for you on your screen.

How to make Android use the DNS server of your choice

How to find your ip address on windows 11.

To view your local IP address with Windows 11, follow these instructions:

1. Open the Windows Start menu , type Settings , and open it.

2. Navigate to Network & internet on the left panel, then click Properties .

3. Your local IP address (including IPv4 and IPv6 addresses) displays here.

How to find your IP address on Windows 10

For Windows 10, find your local IP address by following these steps:

1. Open the Windows Start menu and select Settings .

2. Choose Network & Internet .

3. For Wi-Fi connections, select Wi-Fi on the left, then Advanced Settings . For wired connections, select Ethernet and your network connection.

4. Your IPv4 address is listed here.

How to find your IP address on Windows 7, 8, and 8.1

Here's how to find your local IP address in Windows 8, 8.1, or 7:

1. Locate and select the Network Connection icon on the taskbar, then open the Network and Sharing Center .

2. Depending on your connection type, double-click Wireless Network Connection for Wi-Fi or Local Area Connection for wired connections. Then click Details .

3. Your local IPv4 or IPv6 addresses are shown here.

Find your IP address using Command Prompt (CMD)

The following steps help you locate your local IP address via Command Prompt, regardless of the Windows version:

1. Open the Windows Start menu , type CMD , and open Command Prompt .

2. In Command Prompt , type ipconfig and press Enter to view your local IP addresses.

How to find your IP address on macOS

If you use a Mac computer, follow these steps to find your IP address:

1. Open the Apple menu , then click System Settings .

2. Click Network in the left panel, then select Wi-Fi or Ethernet .

3. Click Details next to the connected network, then choose TCP/IP to view your IP addresses.

How to find your IP address using Mac Terminal

Find your Mac's local IP address by following these steps:

1. Press Command + Spacebar to launch Spotlight and open the Terminal. Or open Finder , go to Applications > Utilities , and double-click Terminal .

2. For Wi-Fi, type ipconfig getifaddr en1 . For Ethernet connections, type ipconfig getifaddr en0 and press Enter.

3. To view your public IP, type curl ifconfig.me and press Enter .

How to find your IP address on iPhone and iPad

iPhone and iPad users can check their local IP address with these instructions:

1. Open Settings and tap Wi-Fi .

2. Tap the information icon (i) next to the network you're on.

3. Your IPv6 and IPv4 addresses are listed here.

How to find your IP address on Android

We used a Samsung Galaxy S21 Ultra for this guide, but the process is similar for Android devices:

1. Go to Settings , then tap Connections .

2. Select Wi-Fi , then tap the settings gear icon next to your network.

3. Tap View more and scroll to find your IPv4 and IPv6 addresses.

Mask your online footprint

Online anonymity depends on protecting your IP address. IP addresses can be traced to reveal your location, making it easy to track you down on the internet. Combining this information with metadata and cookies could lead to identity theft. One way to hide your IP is to use a virtual private network (VPN) , which masks your IP address. We ranked the best VPNs to help you choose the right one for your online privacy.

How to trace an email to its source IP address

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Unable to change my ip address

I can't change my ip address. When I right click local area connection -> properties, the properties for Internet Protocol Version 4 is greyed out. could anyone help me fix this? thanks a lot.

Or could anyone show me how to change ip address via command line?

segfault's user avatar

  • Is your PC administrated by someone else? You might lack permissions for changing these settings. –  private_meta Jun 17, 2014 at 7:59

To change your IP address via command line, use the following command:

netsh interface ipv4 set address "Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1
  • 192.168.0.100 is your IP address
  • 255.255.255.0 is your netmask
  • 192.168.0.1 is your gateway

To also change your DNS server, use the following command:

netsh interface ipv4 set dnsservers "Local Area Connection" static 192.168.0.1
  • 192.168.0.1 is the IP address of your DNS server

These commands have to be used from an elevated command prompt (start as Administrator).

However, if you lack the permissions to change the settings via the GUI, these commands also might not work.

Oliver Salzburg's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged windows-7 ip ..

  • The Overflow Blog
  • Reshaping the future of API platforms
  • Between hyper-focus and burnout: Developing with ADHD
  • Featured on Meta
  • Our Partnership with OpenAI
  • Imgur image URL migration: Coming soon to a Stack Exchange site near you!

Hot Network Questions

  • Conjecture about union-closed families of sets - attempt 3
  • Windows War Strategy Game
  • Is the largest root of a random polynomial more likely to be real than complex?
  • What exactly does a rest mean?
  • Why would a transforming vehicle gain\lose access to its primary weapon when it mode switches?
  • When is it worthwhile to report academic misconduct of a referee?
  • Independence of CH and permutation models?
  • Unit Tests for an Arena Allocator
  • Is science value-free?
  • Retrieving label boundaries within QGIS Layout maps
  • Remove bone rotation limit?
  • What is Rishi Sunak's reasoning/incentive to talk of a hung parliament, rather than a Labour majority, right now?
  • Efficient C Tokenizer/Lexer in C++
  • Why is the reliability of Stormy Daniels testimony relevant in Trump's hush money process?
  • What can you use in your soil to kill bugs before planting vegetables?
  • Java interpreter
  • How can I work with a senior researcher who is less knowledgeable than myself?
  • Which cognitive psychology findings are solid, that I can use to help my students?
  • How did the bugs get all over the place?
  • Can someone who isn't flying meet me at my gate for a layover at Istanbul airport?
  • What is the maximum contribution allowed to my HSA if my husband is enrolled in a PPO plan, while both my child and I are enrolled in a CDHP/HSA plan?
  • Series connection of diode and resistor. Why is there a constant voltage across the diode?
  • Would you correct grading mistakes downwards if there is a mistake in grading?
  • SortedSet.IsSubsetOf not working as expected

change ip address windows 7 command line

Change the hostname of your AL2 instance

When you launch an instance into a private VPC, Amazon EC2 assigns a guest OS hostname. The type of hostname that Amazon EC2 assigns depends on your subnet settings. For more information about EC2 hostnames, see Amazon EC2 instance hostname types in the Amazon EC2 User Guide for Linux Instances .

A typical Amazon EC2 private DNS name for an EC2 instance configured to use IP-based naming with an IPv4 address looks something like this: ip-12-34-56-78.us-west-2.compute.internal , where the name consists of the internal domain, the service (in this case, compute ), the region, and a form of the private IPv4 address. Part of this hostname is displayed at the shell prompt when you log into your instance (for example, ip-12-34-56-78 ). Each time you stop and restart your Amazon EC2 instance (unless you are using an Elastic IP address), the public IPv4 address changes, and so does your public DNS name, system hostname, and shell prompt.

This information applies to Amazon Linux. For information about other distributions, see their specific documentation.

Change the system hostname

If you have a public DNS name registered for the IP address of your instance (such as webserver.mydomain.com ), you can set the system hostname so your instance identifies itself as a part of that domain. This also changes the shell prompt so that it displays the first portion of this name instead of the hostname supplied by AWS (for example, ip-12-34-56-78 ). If you do not have a public DNS name registered, you can still change the hostname, but the process is a little different.

In order for your hostname update to persist, you must verify that the preserve_hostname cloud-init setting is set to true . You can run the following command to edit or add this setting:

If the preserve_hostname setting is not listed, add the following line of text to the end of the file:

To change the system hostname to a public DNS name

Follow this procedure if you already have a public DNS name registered.

For AL2: Use the hostnamectl command to set your hostname to reflect the fully qualified domain name (such as webserver.mydomain.com ).

For Amazon Linux AMI: On your instance, open the /etc/sysconfig/network configuration file in your favorite text editor and change the HOSTNAME entry to reflect the fully qualified domain name (such as webserver.mydomain.com ).

Reboot the instance to pick up the new hostname.

Alternatively, you can reboot using the Amazon EC2 console (on the Instances page, select the instance and choose Instance state , Reboot instance ).

Log into your instance and verify that the hostname has been updated. Your prompt should show the new hostname (up to the first ".") and the hostname command should show the fully-qualified domain name.

To change the system hostname without a public DNS name

For AL2: Use the hostnamectl command to set your hostname to reflect the desired system hostname (such as webserver ).

For Amazon Linux AMI: On your instance, open the /etc/sysconfig/network configuration file in your favorite text editor and change the HOSTNAME entry to reflect the desired system hostname (such as webserver ).

Open the /etc/hosts file in your favorite text editor and change the entry beginning with 127.0.0.1 to match the example below, substituting your own hostname.

You can also implement more programmatic solutions, such as specifying user data to configure your instance. If your instance is part of an Auto Scaling group, you can use lifecycle hooks to define user data. For more information, see Run commands on your Linux instance at launch and Lifecycle hook for instance launch in the AWS CloudFormation User Guide .

Change the shell prompt without affecting the hostname

If you do not want to modify the hostname for your instance, but you would like to have a more useful system name (such as webserver ) displayed than the private name supplied by AWS (for example, ip-12-34-56-78 ), you can edit the shell prompt configuration files to display your system nickname instead of the hostname.

To change the shell prompt to a host nickname

Create a file in /etc/profile.d that sets the environment variable called NICKNAME to the value you want in the shell prompt. For example, to set the system nickname to webserver , run the following command.

Open the /etc/bashrc (Red Hat) or /etc/bash.bashrc (Debian/Ubuntu) file in your favorite text editor (such as vim or nano ). You need to use sudo with the editor command because /etc/bashrc and /etc/bash.bashrc are owned by root .

Edit the file and change the shell prompt variable ( PS1 ) to display your nickname instead of the hostname. Find the following line that sets the shell prompt in /etc/bashrc or /etc/bash.bashrc (several surrounding lines are shown below for context; look for the line that starts with [ "$PS1" ):

Change the \h (the symbol for hostname ) in that line to the value of the NICKNAME variable.

(Optional) To set the title on shell windows to the new nickname, complete the following steps.

Create a file named /etc/sysconfig/bash-prompt-xterm .

Make the file executable using the following command.

Open the /etc/sysconfig/bash-prompt-xterm file in your favorite text editor (such as vim or nano ). You need to use sudo with the editor command because /etc/sysconfig/bash-prompt-xterm is owned by root .

Add the following line to the file.

Log out and then log back in to pick up the new nickname value.

Change the hostname on other Linux distributions

The procedures on this page are intended for use with Amazon Linux only. For more information about other Linux distributions, see their specific documentation and the following articles:

How do I assign a static hostname to a private Amazon EC2 instance running RHEL 7 or Centos 7?

Warning

To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.

  • Skip to content
  • Skip to search
  • Skip to footer

Change the Management Interface IP Address on FTD Managed by FMC

change ip address windows 7 command line

Available Languages

Download options.

  • PDF (265.1 KB) View with Adobe Reader on a variety of devices
  • ePub (326.7 KB) View in various apps on iPhone, iPad, Android, Sony Reader, or Windows Phone
  • Mobi (Kindle) (274.7 KB) View on Kindle device or Kindle app on multiple devices

Bias-Free Language

The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.

Introduction

This document describes how to change the management IP for the Firewall Threat Defense device managed by the Secure Firewall Management Center.

Prerequisites

Requirements.

Cisco recommends that you have knowledge of these topics:

  • Cisco Secure Firewall Management Center (FMC)
  • Cisco Secure Firewall Threat Defense (FTD)

Components Used

The information in this document is based on these software and hardware versions:

  • Secure Firewall Management Center Virtual running version 7.2.5(1) 
  • Cisco Secure Firewall Threat Defense Virtual running version 7.2.4

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.

Configurations

Step 1. Navigate to the FMC GUI, and proceed to Device > Device Management.

Step 2. Select Device , and find the Management section.

Management Section

Step 3. Turn off Management by clicking the slider, and confirm the action by selecting Yes .

Disable Management

Note : Turning off Management halts the connection between the management center and the device but retains the device within the management center.

Step 4. With Management disabled, edit the management connection by selecting Edit .

Step 5. In the Management dialog box, change the IP address in the remote Host address field, and then select Save .

Management Remote IP

Step 6. Connect to the FTD console to modify the Management IP address.

Warning : Altering the Management IP address can result in the loss of SSH connectivity to the device if the session is established through the management IP address. Therefore, it is recommended to perform this change via Console access as suggested by Cisco.

Step 7. In Clish mode, modify the Management IP address with the command:

Note : This configuration is applied to the management interface by default.

Step 8. Return to the FMC GUI, and reactivate Management by toggling the Slider to the On position.

Reactivate the Management

Step 9. Be aware that reestablishing the Management connection can require some time; successful reconnection is indicated as demonstrated in this image:

Successful Reactivation

Use this section in order to confirm that your configuration works properly.

You can verify the Management connectivity through the FTD CLI. This is achieved by connecting to the CLI, on Clish mode running this command:

Troubleshoot

This section provides information you can use in order to troubleshoot your configuration.

To verify the management connection status at the FTD CLI, run the command show sftunnel status brief . Observe the output for a connection that is down, indicated by the absence of connected to details for the peer channel and missing heartbeat information.

A healthy connection between the devices is confirmed when the  sftunnel-status-brief command at the FTD CLI produces an output that includes peer channel connected to information and heartbeat data.

  • To check network connectivity, ping the management center from the Management interface, and enter ping system fmc_ip at the FTD CLI.

Related Information

Device Management Basics

  • Cisco Technical Support & Downloads

Revision History

TAC Authored

Contributed by Cisco Engineers

  • Jose Trinidad Gomez Delgado Cisco Security Technical Consulting Engineer

Was this Document Helpful?

Feedback

Contact Cisco

login required

  • (Requires a Cisco Service Contract )

This Document Applies to These Products

  • Secure Firewall Management Center Virtual
  • Secure Firewall Threat Defense Virtual

change ip address windows 7 command line

COMMENTS

  1. How to Change Your IP Address From the Command Prompt in Windows

    View Your Network Information with Command Prompt. 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: netsh interface ipv4 show config. Scroll down until you see the interface you're looking for.

  2. Changing the preferred IP address in windows 7

    To assign the IP address and default gateway manually, follow the steps below: a) In system tray, right click network icon. Choose Open Network and Sharing Center. b) Right click on Local Area Connection and click on Properties. c) Double click Internet Protocol Version 4 (TCP/IPv4) and assign the IP address manually.

  3. How to Change IP Address in Command Prompt (Renew IP)

    To renew or change the IP address, you can use the netsh command. Here're the steps to change the IP address in Command Prompt in Windows 10. When connected to a network, the Windows computer will automatically get a new IP address as long as it is configured to "Obtain an IP address automatically". Generally, having the IP address auto ...

  4. How to change the IP address in Windows 10 and Windows 11 (4 ways)

    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.". In the Network and Sharing Center, click or tap on your internet connection from the "View your active networks" area.

  5. Change IP Address and DNS Servers using the Command Prompt

    The first step to changing your IP address is to find the network name for the interface you want to change. Open an elevated Command Prompt by typing CMD in the search bar and clicking on Run as Administrator. Next, type netsh interface ipv4 show config in the command prompt window, press Enter, and scroll down to the interface you want.

  6. windows 7

    ipconfig /release and then ipconfig /renew in Command Prompt, but it depends on the Lease Time of your DHCP server in the router, you could get the same IP back. - Alex. Nov 23, 2013 at 22:11. 2. @Tony Likely because that changed the router's WAN IP address. People outside your LAN cannot see into it. Changing your LAN IP addresses won't ...

  7. How To Change & Configure An IP Address or Set to DHCP, Using The

    Opening The Administrative Command Prompt On Windows 7. To open the administrative command prompt in Windows 7, first click on the Start icon. In the search dialog box that appears, type cmd and right-click on the cmd search result displayed. On the menu that Windows brings up, click on the Run as administrator option as shown in the below ...

  8. Release and Renew Your IP Address in Microsoft Windows

    Here's how to release and renew the address of any computer running the Windows operating system. Open Command Prompt. The quickest method is to press Win + R to open the Run box dialog, enter cmd, and then press Enter . Enter ipconfig /release and press Enter . In the command results, the IP address line shows 0.0.0.0 as the IP address.

  9. How to View & Change Your IP Address in Windows 7, 8, and 10

    In Windows, you can easily view your IP address by typing cmd into the Start Menu to open a command prompt, then typing ipconfig. This will bring up configuration info for all network adapters on your machine (such as Ethernet and wireless), letting you view the IP address and more for each one. On a network, you can release this IP address and ...

  10. How to Change Your IP Address From the Command Prompt in Windows

    Just look for the one you want and write down the exact name. To make things easier, you can also copy and paste the name into Notepad and then back into Command Prompt. Change Your IP Address, Subnet Mask, and Default Gateway. With the interface name in hand, you can change the IP Address, subnet mask, and gateway.

  11. How to Change your IP address from the Windows command line

    Need to change your IP address? In this how-to, you'll find instructions for changing your IP address from the Windows command prompt with the ipconfig console application. For step-by-step instructions, take a look. NB: Changing your IP will not protect your identity; it's merely a simple expedient for getting around certain problems ones might encounter while using the Internet.

  12. How to Change Your IP Address (Windows)

    in the bottom-right corner of the screen. Click Wi-Fi in the pop-up window. 3. Wait for five minutes. Some ISPs will assign a new IP address in as little as five minutes; if doing this doesn't work, however, you may need to leave your router unplugged overnight (or for around eight hours). 4.

  13. How to change IP address using script on Windows?

    ipconfig /renew to get a new IP address or default gateway The NETSH command does this. check this.. See this example for setting DNS address manually via netsh command:. netsh interface ip set dns "Local Area Connection" static 192.168..200 configure your NIC to dynamically obtain its DNS settings (* Obtain DNS server address automatically):netsh interface ip set dns "Local Area Connection" dhcp

  14. How to change IP address: on iPhone, Windows, Mac, via cmd

    Press the Windows key on your keyboard or click Start to bring up the boot menu. In the search bar, type " cmd ". Instead of validating the search, press CTRL + SHIFT + Enter. To change IP and default gateway. netsh int ip set address "local area connection" static 192.168..101 255.255.255. 192.168..254 1. To change DNS:

  15. How to change Windows machine IP without being an admin?

    Select the option to repair computer, select OS install, and then select the command prompt option. C:> CD windows\system32 ren utilman.exe utilman.exe.old copy cmd.exe utilman.exe Reboot and load OS as normal. Use the Ease of Access Tools (WindowsKey + U or icon in lower left) to get command prompt a.

  16. How to Set a Static IP Address on a Windows PC

    Here's how you can set a static IP Address using the Windows settings: Head to the Start menu search bar, type in 'settings,' and select the best match. Alternatively, press the Windows Key + I to launch the Settings menu. Then head to Network & internet settings . Look for the Properties button.

  17. Change TCP/IP settings

    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 ...

  18. windows 7

    Stack Exchange Network. Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.. Visit Stack Exchange

  19. 6 ways to find your IP address in Windows

    1. How to find your IP address using CMD, PowerShell, or Windows Terminal. You can open the Command Prompt, PowerShell, or even the Windows Terminal, type the following command, and press Enter: ipconfig. For each network adapter inside your Windows computer, you see its IPv4 and IPv6 addresses.

  20. Check IP address from CMD

    To release IPv6 address the command is given below. Ipconfig command is used to find the IP address of a system from command line. Run the command ipconfig to print IP addresses for all network adapters installed on the system. c:\>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : IPv4 ...

  21. How to find your IP address

    Here's how to find your local IP address in Windows 8, 8.1, or 7: 1. Locate and select the Network Connection icon on the taskbar, then open the Network and Sharing Center .

  22. windows 7

    To also change your DNS server, use the following command: netsh interface ipv4 set dnsservers "Local Area Connection" static 192.168..1. 192.168..1 is the IP address of your DNS server; These commands have to be used from an elevated command prompt (start as Administrator). However, if you lack the permissions to change the settings via the ...

  23. Change the hostname of your AL2 instance

    Change the system hostname. If you have a public DNS name registered for the IP address of your instance (such as webserver.mydomain.com), you can set the system hostname so your instance identifies itself as a part of that domain.This also changes the shell prompt so that it displays the first portion of this name instead of the hostname supplied by AWS (for example, ip-12-34-56-78).

  24. Change the Management Interface IP Address on FTD Managed by FMC

    Step 8. Return to the FMC GUI, and reactivate Management by toggling the Slider to the On position.. Step 9. Be aware that reestablishing the Management connection can require some time; successful reconnection is indicated as demonstrated in this image:. Verify. Use this section in order to confirm that your configuration works properly.