Tutorials › Networking
Set a static IP address on Windows Server
Normal PCs can take any address DHCP hands them. A server can't: everything else on the network is pointed at it. This is the first job on any new server.
Before you start
Note the current settings so you keep the same network. Open Terminal and run ipconfig /all. Write down the IPv4 address, subnet mask, default gateway and DNS servers.
Careful: changing an IP while you're connected remotely can cut you off instantly. Do it from the console (or iLO, iDRAC, the hypervisor console) in an agreed window.
Steps
- Press Windows + R, type
ncpa.cpland press Enter. The Network Connections window opens. - Right-click your adapter (for example Ethernet0) and choose Properties.
- Click the words Internet Protocol Version 4 (TCP/IPv4), without unticking the box, then Properties.
- Choose Use the following IP address and enter an address outside the DHCP range, the subnet mask and the gateway.
- Choose Use the following DNS server addresses. On a domain controller this is the server itself; anywhere else, your DC.
- Click OK, then Close.
The PowerShell way
New-NetIPAddress -InterfaceAlias "Ethernet0" -IPAddress 192.168.87.10 `
-PrefixLength 24 -DefaultGateway 192.168.87.2
Set-DnsClientServerAddress -InterfaceAlias "Ethernet0" -ServerAddresses 192.168.87.10
Check it worked
ipconfig /all # DHCP Enabled: No, and no lease lines
ping 8.8.8.8 # replies mean the gateway is right
nslookup bbc.co.uk # an answer means DNS is right
If ping works but nslookup doesn't, the DNS server field is wrong. If neither works, check the gateway and address.
← All tutorials