How to Configure Windows 10 IP Address with CMD?

' data-src=

Configuring IP address in a Windows with CMD performed using netsh command line utility. The network shell ( netsh ) is a set of commands that help you configure any Windows operating system IP address, Network Interfaces, and Windows Firewall. The usage of the command line is for pro level Windows users. Those who are playing the network infrastructure configuration. But using the command line as normal Windows user indicate your expertise to Windows environment. If you are new to Windows command line, this article “configure IP address with command prompt in Windows 10” will help you begin using command line interface.

Configuring Windows IPv4 Networking with Netsh or Network Shell. Netsh is a command-line utility included in Microsoft’s Windows NT line of operating systems beginning with Windows 2000. It allows local or remote configuration of network devices such as the NICs.

Configure IP Address with Command Prompt in Windows 10

Before setting IP address with cmd in Windows 10, you need to know how to find your IP address on Windows 10. So before everything, you must know the network IP address configuration on your system.

Let’s learn the process of IP configuration step by step. I am going to explain it with an easy pictorial guide. If you don’t understand some part, just kindly comment us and ask your questions.

The process of Changing Windows 10 IP Address with Command Prompt: 

How to Find your IP Address on Windows 10?

There are many options for finding IP address on Windows 10. The easy one is “ ipconfig ” command. To find your IP address on Windows 10, just type “ ipconfig ” in command prompt. To do this process:

The “ ipconfig ” command shows everything about your computer network interfaces. You might have many physical or virtual network interface card.

How to Find Your IP Address on Windows 10 - Technig

Here, I just have one network interface on my Windows 10 computer. The result of ipconfig command shows that the IP 169.254.29.130 with the mask of 255.255.255.0 is my current Windows IP address.

This is a class C “autoconfiguration IPv4”. When your system doesn’t find any DHCP Server or manual IP address, it obtains auto IP address. So let’s change it.

How to C hange  IP Address with  Command Prompt?

For change IP address, open command prompt or PowerShell. Both works the same and you can run all command prompt commends on Powershell as well. Ok, run cmd or Powershell as administrator. Netsh work in both command prompt and Powershell. I’m using Windows Powershell to change IP address on Windows 10 completely. Becuase the user interface and color’s of Powershell is better than Command prompt.

PowerShell Guide in Windows 10

To find the network interface with the command line, type the following command on Powershell.

Netsh Command to Check Network Adapter in Windows 10

The result shows two network interfaces. The Loopback and the Ethernet. The Loopback is Windows builtin network loopback interface, but our pointed network interface is the ethernet.

To find your IP address in Windows 10 with netsh command, just type the following command.

How to Find Your IP Address on Windows 10 with Netsh Command - Technig

It displays all the network interface configuration. The output result is clear and better than output result of “ ipconfig ” command on Command prompt. So to find an exact information of the network interface, just add the index ID of the network interface at the end of the command.

How to Find Windows 10 IP address with Command Line - Technig

That’s good. Let’s configure and change Windows 10 IP address with the command line. The command is bit long but easy to understand. No need to remember, just try to understand the netsh command structure.

To change the IP address of the “Ethernet0” network interface, type the following command.

Change IP Address in Windows 10 using Command Line - Technig

Once the command executed successfully, check the result with “ netsh interface ipv4 show config 2 ” command. Yes, the output result shows the exact IP address has set on the “ Ethernet0 ” network interface. Now the Windows IP address is 200.100.10.5 with the mask of 255.255.255.0 and default gateway is 200.100.10.1.

Note : You can’t change the default gateway separately with the following command. It will remove the IP address and just set the default gateway address.

That’s good and enough for IP address configuration in Windows 10 with the command line. Let’s change DNS IP address from the command line.

How to Change DNS IP address from Command Prompt?

DNS IP address is the unique address in the network that resolves computer name to IP address and IP address to the computer name. In the network, finding a computer with a name is easy than 32-bit IPv4 address. To set or change the DNS IP address, just simply do it with the following command.

How to Change DNS IP address from Command Prompt - Technig

You might see some error on a simple local network, because of not having a DNS server. When you don’t have a DNS server, it’s not necessary to set DNS IP address on your computer.

Configure IP Address with command prompt in Windows - Technig

Finally, recheck the result with “ netsh interface ipv4 show config 2 ” command. The output netsh command should be displayed with DNS IP address.

Final World

Configure IP address with command prompt in Windows has tow benefits. The first benefit of working with Windows command line helps get you improve your skills in Windows environment. The second benefit is command line is faster than GUI. If you work with the command line, you will understand the power of command line.

The Windows command line interface has improved a lot in Windows 10. Now you can find some Linux commands that run in Windows 10 and works the same on Linux. Finally, hope you learn how to configure IP address with Command Prompt in Windows operating systems. If you don’t understand, please ask us about how to configure IP address with command prompt in Windows 10?

' data-src=

How to change DNS zone settings in Windows Server 2022?

How to Share Files Over Network (Share Permissions) on Windows 11

Deny Users Access to PC Settings and Control Panel using Group Policy

How to Add New Domain Controller to Existing Domain

' data-src=

I am thankful to you for your articles.

' data-src=

i changed my ip address and need it back

' data-src=

You are the greatest! I have been banging my head trying to find information on how to do this. 2 days and the only information I changed was “connected” to “not connected”, thank you so much

Your email address will not be published.

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

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Welcome, Login to your account.

Recover your password.

A password will be e-mailed to you.

StackHowTo

Home » Windows 10 » How To Set Static IP Address in Windows 10 using CMD

How To Set Static IP Address in Windows 10 using CMD

I n this tutorial, we are going to see how to set static IP address in Windows 10 using CMD . There are several methods to set a static IP address in Windows 10. In this tutorial, we will see together how to set a static IP address from the Command Prompt.

In Windows 10, setting a static IP address for your device is an essential configuration that may be required in a number of scenarios. For example, if you plan to share files or a printer on a local network, or when you try to set up port forwarding.

Using CMD may seem difficult for some users, yet it is one of the fastest ways to assign a static IP address in Windows 10.

assign ip address command line windows

assign ip address command line windows

How to Disable Power Throttling in Windows 10

How to Delete the Hibernation File hiberfil.sys

How to Hide Your Name and Email Address on Windows Login

How To Find Out If a Program is 32 or 64-bit Windows 10

You May Also Like

How to Delete the Hibernation File hiberfil.sys

Leave a Reply Cancel reply

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

Show Contents

Assign an IP address from the command-line interface

Use the set network command to configure an IP address from the command line. The set network command includes the following parameters:

For example:

To configure the Digi Connect SP through the command line, you must change the DIP switches. See Set DIP switches on Digi Connect SP\Wi-SP for an illustration of the DIP switch settings.

© 2022 Digi International Inc. All rights reserved. Assign an IP address from the command-line interface updated on 02 Jul 2018 01:18 PM

How to set a Static IP Address in Windows 11/10

Assign a static ip address in windows 11/10, 1] setting a static ip address via control panel, 2] assign static ip address via settings, 3] assigning static ip address via powershell, 4] assign a static ip address using command prompt, what is static ip connection, what is static ip used for.

A static IP address offers convenient remote access which makes it easier to work remotely using a Virtual Private Network (VPN) or other remote access programs. Besides, it enables more reliable communication [use Voice over Internet Protocol (VoIP) for teleconferencing or other voice and video communications].

[email protected]

Tweaks.com Logo

Configure IP Address and DNS from Command Line

Posted in Windows 10 , Windows 7 , Windows Vista , Windows Server by Steve Sinchak

assign ip address command line windows

The first thing you need to identify is the name of the network interface you want to modify.  You can find the names of all network interfaces by running the following command:

This will list all the interfaces available.  In most cases, your wired network adapter will be called "Local Area Connection" but it may include a number at the end of the name.  It is important to use the full name in the commands below and surround it with quotes if the name contains spaces.   

How to set a static IP address

A static IP address can be set from the command prompt by running the netsh command at an administrative level prompt.  Make sure to substitute the parameters in the command below for your environment. 

"Local Area Connection" is the name of the adapter you want to modify.

"123.123.123.123" is the IP address you want to set. 

"255.255.255.0" is the subnet mask.

"123.123.123.1" is the gateway.

The "1" on the end of the command is the gateway metric. You will want to leave this as 1 for almost all cases. 

How to enable DHCP instead of a static IP

If you want to enable DHCP you can run:

As mentioned in the previous section, replace "Local Area Connection" with the name of the network adapter you want to modify.  

How to Set Specific DNS Servers

There are two commands for DNS since administrators typically configure a primary and secondary DNS server. 

For the primary DNS server run:

For the secondary DNS server run:

How to configure the network adapter to use the DNS servers provided by DHCP:

If you PC is already configured to use DHCP want to configure the adapter to use DNS from DHCP as well run the following command. 

When you are finished with all of your IP and DNS changes run ipconfig -all to review the new settings.

Windows 10

Hot Deals @ DealGizmo.com

Rechargeable Lighted Makeup Mirror Wall Mount Extendable Double Sided Vanity Mirror with 10X Magnification 8 Inch Led Magnifying Mirror with 3 Color Lights Articulating Bathroom Mirror Matt Nickel

$46.99 $37.39 (20% off) Rechargeable Lighted Makeup Mirror Wall Mount Extendable Double Sided Vanity Mirror with 10X...

Apple 96W USB-C Power Adapter

$80.38 $59.00 (27% off) Apple 96W USB-C Power Adapter

Multi Plug Outlet Extender with USB Outlets Power Strip Non Surge Protector Electric Outlet Splitter with 3 USB Wall Charger (1 USB C) Multiple Outlet Expander for Cruise Dorm Travel Home Office

$12.99 $9.99 (23% off) Multi Plug Outlet Extender with USB Outlets Power Strip Non Surge Protector Electric Outlet Splitter...

Apple 140W USB-C Power Adapter

$99.00 $79.00 (20% off) Apple 140W USB-C Power Adapter

SteelSeries Arctis Nova Pro Wireless Xbox Multi-System Gaming Headset - Premium Hi-Fi Drivers - Active Noise Cancellation - Infinity Power System - ClearCast Mic - Xbox PC PS5 PS4 Switch Mobile

$349.99 $280.00 (20% off) SteelSeries Arctis Nova Pro Wireless Xbox Multi-System Gaming Headset - Premium Hi-Fi Drivers -...

NOBLEWELL Computer Desk with Storage Shelves 47 inch Home Office Desk with Monitor Stand Writing Desk Table with Keyboard Tray (Rustic Brown)

$139.99 NOBLEWELL Computer Desk with Storage Shelves 47 inch Home Office Desk with Monitor Stand Writing...

Apple 20W USB-C Power Adapter - iPhone Charger with Fast Charging Capability Type C Wall Charger

Sold Out / Pre-Order Apple 20W USB-C Power Adapter - iPhone Charger with Fast Charging Capability Type C Wall Charger

Sceptre IPS 43.8 inch UltraWide 32:9 LED Monitor 3840x1080 up to 120Hz DisplayPort HDMI USB Type-C HDR600 AMD FreeSync Premium Build-in Speakers and remote Nebula White (E448B-FSN168)

$479.97 $379.97 (21% off) Sceptre IPS 43.8 inch UltraWide 32:9 LED Monitor 3840x1080 up to 120Hz DisplayPort HDMI USB Type-C...

Acer Aspire Vero AV15-51-7617 Green PC | 15.6

$699.99 $573.00 (18% off) Acer Aspire Vero AV15-51-7617 Green PC | 15.6" FHD IPS 100% sRGB-Display | 11th Gen Intel Core...

ATOTO F7 XE 7inch Wireless CarPlay & Wireless Android Auto Double-DIN Car Stereo Receiver- Mirror Link Bluetooth HD Live Rearview Quick Charge QLED Display SiriusXM F7G2A7XE

$359.80 $199.90 (44% off) ATOTO F7 XE 7inch Wireless CarPlay & Wireless Android Auto Double-DIN Car Stereo Receiver- Mirror...

Windows 7 Tweaks by Steve Sinchak

Windows Server 2012 Training, Citrix Training, VMWare Training

ITIngredients

Add Spice To Technology

ChangeIPAddressFromCommandPrompt

How to change IP Address from command prompt

How to change ip address from command prompt.

In this post we’ll learn the steps to assign an IP address to Windows Server 2012 R2 from command prompt. We’ll use Netsh command to change an IP. IP (Internet Protocol) is an identify of your Computer. It is required for computers to communicate with teach other. There are multiple ways to change the IP address, in addition to that you can either assign static IP address to your Computer or Dynamic IP address to your Computer. DHCP Server is required if you want Dynamic IP Address to be assigned to your Server.

1. Right click on start and select the command prompt (admin).

ChangeIPAddressFromCommandPrompt

2. On User Account Control window click on “Yes” to open command prompt.

ChangeIPAddressFromCommandPrompt

3. Type command “ ipconfig ” to check an IP address of your computer. This shows an APIPA IP address . APIPA is “ Automatic Private IP Addressing “, this concludes that our computer is not able to communicate with DHCP Server as currently we don’t have any DHCP in our environment.

ChangeIPAddressFromCommandPrompt

4. To assign an IP to our computer type “ Netsh “. It will show “ netsh> ” console. Then type “ Interface   IP ” this will change the console to “ netsh interface ipv4 “.

ChangeIPAddressFromCommandPrompt

5. Type the command “ set address “Ethernet0” static 192.168.1.10 255.255.255.0 192.168.1.1 “. In this command “Ethernet0” is the name of our Ethernet Adapter. As we are assigning static IP address therefore we need to mention an IP address and a subnet mask. 192.168.1.10 is an IP address that we want to assign and 255.255.255.0 is a subnet mask. In addition to IP we are also assigning Gateway to this computer after subnet mask we can define the gateway which is 192.168.1.1 in this example.

ChangeIPAddressFromCommandPrompt

6. Moreover we need to define DNS information. Type a command “ set dnsservers “Ethernet0” static 192.168.1.10 primary ” to define the primary DNS. Here, “Ethernet0” is the name of our network adapter and 192.168.1.10 is the IP of DNS.

ChangeIPAddressFromCommandPrompt

7. Type “ Exit ” to exit from netsh interface ipv4 console.

ChangeIPAddressFromCommandPrompt

8. Type “ ipconfig /all ” to verify that static IP address, subnet mask, default gateway and DNS server IP is assigned.

ChangeIPAddressFromCommandPrompt

If you are not fond of commands then you can change IP address from GUI .

Related articles:

How to Assign Static IP Address to Your Devices

IP address

By default, your router assigns dynamic IP Address to every device that connects to it. This is called DHCP (short for Dynamic Host Control Protocol). But sometimes, we need our devices to have the same IP address (i.e. Static IP) every time it connects to the network. Reason being,

IP address

What IP address should you choose?

If two devices on the network have the same IP address, then there will be conflicts. The Internet won’t work on one of them or both, depending on your router. So, it’s important to assign a unique IP address to your computer. There are a couple of ways to pick an unused IP address.

For instance– first  find your device’s IP address , say it’s  192.168.1.7 ; then keep the first three values (i.e. 192.168.1) as it’s and replace the last digit with some far number like  192.168.1.222 . Though make sure the last digit should be between a  0-255  range.

Assigning Static IP address to most devices is easy, just go to its network settings, look for DHCP option and turn it OFF. Once you do that, you’ll see a text area to enter Static IP address. Enter the new IP address there, save changes and that’s it.

So let’s see how to Assign Static IP address to various Operating Systems

1. Assign IP Address on Windows 10/8/7

You can do this quickly through the command line. You will need to first find your subnet mask, default gateway, and network adapter name. In my case, I’m on a Wi-Fi network, so the adapter name is Wi-Fi. To find yours just type the following command.

Once you get the output, find for the Network Adapter which has IP listed under it. The adapter name is a one-word name suffixed to the end of the Network Title. You will also need the Subnet mask and the Default Gateway Address.

adapter_name_command_line

Once you have the adapter name, Subnet Mask and Default Gateway, run the following command.

Wherein, Wi-Fi should be replaced by your adapter name and the IP, subnet mask and gateway address according to your configuration.

staticIP_cmd

This will change your IP address from DHCP to manual with the static IP address you have specified.

In case you find it too confusing, you are not alone. You can do the same via GUI which is much more intuitive. You’ll need the  Subnet Mask and Default Gateway Address . You can refer to the above step on how to find these details. Once you have noted down the address, click on  Start  Menu and type in  Network and Sharing Center.  Click once you see the Network and Sharing Center Icon.

Network_Sharing_Center_Start_Menu

Alternatively, if you are in Windows 10 then you can right-click on the Start menu and click on “ Network Connections “.

RightClickOnStartMenu_Windows10

A new window will open, click on  Change Adapter Options.

Change_Adapter_Options

Right Click on your Current Network Adapter ( like WiFi)  and choose  Properties.

Right_Click_NetworkAdapter

When the new window pops up, select  Internet Protocol Version 4(TCP/IPv4)   and click on  Properties.

IPv4_Properties

Once you get the pop-up window, select “ Enter the IP address you want ” and fil the IP Address, For Subnet Mask , and Default Gateway Address enter the values that you have noted down previously. Next, click on OK to save changes.

Manual_IP_Settings

To switch to dynamic IP, click on Obtain the IP address automatically. Once this is enabled, your system will start picking an IP address dynamically from the router.

2. How to setup static IP on Ubuntu

On Ubuntu, you can set a static IP Address via the terminal or GUI. Firstly, let’s start with the command line. Right-click anywhere on the desktop to open the terminal.

OpenTerminal_Ubuntu

Once the terminal window opens, we need to run a command. We need the subnet mask and network adapter name in order to set a static IP and to get that, run the following command on the terminal.

assign ip address command line windows

Once you have the subnet mask noted down, in my case, it’s 255.255.255.0, we can proceed further.

It is pretty simple and straight forward. We need to open the Network Adapter settings. To do that, click on the Network Icon at the top right corner of the desktop.

GUI_Network

Now, navigate on the active network and click on the expand button for more options. Click on Wired Settings to open the Network menu.

Wired_Settings_GUI

Once you get the Wired Settings dialogue, make sure you are on the Network page. Click on the Settings icon beside the active network to open the adapter properties.

assign ip address command line windows

When you get the pop-up, navigate to the IPv4 tab to change the IP settings.

IPv4_Tab

On the IPv4 tab, select the radio button which says “ Manual “. Some text fields will appear, you need to enter the IP address, Netmask and Gateway accordingly. Once it is validated, you can click on the Apply button to register the changes.

static_IP_GUI_Ubunty

Again you need to restart the network for the changes to take effect. You can do it manually via command line or just switch off and switch on the Network adapter. Once done, run ifconfig on the terminal to check the IP address. It should be the same IP address which you have specified earlier.

changed_IP_Config

3. How to setup static IP on Mac

If you are on macOS, setting static IP is quite similar to that of Ubuntu. But, here you don’t need the subnet mask or Default Gateway Address. Right click on the apple icon at the top left corner of the desktop. Click on  System Preferences  from the dropdown list.

mac_systemPreferences

Once the System Preferences dialogue box displays, navigate to Network and click on it to open the Network Settings

Network_Symbol

Alternatively, you can also hit Cmd+Space to trigger the Spotlight search. Type “ Network ” in the search bar and click on the icon once it appears. This will directly navigate you to the Network Settings.

network_on_spotlight

From the pop-up window, select an active network interface. For example, I am connected to a WiFi network so my active network is  Wi-Fi. Make sure you are on the active network tab and then click on  Advanced .

Network_Settings_menu

A new window will open the configuration settings for that adapter. Move over to the IP settings by clicking on the TCP/IP tab .

TCP_IP_tab

From the Configure IPv4 menu, choose Using DHCP with manual address.  Enter a static IP address in the IPv4 Address and leave the Subnet Mask and Router field as default. Click Ok to save the changes.

change_tcp_ip_Settings

Now when you do an ifconfig, the system should be using the static IP you have defined in the previous times. If the IP’s have not changed, try restarting the Wi-Fi and it should fix it.

To switch back to dynamic IP, move back to “ Using DHCP ” from the Configure IPv4 menu.

4. How to setup static IP on Android

Settings_menu_Android

The network which you are connected to should be on top of the list. Tap on the settings icon beside the Wi-Fi network name.

Wifi_connected_network

Once the pop-up opens, you will see IP settings at the bottom of the menu. The default option is “DHCP”. Tap on it to change the IP configuration.

IP_Settings_Android

Select “ Static ” from the presented drop-down menu. Enter the desired IP address and leave the other options as default. Make sure that other devices are not using the same IP. You can see the IP address of the other devices in your network by using a small utility called Fing . For a detailed process, check our article on how to find the IP Address of any Device on your network . Once you have entered the IP, click on Save to register the change. Now, your Android phone should start using the desired IP Address.

Manual_IP_Android

In almost all the Android version, you get the option to set static IP Address. For some rare older Android versions, you can use a third-party app like  WiFi Static . It’s free and it doesn’t require ROOT.

To switch back to dynamic IP, repeat the same procedure and select “DHCP” from the IP settings instead.

5. How to setup static IP on iPhone and iPad

If you are using an iPhone or iPad, then you can set static IP Address natively. You would need the Subnet Mask of your network. This can be obtained from the Wi-Fi settings and we would see to it in the further steps. To get started, click on the Settings icon in the dock to get to the Settings menu.

ios_Settings

Now on the Settings menu page, tap on Wi-Fi to get to the Wi-Fi settings.

Settings_page_wifi_ios

On the Wi-Fi page, you should see your connected Wi-Fi network at the top. Click on the “i” button beside it. This will open the Wi-Fi configuration window.

i_button_ios_wifi

Once the Wi-Fi settings page appears, you will see an option called “ Configure IP “. By Default, this would be set to automatic. Just below this option, you will see “ Subnet Mask “, note it down as we will need it in the further steps. In order to set static IP, we need to change Configure IP it to Manual. Tap on it and it will open the IPv4 settings page.

Configure_ip_page

There should be 3 options available on the “Configure IPv4” page. Select “ Manual ” from it. As soon as Manual IP is enabled, you will get extra text fields at the bottom to enter the IP Address, Subnet Mask, Router. We need to fill in the IP Address of our choice and Subnet Mask which we noted down in the previous step. Now, after you fill both the fields, the save button at the top right corner will be enabled. Click on it to save the static IP configuration.

IPv4_Configuration_Menu

Now, when you return to the Wi-Fi settings page, you will see your device is using the Static IP address. This should be the same IP address we have set in the IP configuration menu.

ipaddr_ios

This static IP address will be applicable only to that particular Wi-Fi network. In case, you connect to some other Wi-Fi network the IP will change accordingly.

6. How to setup static IP to any Device from Router

Other network devices like your  Wireless Printer, PS4, NAS, IP Camera, Raspberry Pi , etc. do not have an Interface. Hence, in order to configure the network, either you have to connect remotely or use the router. If you have access to the router, setting Static IP for network devices is the easiest and convenient way. I would recommend this method over any other.

So, to assign a Static IP Address to any network device, you need to login to the web portal of the router. The web portal address, username, and password are mostly printed behind the router. In case you don’t have physical access to the router, the web portal URL is mostly the PC’s gateway address. To find that, open command prompt and type the following command.

Once you have the web portal loaded, log in with the credentials. Now every router has a different web UI, but the overall structure is the same. Basically,  you will have to link the IP Address to the Mac Address and Hostname of the device. So, we need to find the MAC address & Hostname of the network device. To do that, look for DHCP client list which should look something like the following screenshot.

MAC_address_Router

You can get your MAC Address & Hostname under DHCP Client list. Once, you have the MAC address & Hostname noted down, we can proceed further. On most of the routers, you will have the option to set a Static IP under the section  IP Mac binding or DHCP Static IP  option. In case you are on a custom ROM like dd-wrt, head over to Services tab and you will have DHCP Server . Under DHCP Server, add an entry for Static Leases by clicking on the Add button.

Static_leases_router

Clicking on the Add button will create a new row. You have to enter the MAC Address, Hostname, desired Static IP and Lease time . Lease time is a unit in minutes after which your IP will be renewed. Since we are adding only 1 entry for the particular host the IP will be the same even after the renewal. Once, done click on Save changes .

staticIPSetting_Router

Once you have configured successfully on the router, just restart the Wi-Fi on the device. When it connects it should start using the static IP. In case of issues, make sure that you have the correct MAC Address and Hostname. To check, just run the command ipconfig or look back again in the router’s DHCP client list.

ipconfig_newIP

These changes are written to the ROM so restarting the router won’t make changes to the static IP configuration. In order to get back to Dynamic IP, just remove the entry from the IP leases.

What’s next

Once you have started configuring the IPs on Router and network devices, you are good to go configure telnet and SSH. Have a look at our brief article on  How to Enable Telnet Server in Windows 10 ,  Best SSH clients for iOS To Manages Remote Servers and  6 Best FTP Clients For Android . A word of caution would be to note down the static IPs assigned to devices as assigning the same IP to two network devices would render them useless.

Also Read:  How To Change DNS on Windows|Mac|Android|iOS

' src=

Mrinal Saha

Mrinal is a tech geek who spends half of his day reading and writing about tech. While the nights are spent on shooting or editing YouTube videos. Feel free to geek out with him on-

You may also like

How to sign out of amazon on all..., how to setup youtube premium family plan, how to see saved items on facebook marketplace, how to get microsoft teams status change notifications, how to add paid partnership label on instagram..., 25 things you can do with chatgpt, how to add, edit, reorder or delete experience..., top 8 ways to fix snapchat story sound..., 5 best ai art and image generators that..., how to remove titles from continue watching list....

How to configure a static IP on Windows 10 or 11

Do you need to switch from a dynamic to a static IP address configuration on Windows 11 or 10? Here's how.

Windows 11 static IP

On Windows, the router's Dynamic Host Configuration Protocol (DHCP) server is (usually) responsible for assigning a dynamic Transmission Control Protocol/Internet Protocol (TCP/IP) configuration to every device in the network, including to your computer running Windows 11 or Windows 10.

Although a dynamic IP address is the recommended configuration for most situations, you may need to change to a static IP address if you're thinking about setting up a printer or file sharing, or you have to configure port forwarding on the router to your computer.

The reason is that a dynamic network configuration can change at any time after the lease from the DHCP expires and if the address changes, network resources you may have configured will stop working. Setting a static IP address will always stay the same on the computer, allowing a more reliable experience sharing resources in the network or forwarding ports.

Whatever the reason, on Windows 10 and 11, you have many ways to configure a static TCP/IP address, including using the Settings app and Command Prompt.

This guide will walk you through the different ways to configure a static network configuration on Windows 11 and 10.

How to set a static TCP/IP network configuration on Windows 11

On Windows 11, you can change your computer's dynamic IP configuration to static in at least two ways through the Settings app or commands.

Configure IP from Settings app

To assign a permanent TCP/IP configuration on Windows 11, use these steps:

Once you complete the steps, the computer will start using the static network configuration. If everything has been configured correctly, you should be able to open the web browser to access the internet.

If you entered an address (such as the DNS address) and then changed it, you probably won't be able to save the settings. If this is the case, cancel the configuration, start over, enter the correct configuration, and then try to save the settings.

Configure IP from Command Prompt

To set a static TCP/IP configuration on Windows 11, use these steps:

In the above command, replace  ADAPTER-NAME  with the name of your network adapter. Change  IP-ADDRESS SUBNET-ADDRESS    DEFAULT-GATEWAY-ADDRESS  with the device IP address, subnet mask, and default gateway addresses you want. For example, this command sets the 10.1.4.90, 255.255.255.0, 10.1.4.1 configuration:  netsh interface ip set address name="Ethernet 10Gb" static 10.1.4.90 255.255.255.0 10.1.4.1

In the command, change  ADAPTER-NAME  with your adapter's name and  DNS-ADDRESS  with the DNS server address of the network. For example, this command sets the local router as the DNS server:  netsh interface ip set dns name="Ethernet 10Gb" static 10.1.4.1

In the command, change  ADAPTER-NAME  with the adapter's name and  DNS-ADDRESS  with an alternate DNS server address. For example, netsh interface ip add dns name="Ethernet 10Gb" 1.1.1.1 index=2

After you complete the steps, the commands will set a static network configuration on Windows 11.

How to set a static TCP/IP network configuration on Windows 10

On Windows 10, you can also use the Settings app and Command Prompt to set up a static IP network configuration.

To assign a permanent TCP/IP configuration on Windows 10, use these steps:

Once you complete the steps, Windows 10 will start using the static IP configuration. If you lose network connectivity, restart the computer to regain access to the local network and internet.

To change from dynamic to static IP address with commands on Windows 10, use these steps:

In the command, change  ADAPTER-NAME  with your adapter's name and  DNS-ADDRESS  with the DNS server address of the network. For example, this command sets the local router as the DNS server:  netsh interface ip set dns name=" Ethernet 10Gb" static 10.1.4.1

In the command, change  ADAPTER-NAME  with the adapter's name and  DNS-ADDRESS  with an alternate DNS server address. For example, netsh interface ip add dns name="Ethernet0" 1.1.1.1 index=2

After you complete the steps, the network configuration will switch from dynamic to static on Windows 10.

Windows Central Newsletter

Get the best of Windows Central in your inbox, every day!

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.

Thank you for signing up to Windows Central. You will receive a verification email shortly.

There was a problem. Please refresh the page and try again.

To work with the site requires support for JavaScript and Cookies.

Change ip address in windows via command prompt.

To see a list of interfaces:

To set/change an address:

Where "Ethernet" is the name of the interface, 10.0.0.100 is the IP address, 255.255.0.0 is the subnet mask, and 10.0.0.1 is the default gateway.

In Windows, you can use the  netsh  command to edit network interfaces. To see a list of network interfaces on your system (including copies or disabled adapters), type in the following:

To see a list of NICs with their configured network settings, type in the command below:

To set a static IP, run the  netsh  command with the following format:

So, for example, if you need to set the IP address on Local Area Connection 3 to 10.0.0.100 (with a /16 subnet mask and a 10.0.0.1 default gateway), you would enter the following:

If you are setting a static IP for the first time, you will also need to configure a DNS server:

To change the connection back to DHCP, run the following:

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 Quickly Add Multiple IP Addresses to Windows Servers

Read more...

If you have ever added multiple IP addresses to a single Windows server, going through the graphical interface is an incredible pain as each IP must be added manually, each in a new dialog box. Here’s a simple solution.

assign ip address command line windows

Needless to say, this can be incredibly monotonous and time consuming if you are adding more than a few IP addresses. Thankfully, there is a much easier way which allows you to add an entire subnet (or more) in seconds.

Adding an IP Address from the Command Line

Windows includes the “netsh” command which allows you to configure just about any aspect of your network connections. If you view the accepted parameters using “netsh /?” you will be presented with a list of commands each which have their own list of commands (and so on). For the purpose of adding IP addresses, we are interested in this string of parameters:

netsh interface ipv4 add address

Note: For Windows Server 2003/XP and earlier, “ipv4” should be replaced with just “ip” in the netsh command.

If you view the help information, you can see the full list of accepted parameters but for the most part what you will be interested in is something like this:

netsh interface ipv4 add address “Local Area Connection” 192.168.1.2 255.255.255.0

The above command adds the IP Address 192.168.1.2 (with Subnet Mask 255.255.255.0) to the connection titled “Local Area Network”.

Adding Multiple IP Addresses at Once

When we accompany a netsh command with the FOR /L loop, we can quickly add multiple IP addresses. The syntax for the FOR /L loop looks like this:

FOR /L %variable IN (start,step,end) DO command

So we could easily add every IP address from an entire subnet using this command:

FOR /L %A IN (0,1,255) DO netsh interface ipv4 add address “Local Area Connection” 192.168.1.%A 255.255.255.0

This command takes about 20 seconds to run, where adding the same number of IP addresses manually would take significantly longer.

A Quick Demonstration

Here is the initial configuration on our network adapter:

ipconfig /all

Now run netsh from within a FOR /L loop to add IP’s 192.168.1.10-20 to this adapter:

FOR /L %A IN (10,1,20) DO netsh interface ipv4 add address “Local Area Connection” 192.168.1.%A 255.255.255.0

After the above command is run, viewing the IP Configuration of the adapter now shows:

assign ip address command line windows

How to set a static IP address on Windows 11

Here are the steps to set a static IP address on Windows 11 with Command Prompt, PowerShell, Control Panel, and Settings.

Avatar for Mauro Huc

UPDATED 11/2/2022: On Windows 11, a static IP address is a network configuration that never changes, making it the preferred option to share files , a printer on a local network , or configure port forwarding.

Usually, when a computer connects to the network, it receives a dynamic IP address assigned by the local Dynamic Host Configuration Protocol (DHCP) server. The only problem is that this configuration can change at any time, as soon as you restart the computer or after the settings expire, and this can cause services like port forwarding and remote desktop to stop working. A static network configuration always maintains the same settings, making it ideal for hosting services that other users can access through the network.

This guide will teach you the steps to set a static IP (version 4) address on Windows 11 . (See also this video tutorial with the steps to complete this task.)

Assign static IP address on Windows 11 from Command Prompt

Assign static ip address on windows 11 from powershell, assign static ip address on windows 11 from settings, assign static ip address on windows 11 from control panel.

To set a static IP address on Windows 11 with Command Prompt, use these steps:

Open Start on Windows 11.

Search for Command Prompt , right-click the top result, and select the Run as administrator option.

Type the following command to see your current networking configuration and press Enter :

Under the network adapter, note the name of the adapter as well as the following information in these fields:

Windows 11 ipconfig all command

Type the following command to assign a static IP address on Windows 11 and press Enter :

In the above command, replace Ethernet0 with the name of your network adapter. Change 10.1.4.119 255.255.255.0 10.1.4.1 with the device IP address, subnet mask, and default gateway address corresponding to the local area network.

Type the following command to set a DNS server address and press Enter :

In the command, make sure to change Ethernet0 with your adapter’s name and 10.1.4.1 with the DNS server address of the network.

Type the following command to set an alternate DNS server address and press Enter :

In the command, change Ethernet0 with the adapter’s name and 8.8.8.8 with an alternate DNS server address.

Windows 11 netsh command to set static IP address

After you complete the steps, you can use the ping command (for example ping google.com ) to see if the configuration is working correctly.

You can use PowerShell with the “NetTCPIP” module to manage networking settings, including changing the IP address settings to a static configuration.

To set a static IP address with PowerShell, use these steps:

Open Start .

Search for PowerShell , right-click the result, and select the Run as administrator option.

Type the following command to view your current network configuration and press Enter :

Get-NetIPConfiguration

Confirm the following network information: 

Type the following command to set a static IP address and press Enter :

PowerShell assign static IP address

In the command, replace the InterfaceIndex number (10) with the corresponding number of your adapter. Change IPAddress with the static IP address you want to assign to your device. Change PrefixLength (subnet mask) with the correct bit number if necessary. Typically on a home network, the setting is 24 . Also, change the DefaultGateway option with the default gateway address of the network.

Type the following command to assign a DNS server address and press Enter :

PowerShell assign static DNS address

If you need to set a secondary DNS server address, use a comma to use the same command with another address. For example:

In the command, replace the InterfaceIndex number (10) with your network adapter’s corresponding number. Also, change ServerAddresses with the DNS IP address.

Once you complete the steps, the new network configuration will apply to the computer.

Regardless of your chosen method, always assign a TCP/IP address in the network range and outside of the DHCP server scope to allow proper connectivity and avoid configuration conflicts. The reason is that multiple computers sharing the same address will cause problems, preventing them from connecting to the internet.

On Windows 11, you can set a static IP address configuration from the Settings app for wireless and wired adapters.

Set static IP address on Wi-Fi adapter

To assign a static IP address configuration to a Wi-Fi adapter, use these steps:

Open Settings on Windows 11.

Click on Network & Internet .

Click the Wi-Fi tab.

Open Wi-Fi settings

Select the current network connection.

Open wireless properties

Under the “IP settings” section, click the Edit button.

Windows 11 edit IP address

Select the Manual option.

Static IP enable option

Turn on the IPv4 toggle switch.

Set a static IP address for Windows 11 – for example, 10.1.4.119 .

Settings app set static IP address

Specify a Subnet mask  – for example, 255.255.255.0 .

Specify a Default Gateway address.

Specify a Preferred DNS address (required).

(Optional) Specify an “Alternate DNS” address.

Use the “DNS over HTTPS” drop-down menu and select the Off option for the preferred and alternate addresses, but you can enable DoH with these options:

Turn off the “Fallback to plaintext” toggle switch (if you enable DoH).

Click the Save button.

Once you complete the steps, the static network configuration will apply to the computer. You can test the new settings by opening the web browser and loading a website.

Set static IP address on Ethernet adapter

To assign a static IP address to an Ethernet (wired) adapter on Windows 11, use these steps:

Open Settings .

Click the Ethernet  tab.

Open Ethernet settings

After you complete the steps, you can test your settings using your web browser to open a website.

On Windows 11, you can still use Control Panel to change the IP settings for Ethernet or Wi-Fi adapters.

To assign a static IP configuration through Control Panel, use these steps:

Open Control Panel .

Click on Network and Internet .

Click on  Network and Sharing Center .

Click the Change adapter settings option on the left navigation pane.

Open Change adapter settings

Right-click the network adapter and select the Properties option.

Select the “Internet Protocol Version 4 (TCP/IPv4)” option.

Click the Properties button.

Control Panel open TCP/IPv4 properties

Select the “Use the following IP address” option.

Assign the static IP address – for example, 10.1.4.119 .

Set static IPv4 address in Control Panel

Specify a Subnet mask . Typically, on a home network, the subnet mask is 255.255.255.0 .

Specify a Default gateway address – for example, 10.1.4.1 (Usually, your router’s address).

Under the “Use the following DNS server addresses set Preferred DNS server” section, set the “Preferred DNS server address,” which is usually your router’s IP address or server IP address providing DNS resolutions (for example, 10.1.4.1 ).

(Optional) Specify an “Alternative DNS server,” which the computer will use if it cannot reach the preferred DNS server.

Click the OK button.

Click the Close button again.

Once you complete the steps, you can open the web browser and load a website to see if the configuration works.

If you want to revert the changes, you can use these instructions to remove the static settings to configure a dynamic IP address on Windows 11.

We hate spam as much as you! Unsubscribe any time Powered by follow.it ( Privacy ), our Privacy .

Tec related articles

How to set static IP Address in Windows 11 ( Three easy ways )

When you connect to a network, your device automatically gets an IP address from the DHCP server. However, you are also able to assign an IP address to your PC manually. So stay with me till the end of the session; I will show you how to set a static IP address in Windows 11.

IP, or in a full form Internet Protocol address, is a unique identification number separated by dots or periods and is used to let the devices communicate with each other on the network.

The dynamic IP address often changes from time to time. On the other hand, the static IP address does not change until you change it manually. If you have a remote connection or set your computer as a server, the static IP address works much better than the dynamic one.

In the following article, I will assign a static IPV4 address to my PC running Windows 11 using the Settings app, Control Panel, and Command Prompt.

Related : How to find MAC Address in Windows 11

First method: Set the static IP address on Windows 11 from the settings

The first easy way to configure your PC’s IP address is via the setting app. But first of all, you need to find out the current configuration of your networks, like the default gateway address and name of the adapter, because you will need those details later.

Open Command Prompt and write IpConfig and enter.

Write the command to see current network configuration

Now that you have taken note of your current network configuration follow the steps below to change your computer’s IP address.

Set static IP address in Windows 11 from the Settings app

Click on Edit button to assign static IP address in Windows 11

Set static IP address in Windows 11 using Setting app

Set static IP address for your computer

Note : The Default Gateway must be the same address you received from your ISP. The DNS address can be the address of any DNS server. People mostly use the DNS server of google, which is 8.8.8.8. Additionally, make sure to set an IP address out of DHCP scope.

Second Method: Assign a static IP address from the Control Panel

The Control Panel is the second method to set a static IP address on your PC.

Set static IP address in Windows 11 from the Control Panel

Click on the Name of your active network

Click on the network properties

Select IPv4 and click on the properties

Assign an IP Address manually in Windows 11 from Control Panel

That is it! Using the Control Panel, you successfully assigned a static IP address to your computer.

Third method: How to set static IP address with Command Prompt

Another easy and quick way to configure your PC’s IP address is from the Command Prompt.

Netsh Interface IP set address name =" Network Name" static NewIPAddress Subnet Mask Default gateway

Set static IP address from Command Prompt

Remember! Write the name of your network instead of the ‘Network Name.’ Your IP address must not be in the scope of the DHCP server. The default gateway address must also be the same as the ISP address.

Netsh interface IP set DNS name =" Network Name" static DNS Address

Set static DNS address form Command Prompt

To conclude, the above paragraphs discussed the IP configuration in Windows 11 and 10. I hope you enjoyed it and can share your thoughts and questions in the comment section.

Related: How to backup and restore full system in Windows 11?

Related Posts

What is new in Windows 11?

The 8 best new Windows 11 features you should use

How to show wifi password in windows 11 (easy ways).

Itechtics

How to set static IP address and DNS Server using Command Line in Windows 10

Repeatedly having to change your Static IP address when shifting from one network to another can be a pain in the neck. The process is lengthy on Windows 10 and…

assign ip address command line windows

Repeatedly having to change your Static IP address when shifting from one network to another can be a pain in the neck. The process is lengthy on Windows 10 and a bit irritating. If you are the person who needs to switch between IP addresses, then this article is for you.

Here we shall show you how you can configure your system’s IP address directly through the command line interface on your Windows 10 platform. It is very less time consuming and can be done in a few steps.

Table of contents

How to check Interface Index using PowerShell

How to set static ip address using command prompt, how to set dns address using command prompt, how to set static ip address using powershell, how to set dns address using powershell, closing words.

The IP address is a unique identifier of your machine that lets every other component on the network know where the packets need to be routed to. Since it is unique, it cannot conflict with another IP address on the same network.

Configure Static IP address and DNS Server using PowerShell in Windows 10

You can manage your IP address by both the Command Prompt and the PowerShell, which shall be discussed further in the article.

If you are looking for a way to instantly switch between different network profiles, you can make use of NetSetMan 5 .

The Interface Index is a unique number assigned to either a physical or virtual networking port. Each port is assigned a number that is used to address the respective port on the machine. For example, if there are 5 different networking adapters on a computer, each one would have its own Interface Index.

To check the associated Interface Index for each, run the following command in PowerShell with administrative privileges :

get index

In the example above, the “ifIndex” is identified as the Interface Index. Note that the ports are repeated as the first half represents IPv6, while the 2nd half represents IPv4 configuration. Nonetheless, the Interface Indexes of the same ports are the same.

Note down the associated Interface Indexes as they will be required when assigning static IPs through PowerShell.

These commands are relatively easier with the Command Prompt when compared with PowerShell . You can change the IP address of your computer using this quick command.

Launch the Command Prompt with administrative privileges and then use the command below to assign the desired IP address configuration:

In the above command, you need to place the information according to your requirement. Replace NameOfPort with the alias name of the network adapter you wish to set the IP of. Also, replace [IP address] with the IP address of the port you wish to assign, replace [Subnet mask] with its subnet, and replace [Default gateway] with the gateway of the adapter.

Here is an example:

Since the name of my port is “Ethernet,” entering the command above would result in the following configuration:

ip set

As you may have noticed above, we did not set up the DNS. This is because you need to enter a separate command to configure the DNS, which is as below:

This will set the first DNS entry as 8.8.8.8. Note that this will only occur if the port can communicate with the DNS. Else it will throw an exception.

The above command would result in something like this:

dns 1 set

To change the second DNS server, use the following command:

dns 2 set

Remember to change the port name, IP address, gateway, and subnet mask according to your requirement.

Each time you need to switch between your IPs and DNSs, use these commands, and it will automatically overwrite the previous entering.

Although the PowerShell command lines are more complex than those of the Command Prompt, they also offer more parameters to be addressed. However, we will try and keep it as plain and simple as possible.

Before we proceed further, you need to understand some terms to enter the correct parameters. Below are a few arguments and their descriptions used in PowerShell to set static IPs and DNS entries.

Now, modify the following command according to your needs, launch Windows PowerShell with administrative privileges and enter the command:

PS 1

Note that we determined the correct Interface Index using the command we had discussed earlier in the article. This is what the IP configuration of the port would look like after running the command above:

PS ip set

You can also use PowerShell to assign DNS addresses as well quickly. In the example below, we have assigned both the primary and the secondary DNS addresses to our port simultaneously.

PS set dns

You may repeatedly use these commands in PowerShell to overwrite new IP address, subnet mask, gateway and DNS entries of any network port you want on your PC.

Now you do not need to worry about switching from one network to another. You can make the process even quicker by saving the respective IP configuration on your PC and copy-pasting it to the command line when required to switch.

If, however, you run into a problem associated with your computer network, you may use this guide to reset the TCP/IP stack .

Related posts:

Filed under:

This article covers:

assign ip address command line windows

Subhan Zafar

Subhan Zafar is an established IT professional with interests in Windows and Server infrastructure testing and research, and is currently working with Itechtics as a research consultant. He has studied Electrical Engineering and is also certified by Huawei (HCNA & HCNP Routing and Switching).

assign ip address command line windows

Pradip Shah

I have been using netsh for more than 10 years now to switch between 2 ISP’s services. My only problem was the jokers at MS kept changing command line switches with every version of Windows. XP -> 7 -> 10. Why is something beyond me.

Forgot to mention that I religiously avoid using power shell & work only with “Take Command” from JPSoft.

How to Configure IP Address with Command Prompt in Windows 10?

How to Configure IP Address with Command Prompt in Windows 10?

Configuring IP address in a Windows with CMD performed using netsh command line utility. The network shell ( netsh ) is a set of commands that help you configure any Windows operating system IP address, Network Interfaces, and Windows Firewall. The usage of the command line is for pro level Windows users. Those who are playing the network infrastructure configuration. But using the command line as normal Windows user indicate your expertise to Windows environment. If you are new to Windows command line, this article “configure IP address with command prompt in Windows 10” will help you begin using command line interface.

Configuring Windows IPv4 Networking with Netsh or Network Shell. Netsh is a command-line utility included in Microsoft’s Windows NT line of operating systems beginning with Windows 2000. It allows local or remote configuration of network devices such as the NICs.

Configure IP Address with Command Prompt in Windows 10

Before setting IP address with cmd in Windows 10, you need to know how to find your IP address on Windows 10. So before everything, you must know the network IP address configuration on your system.

Let’s learn the process of IP configuration step by step. I am going to explain it with an easy pictorial guide. If you don’t understand some part, just kindly comment us and ask your questions.

The process of Changing Windows 10 IP Address with Command Prompt: 

How to Find your IP Address on Windows 10?

There are many options for finding IP address on Windows 10. The easy one is “ ipconfig ” command. To find your IP address on Windows 10, just type “ ipconfig ” in command prompt. To do this process:

The “ ipconfig ” command shows everything about your computer network interfaces. You might have many physical or virtual network interface card.

Here, I just have one network interface on my Windows 10 computer. The result of ipconfig command shows that the IP 169.254.29.130 with the mask of 255.255.255.0 is my current Windows IP address.

This is a class C “autoconfiguration IPv4”. When your system doesn’t find any DHCP Server or manual IP address, it obtains auto IP address. So let’s change it.

How to C hange  IP Address with  Command Prompt?

For change IP address, open command prompt or PowerShell. Both works the same and you can run all command prompt commends on Powershell as well. Ok, run cmd or Powershell as administrator. Netsh work in both command prompt and Powershell. I’m using Windows Powershell to change IP address on Windows 10 completely. Becuase the user interface and color’s of Powershell is better than Command prompt.

To find the network interface with the command line, type the following command on Powershell.

The result shows two network interfaces. The Loopback and the Ethernet. The Loopback is Windows builtin network loopback interface, but our pointed network interface is the ethernet.

To find your IP address in Windows 10 with netsh command, just type the following command.

It displays all the network interface configuration. The output result is clear and better than output result of “ ipconfig ” command on Command prompt. So to find an exact information of the network interface, just add the index ID of the network interface at the end of the command.

That’s good. Let’s configure and change Windows 10 IP address with the command line. The command is bit long but easy to understand. No need to remember, just try to understand the netsh command structure.

To change the IP address of the “Ethernet0” network interface, type the following command.

Once the command executed successfully, check the result with “ netsh interface ipv4 show config 2 ” command. Yes, the output result shows the exact IP address has set on the “ Ethernet0 ” network interface. Now the Windows IP address is 200.100.10.5 with the mask of 255.255.255.0 and default gateway is 200.100.10.1.

Note : You can’t change the default gateway separately with the following command. It will remove the IP address and just set the default gateway address.

That’s good and enough for IP address configuration in Windows 10 with the command line. Let’s change DNS IP address from the command line.

How to Change DNS IP address from Command Prompt?

DNS IP address is the unique address in the network that resolves computer name to IP address and IP address to the computer name. In the network, finding a computer with a name is easy than 32-bit IPv4 address. To set or change the DNS IP address, just simply do it with the following command.

You might see some error on a simple local network, because of not having a DNS server. When you don’t have a DNS server, it’s not necessary to set DNS IP address on your computer.

Finally, recheck the result with “ netsh interface ipv4 show config 2 ” command. The output netsh command should be displayed with DNS IP address.

Final World

Configure IP address with command prompt in Windows has tow benefits. The first benefit of working with Windows command line helps get you improve your skills in Windows environment. The second benefit is command line is faster than GUI. If you work with the command line, you will understand the power of command line.

The Windows command line interface has improved a lot in Windows 10. Now you can find some Linux commands that run in Windows 10 and works the same on Linux. Finally, hope you learn how to configure IP address with Command Prompt in Windows operating systems. If you don’t understand, please ask us about how to configure IP address with command prompt in Windows 10?

LaptrinhX icon

Online Tech Tips logo

How to Assign a Static IP Address to a Windows 11/10 PC

Makes establishing a remote connection easier

Author avatar

Usually, your network router assigns a dynamic IP address to your devices, including your Windows 10 and 11 PCs. If you need a static IP address for your PC, you either need to configure your router or change a settings option on your computer.

The good thing is there are multiple ways to assign a static IP address to your Windows PC. Depending on what you feel comfortable with, you can choose a method and proceed with it to acquire a fixed IP address for your machine.

assign ip address command line windows

Why Use a Static IP Address?

There are many reasons you need a static IP address. It’s possible you use a remote connection to connect to your PC. In this case, having a permanent IP address makes establishing the remote connection easier.

Similarly, if you use your PC for network file sharing , a static IP address ensures the other devices on your network can connect to your PC without any reconfigurations.

Assign a Static IP to Your Windows 11/10 PC Using Your Router

One way to get a static IP for your PC is by configuring your router to allocate a specified IP address to your machine. Most routers offer this option but how you configure the router is different for each router model.

Generally, you’d follow the following steps to configure a static IP for your PC on your network router.

Find Your Network Adapter’s MAC Address

For your router to identify your PC and assign it a specific IP address, you need to enter your network adapter’s (which is in your PC) unique MAC address on your router’s settings page.

So, let’s first find your network adapter’s MAC address:

assign ip address command line windows

ipconfig /all

assign ip address command line windows

assign ip address command line windows

Configure Your Router to Assign a Static IP to Your PC

You now need to access your router’s settings page. For most routers, you can do this by entering the 192.168.1.1 IP address in a web browser on your computer. If this doesn’t work for you, consult your router’s manual to find out how to access the settings page.

192.168.1.1

assign ip address command line windows

assign ip address command line windows

When your Windows 11 or 10 PC connects to your router, your router will assign the specified IP address to your PC. This will happen each time you connect your PC to your router.

Assign a Static IP to Your Windows 10 PC

If you don’t wish to configure your router’s settings, the other way to assign a static IP address to your Windows 10 PC is by using the Windows Settings app. You can configure your IP settings in this app to ensure your PC always gets a unique static IP.

However, there’s a slight issue with this method. If your router has already assigned the IP address that you want for your PC to another device, you’ll experience issues connecting your PC to your router .

To get around this, try to use an IP address far beyond the general IP addresses that your router assigns. For example, if your router usually gives IP addresses up to, say, 192.168.1.10, then use 192.168.1.20 as the static IP for your PC.

To proceed with this method:

assign ip address command line windows

assign ip address command line windows

assign ip address command line windows

assign ip address command line windows

assign ip address command line windows

Your Windows 10 PC will disconnect from your router, and it will then automatically reconnect. After this reconnection, your PC should now have the specified static IP address allocated to it.

Assign a Static IP to Your Windows 11 PC

Like with Windows 10, you can use the Windows Settings app to assign a static IP address to your Windows 11 PC.

assign ip address command line windows

assign ip address command line windows

assign ip address command line windows

assign ip address command line windows

assign ip address command line windows

assign ip address command line windows

And your Windows 11 PC now has a static IP address assigned to it. In the future, your PC will continue to acquire this static IP address from your router, provided there are no IP conflict issues with your router .

assign ip address command line windows

Mahesh has been obsessed with technology since he got his first gadget a decade or so ago. Over the last few years, he's written a number of tech articles on various online publications including but not limited to MakeTechEasier and Android AppStorm. Read Mahesh's Full Bio

Read More Posts:

assign ip address command line windows

Subscribe to Online Tech Tips

Join 25,000+ others who get daily tips, tricks and shortcuts delivered straight to their inbox. 

Thanks for subscribing!

We will never spam you, unsubscribe at any time.

IMAGES

  1. Assign multiple IP addresses to single Network card in Linux

    assign ip address command line windows

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

    assign ip address command line windows

  3. How to Assign a Static IP Address in Windows 7

    assign ip address command line windows

  4. Troubleshooting WiFi Connectivity in Windows 10

    assign ip address command line windows

  5. How to Assign Static IP Address From Command Prompt

    assign ip address command line windows

  6. Windows 10: Finding the IP Address

    assign ip address command line windows

VIDEO

  1. How to Change Your Computer’s IP Address From the Command Prompt

  2. How to Release IP Address

  3. how to check your ip configuration

  4. Hardware and Networking training in hyderabad

  5. how to find ip address on windows 10 using command prompt , Control Panel, and Windows Settings

  6. Tutorial: How To Find Your IP -CMD-

COMMENTS

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

    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

  2. How to Configure IP Address with Command Prompt in Windows 10?

    To find your IP address on Windows 10, just type " ipconfig " in command prompt. To do this process: Press Windows+R keys to open the Run. Type " cmd " in the run and press enter. Now type " ipconfig " to show the IP address. The " ipconfig " command shows everything about your computer network interfaces.

  3. How to Assign a Static IP Address in Windows 10 or 11

    To set a static IP address in Windows 10 or 11, open Settings -> Network & Internet and click Properties for your active network. Choose the "Edit" button next to IP assignment and change the type to Manual. Flip the IPv4 switch to "On", fill out your static IP details, and click Save.

  4. How To Set Static IP Address in Windows 10 using CMD

    Step 1: There are two ways to open the command line. Click on the Start menu, type CMD in the search box, then right-click on it and select Run as administrator. Or press WIN + R, type CMD, and press Enter.

  5. Assign an IP address from the command-line interface

    Assign an IP address from the command-line interface Use the set network command to configure an IP address from the command line. The set network command includes the following parameters: ip=device ip: The IP address for the device. gateway=gateway: The network gateway IP address.

  6. How to set a Static IP Address in Windows 11/10

    4] Assign a Static IP Address using Command Prompt To set a static IP address in Windows 10 using a command prompt, follow the below suggestions: Right-click on the Start button and select Run to ...

  7. Configure IP Address and DNS from Command Line

    There are two commands for DNS since administrators typically configure a primary and secondary DNS server. For the primary DNS server run: netsh interface ip set dns name="Local Area Connection" static 208.67.222.222 For the secondary DNS server run: netsh interface ip add dns name="Local Area Connection" 208.67.220.220 index=2

  8. How to change IP Address from Command Prompt

    1. Right click on start and select the command prompt (admin). 2. On User Account Control window click on "Yes" to open command prompt. 3. Type command " ipconfig " to check an IP address of your computer. This shows an APIPA IP address.

  9. How to Find Your IP Address From CMD (Command Prompt)

    To find your local IP address from the CMD Command prompt, simply type "ipconfig" into the prompt. It will be listed as "IPv4 Address". To find your public (external) IP address from a command prompt, type "curl ifconfig.me" on Windows 10 or 11.

  10. How to set static IP address on Windows 10

    To assign a static IP from Control Panel on Windows 10, use these steps: Open Control Panel. Click on Network and Internet. Click on Network and Sharing Center. Click the Change adapter settings option on the left navigation pane. Right-click the network adapter and select the Properties option.

  11. How to Assign Static IP Address to Your Devices

    From the Configure IPv4 menu, choose Using DHCP with manual address. Enter a static IP address in the IPv4 Address and leave the Subnet Mask and Router field as default. Click Ok to save the changes. Now when you do an ifconfig, the system should be using the static IP you have defined in the previous times.

  12. How to configure a static IP on Windows 10 or 11

    Type the following command to set a DNS server address and press Enter : netsh interface ip set dns name="ADAPTER-NAME" static DNS-ADDRESS In the command, change ADAPTER-NAME with your...

  13. Change IP Address in Windows via Command Prompt

    Solution. In Windows, you can use the netsh command to edit network interfaces. To see a list of network interfaces on your system (including copies or disabled adapters), type in the following: netsh interface show interface. To see a list of NICs with their configured network settings, type in the command below: netsh interface ip show config.

  14. How to Quickly Add Multiple IP Addresses to Windows Servers

    Adding an IP Address from the Command Line Windows includes the "netsh" command which allows you to configure just about any aspect of your network connections. If you view the accepted parameters using "netsh /?" you will be presented with a list of commands each which have their own list of commands (and so on).

  15. How To Assign IP Address Using CMD in WIndows 10

    In this Video I Will show you guys how to change or assign ip address using cmd in windows 10 computer.commands : netsh interface ipv4 show confignetsh inter...

  16. How to set a static IP address on Windows 11

    To assign a static IP configuration through Control Panel, use these steps: Open Control Panel. Click on Network and Internet. Click on Network and Sharing Center. Click the Change adapter settings option on the left navigation pane. Right-click the network adapter and select the Properties option.

  17. How to set static IP address in Windows 11 (Three easy ways)

    Click on Properties. Select the Internet Protocol Version (TCP/IP4) and click on the properties. Select IPv4 and click on Properties. Select the radio button 'Use the following IP address and enter the desired IP address, subnet mask, and gateway. Additionally, set static DNS address as well.

  18. How to set static IP address and DNS Server using Command Line in

    Launch the Command Prompt with administrative privileges and then use the command below to assign the desired IP address configuration: netsh interface ipv4 set address name="NameOfPort" static [IP address] [Subnet mask] [Default gateway] In the above command, you need to place the information according to your requirement.

  19. How to Configure IP Address with Command Prompt in Windows 10?

    Configuring IP address in a Windows with CMD performed using netsh command line utility. The network shell (netsh) is a set of commands that help you configure any Windows...

  20. How to Assign a Static IP Address to a Windows 11/10 PC

    Choose Manual from the Edit IP settings dropdown menu. Then, toggle on the IPv4 option. Select the IP address field and type the static IP address to assign to your PC. Select the Subnet mask field and enter 255.255.255.. Enter your router's IP address, which is usually 192.168.1.1, in the Default gateway field.