A dynamic IP address is the recommended configuration for most Windows PC users. However, a static IP address is required when a computer provides a service for other PCs. This tutorial walks you through how to quickly set a static IP address on your computer.
Good to know: check out how to find the IP address of a network printer.
Why Do You Need a Static IP Address
A static IP address could be useful in various cases, including:
- Hosting: if you’re hosting a website, having a dynamic IP address can be a hassle. It’s best to have a static IP address to avoid the need to manually change the router settings every time the computer gets a new IP address.
- File server: is your computer configured as an FTP or a web server? It is highly recommended to use a static IP address, as your device can be easily accessed by others to download files.
- Remote access: if you plan on accessing your Windows PC remotely, having a static IP address can provide faster and more reliable access. In contrast, dynamic IP addresses are constantly changing and can create difficulties connecting with remote devices.
1. Set Static IP Address Using Settings
You don’t need to be a pro user to set a static IP address, as you can do that easily with the Settings app on your Windows computer.
- Click the Start menu, and launch the Settings app.
- Click “Network & Internet” in the left pane. Click “Properties” next to your Wi-Fi network on the right.
- Scroll down and click the “Edit” button next to “IP assignment.”
- Click the drop-down box in the “Edit network IP settings” dialog, and select “Manual.”
- Select the IPv4 or IPv6 format to set the static IP address. In this example, we are selecting IPv4.
- Fill in all the required details, such as IP address, Subnet mask, and Gateway, and click “Save.”
- When entering the IP address, make sure it is a private IP address that can be used on home and other private networks. According to the Internet Assigned Numbers Authority (IANA), the addresses reserved for private networks are as follows:
- Class A: 10.0.0.0 to 10.255.255.255
- Class B: 172.16.0.0 to 172.31.255.255
- Class C: 192.168.0.0 to 192.168.255.255
- For any private network that needs to use IP addresses internally, it is permissible to use any address within the specified ranges. These addresses are unique only within the given private network.
- Typically, networks with a significant number of total hosts utilize Class A addresses, while medium- to large-sized networks opt for Class B, and small local area networks use Class C.
- To fill the Subnet Mask and Gateway fields, make sure you are using the same values that are currently assigned to your router. To find those values, launch the Command Prompt, type the following command, and press Enter. Also, note the “DNS Servers” address, as you’ll need it later.
Tip: learn how to manage and control wireless networks via the Command Prompt.
2. Using Command Prompt
You can also configure the static IP address from the Command Prompt if you prefer the command line.
- Right-click on the Start menu, and click “Run” from the list of options.
cmd.exein the box, then press Ctrl + Shift + Enter to launch the Command terminal in admin mode.
- To set a static IP address, use the following command and press Enter. Make sure you replace “X” with the name of your network adapter, as well as [IP address], [Subnet Mask], and [Default Gateway], each with your specific address. The values correspond to Subnet Mask and Default Gateway that you identified using
ipconfigin the previous section.
netsh interface ip set address name= "X" static [IP address] [Subnet Mask] [Default Gateway]
Note: to find the name of the network adapter, navigate to “Control Panel -> Network and Internet -> Network and Sharing Center,” and jot down the name next to “Connections.”
- To set the DNS server address, use the following command and press Enter. Replace “X” with the name of your network adapter and [DNS server address] with the DNS server address of the network you found earlier using
netsh interface ip set dns name= "X" static [DNS server address]
- You will not see a success message but can run the
ipconfigcommand again to check the new configuration.
Tip: need the IP address of your router? Learn how to find it.
3. Using PowerShell
Alternatively, use the PowerShell tool to set a static IP address for your Windows PC.
- Press Win + X on your keyboard, and click Terminal (Admin) in the menu to launch PowerShell.
- To view the details of your current network configuration, type the following command and press Enter. From the results displayed, jot down the values for the following fields: InterfaceIndex, IPv4Address, IPv4DefaultGateway, and DNSServer.
- Type the following command to set a static IP address and press Enter. Before executing the command, don’t forget to add the values for InterfaceIndex, IPAddress, and DefaultGateway. As for the PrefixLength, in most cases, it should be set to “24.” The parameter defines the local subnet size or subnet mask. For example, for a subnet mask such as “255.255.255.0,” the prefix length is 24 bits, while a subnet mask of “255.255.0.0” has a prefix length of 16 bits.
New-NetIPAddress -InterfaceIndex [value] -IPAddress [address] -PrefixLength 24 -DefaultGateway [address]
- To set the DNS server address, use the following command and press Enter. Make sure to add the values for InterfaceIndex and ServerAddresses (DNSServer).
Set-DnsClientServerAddress -InterfaceIndex [value] -ServerAddresses [address]
Tip: unable to launch PowerShell? Try these fixes.
Static IP Is Sometimes Handy
Businesses have more use for static addresses than home networks. It’s completely safe to use a static IP address, as errors like “Your IP has been temporarily blocked” happen mostly with dynamic IP addresses. Plus, it is not complicated to set a static IP address if you follow the instructions outlined in this tutorial. Check out our post to troubleshoot Wi-Fi-related issues if you experience any problems with your Internet connection.
Image credit: Unsplash. All screenshots by Meenatchi Nagasubramanian.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox