Networking · How-To

How to Set a Static IP Address in Windows 11

By , Editor · · Networking
The short answer

Open Settings > Network & internet, click your connection, open its properties, and next to IP assignment choose Edit > Manual. Turn on IPv4, then type in the fixed address you want, the subnet mask, the default gateway (your router) and your DNS servers, and click Save. The PC now keeps that same address every time it connects.

A static address is worth setting when a machine needs to be found reliably — a PC that shares folders over the network, a print server, a home server, or anything you reach by typing its address. This guide covers three ways to set it (Settings, Control Panel and PowerShell), how to choose sensible values, why a router-side DHCP reservation is often the cleaner option, and how to switch everything back to automatic.

What you need

A Windows 11 PC and an administrator account. Have four values ready before you start: the IP address you want, the subnet mask, the default gateway, and at least one DNS server. The next section explains how to pick each one.

1Choose your four valuesIP · subnet · gateway · DNSSettings appeasiestControl Panelncpa.cplPowerShellscriptableSame static address appliedverify with ipconfig /allFixed IP ready
Three routes to the same result — pick whichever fits how you work.

Static vs dynamic (DHCP) — which do you need?

By default, Windows gets its address automatically from your router using DHCP (Dynamic Host Configuration Protocol). The router keeps a pool of addresses and lends one to each device for a while. This is invisible and reliable, and it is the right setting for almost everything — phones, laptops, tablets — because those devices do not need a fixed address.

A static address is one you fix in place so the device is always reachable at the same number. Reach for it when:

  • The PC hosts something others connect to — a shared folder, a media server, a game server, or a network printer attached to it.
  • You use port forwarding on the router, which points at a specific address.
  • You want to reach the machine by address for remote desktop or diagnostics without it moving.

There are two ways to get a fixed address: set it manually inside Windows (this guide), or leave Windows on automatic and create a DHCP reservation on the router. The reservation route is often tidier — see the section near the end.

Choosing your IP, subnet, gateway and DNS

Before you type anything, find your current settings so your static values fit the network you are on. Open Terminal or Command Prompt and run:

ipconfig /all

Look at the active adapter and note four things:

  • IPv4 Address — the address the PC currently holds, for example 192.168.1.42. Your static address should be on the same network (the first three numbers match on a typical home setup) but outside the router's automatic pool so nothing else grabs it.
  • Subnet Mask — usually 255.255.255.0 at home, which is a prefix length of 24. Keep whatever the network already uses.
  • Default Gateway — your router, often something like 192.168.1.1. This is how the PC reaches the internet.
  • DNS Servers — the resolvers that turn names into addresses. You can point at your router, your internet provider's servers, or a public resolver. Setting a static IP without a DNS server leaves name lookups broken, so always supply at least one.
Avoid address clashes

Pick a static address the router will not also hand out automatically. Either choose one below the pool (for example a low number the router skips) or shrink the DHCP pool in the router settings. If two devices claim the same address, both drop off the network intermittently.

Method 1 — set a static IP in Settings

This is the simplest route and the one Microsoft points to first in its Change TCP/IP settings article, right down to the IP assignment > Edit > Manual sequence and the Preferred and Alternate DNS fields.

  1. Open Settings (Windows+I) and go to Network & internet.
  2. Click your connection type — Wi-Fi or Ethernet. For Wi-Fi, click the network name to open its properties; for Ethernet, click the adapter.
  3. Find IP assignment and click Edit.
  4. In the drop-down, switch Automatic (DHCP) to Manual.
  5. Turn on the IPv4 toggle. Fill in:
    • IP address — the fixed address you chose.
    • Subnet mask — for example 255.255.255.0.
    • Gateway — your router's address.
    • Preferred DNS (and optionally Alternate DNS).
  6. Click Save.

Confirm it took effect by running ipconfig /all again — the address should match, and the line reading DHCP Enabled should now say No.

Method 2 — set a static IP in Control Panel (ncpa.cpl)

The classic network adapter dialog is still present and is handy if you prefer it or are helping someone over the phone.

If that window opens with no adapters in it at all, stop here and fix that first — see what to do when the Network Connections folder is empty.

  1. Press Windows+R, type ncpa.cpl and press Enter. The Network Connections window opens.
  2. Right-click your adapter and choose Properties. (Approve the administrator prompt if it appears.)
  3. In the list, select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  4. Choose Use the following IP address and enter the IP address, subnet mask and default gateway.
  5. Choose Use the following DNS server addresses and enter your preferred and alternate DNS servers.
  6. Click OK, then Close.
Tip — tick "Validate settings upon exit"

The IPv4 properties dialog has a checkbox to validate settings when you close it. Leaving it on lets Windows sanity-check the values and run the Network troubleshooter automatically if something is off.

Method 3 — set a static IP in PowerShell

PowerShell is the fastest route when you are scripting a build or setting up several machines. Open Terminal (Admin) or PowerShell as administrator.

First find the interface name so you target the right adapter:

Get-NetAdapter

Note the value under Name (for example Ethernet or Wi-Fi). Then assign the address, prefix length and gateway with New-NetIPAddress:

New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 192.168.1.50 -PrefixLength 24 -DefaultGateway 192.168.1.1

The -PrefixLength 24 is the same as a 255.255.255.0 subnet mask — the New-NetIPAddress reference on Microsoft Learn spells out that equivalence, and notes that adding an address this way automatically disables DHCP on the interface. Next set the DNS servers with Set-DnsClientServerAddress — list a preferred and an alternate, comma separated:

Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses ("192.168.1.1","1.1.1.1")

Check the result with:

Get-NetIPConfiguration -InterfaceAlias "Ethernet"
If the adapter already has an address

Running New-NetIPAddress on an interface that already holds a manual address of the same family can fail. Remove the old one first with Remove-NetIPAddress -InterfaceAlias "Ethernet", then re-run the command. Take care doing this over a remote session — changing the address can drop your connection.

Alternative — a DHCP reservation on the router

Instead of fixing the address inside Windows, you can leave the PC on Automatic (DHCP) and tell the router to always give that machine the same address. This is called a DHCP reservation (some routers call it "address reservation" or "static DHCP").

  • Find the PC's physical (MAC) address with ipconfig /all — it is the Physical Address line for the adapter.
  • In the router's admin pages, find the DHCP or LAN settings and add a reservation that pairs that MAC address with the address you want.

The advantage is that all the addressing lives in one place — the router — so there is no risk of two devices clashing, and the setting survives a Windows reset or reinstall. If you run a Windows Server DHCP role rather than a home router, you can do the same thing there; see our guide to setting up DHCP on Windows Server for reservations and scopes.

Reverting to automatic (DHCP)

To hand addressing back to the router:

In Settings: open the adapter, click Edit next to IP assignment, choose Automatic (DHCP) and save. Do the same for DNS if you set it manually.

In Control Panel: reopen the IPv4 properties and select Obtain an IP address automatically and Obtain DNS server address automatically.

In PowerShell: switch the interface back to DHCP and clear the manual DNS entries — Microsoft documents -ResetServerAddresses as resetting the client to the DNS servers supplied by DHCP:

Set-NetIPInterface -InterfaceAlias "Ethernet" -Dhcp Enabled
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ResetServerAddresses

Then renew the lease so the PC asks the router for a fresh address:

ipconfig /renew
Related networking guides

With a fixed address in place, you may want to map a network drive to it, or work through DNS server not responding if name lookups break after the change. Browse all our networking how-to guides for more.

Frequently asked

What is the difference between a static IP and a DHCP address?

A DHCP address is handed out automatically by your router and can change over time, which is fine for most devices. A static IP is one you set by hand so the device always answers on the same address. Static addresses are useful for a PC that hosts a shared folder, a printer, a home server, or anything you connect to by address rather than by name.

What values do I put in for subnet mask, gateway and DNS?

On a typical home network the subnet mask is 255.255.255.0 (a prefix length of 24), and the default gateway is your router's address, often ending in .1. For DNS you can use your router's address, your internet provider's servers, or a public resolver. Pick a static IP that is inside your router's range but outside the pool it hands out automatically, so two devices never claim the same address.

Should I use a static IP or a DHCP reservation?

A DHCP reservation is usually the better choice. You leave the PC set to automatic and tell the router to always give that device the same address, tied to its network hardware (MAC) address. The setting lives on the router, so it survives a Windows reset and there is no risk of an address clash. Set the address manually in Windows only when you cannot configure the router.

How do I change my static IP back to automatic?

In Settings, open your adapter, edit the IP assignment and switch it back to Automatic (DHCP), doing the same for DNS. In PowerShell, run Set-NetIPInterface with -Dhcp Enabled for the interface and Set-DnsClientServerAddress with -ResetServerAddresses. The PC then asks the router for an address again.

More Windows help

Browse all networking guides for more current, step-by-step Windows 11 walk-throughs, or explore the windows-now.com archive of restored community posts from the original site.