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

  1. Press Win + R, type regedit, and press Enter to open the Registry Editor.
  2. Navigate to the following path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
  3. Under the Interfaces key, 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 as IPAddress, DhcpIPAddress, or DefaultGateway.

Step 2: Disable DHCP

To configure a static IP, you must disable DHCP on the adapter:

  1. In the target GUID folder, double-click the EnableDHCP value.
  2. Change the Value data from 1 to 0.
  3. Click OK.

Step 3: Set the Static IP Address and Subnet Mask

  1. Double-click the IPAddress key (type REG_MULTI_SZ). If it does not exist, right-click, select New > Multi-String Value, and name it IPAddress.
  2. Enter your desired static IP address (for example, 192.168.1.100) on the first line and click OK.
  3. Double-click the SubnetMask key (type REG_MULTI_SZ).
  4. Enter the appropriate subnet mask (for example, 255.255.255.0) and click OK.

Step 4: Configure the Default Gateway

  1. Double-click the DefaultGateway key (type REG_MULTI_SZ). If it does not exist, create it as a Multi-String Value.
  2. Enter the gateway IP address (for example, 192.168.1.1) and click OK.
  3. Create or modify DefaultGatewayMetric (type REG_MULTI_SZ) and set its value to 1.

Step 5: Configure DNS Servers

  1. Double-click the NameServer key (type REG_SZ). If it does not exist, right-click, select New > String Value, and name it NameServer.
  2. Enter your preferred DNS server addresses separated by a comma (for example, 8.8.8.8,8.8.4.4).
  3. 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: