Configure Static IP Using Windows Registry
Configuring a static IP address through the Windows Registry Editor
(regedit) allows administrators to define network settings
directly at the system level without using the graphical interface. This
process involves locating the unique globally unique identifier (GUID)
of the target network adapter under the TCP/IP service key and manually
editing the relevant string and DWORD values for the IP address, subnet
mask, default gateway, and DNS servers.
Step 1: Locate the Network Adapter GUID
- Press
Win + R, typeregedit, and press Enter to open the Registry Editor. - Navigate to the following path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces - Under the
Interfaceskey, you will see several subkeys with long alphanumeric strings (GUIDs). Click through each GUID key and check the values on the right panel. Find the one that corresponds to your active connection by looking at existing entries such asIPAddress,DhcpIPAddress, orDefaultGateway.
Step 2: Disable DHCP
To configure a static IP, you must disable DHCP on the adapter:
- In the target GUID folder, double-click the
EnableDHCPvalue. - Change the Value data from
1to0. - Click OK.
Step 3: Set the Static IP Address and Subnet Mask
- Double-click the
IPAddresskey (typeREG_MULTI_SZ). If it does not exist, right-click, select New > Multi-String Value, and name itIPAddress. - Enter your desired static IP address (for example,
192.168.1.100) on the first line and click OK. - Double-click the
SubnetMaskkey (typeREG_MULTI_SZ). - Enter the appropriate subnet mask (for example,
255.255.255.0) and click OK.
Step 4: Configure the Default Gateway
- Double-click the
DefaultGatewaykey (typeREG_MULTI_SZ). If it does not exist, create it as a Multi-String Value. - Enter the gateway IP address (for example,
192.168.1.1) and click OK. - Create or modify
DefaultGatewayMetric(typeREG_MULTI_SZ) and set its value to1.
Step 5: Configure DNS Servers
- Double-click the
NameServerkey (typeREG_SZ). If it does not exist, right-click, select New > String Value, and name itNameServer. - Enter your preferred DNS server addresses separated by a comma (for
example,
8.8.8.8,8.8.4.4). - Click OK.
Step 6: Apply the Changes
Registry changes to network adapters do not take effect immediately while the network stack is running. To apply the new configuration:
- Disable and re-enable the network adapter via the command line or PowerShell, or
- Restart the computer.