DHCP & Static IP Settings in Windows Registry
If you're new here, you may want to subscribe to Windows Reference RSS feed Thanks for visiting!
Undoubtedly, these are stored in the Windows registry. While there is no need to change any of these values from Windows Registry as it is good enough to make the changes network settings, it is still good enough to where they are and what the related registry keys are.
Let’s look at the registry keys first and then look at the case of the static IP settings and DHCP based IP settings.
To view the registry keys:
1. Click Start - Search (Start – Run in Windows XP/2003) and type “regedit”. This launches the WIndows Registry.
2. In the registry, navigate to the following registry key
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
HKEY_LOCAL_MACHINE
\SYSTEM
\CurrentControlSet
\Services
\Tcpip
\Interfaces
\<Interface GUID ex: {1BBA2BE4-D734-47DF-AEDC-6167F60E278D}>
Every network interface in your PC or server will have a unique Interface GUID as above. Click on them to find the one appropriate to be checked.
Case 1: DHCP
Now, we know where the entries are. Lets now look at what the keys are.
DhcpIPAddress
This key holds the IP Address provided by the DHCP server to your PC. (In the screenshot shown, it is 192.168.0.3)
DhcpSubnetMask
This key holds the Subnet mask for the IP Address, again provided by the DHCP server. (In the screenshot it is 255.255.255.0)
DhcpDefaultGateway
This holds the IP Address of the Default Gateway for the network. (here 192.168.0.1)
DhcpServer
IP Address of the DHCP Server itself (192.168.0.1 here)
DhcpNameServer
Nameserver (DNS) IP Address (192.168.0.1 here)


Case 2 Static IP Address
In this case, its not the DHCP tha provides the IP Address Nameserver, default gateway etc its manually configured by hand from the network connection settings.
IPAddress
This key holds the IP Address provided by the DHCP server to your PC. (In the screenshot shown, it is 192.168.0.3)
SubnetMask
This key holds the Subnet mask for the IP Address, again provided by the DHCP server. (In the screenshot it is 255.255.255.0)
DefaultGateway
This holds the IP Address of the Default Gateway for the network. (here 192.168.0.1)
NameServer
Nameserver (DNS) IP Address (192.168.0.1,192.168.0.2 here)


Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically each day to your feed reader.
Trackbacks & Pingbacks
Comments
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>






Having to change IP address 2 times daily piss me off.
My laptop use different IP at office, and need to change to other IP at home.
Googling for solutions land me here. I wonder how the others dealing with multiple IP.
That should not be too hard… By far the easiest option is using DHCP on both networks, if you have a DSL router at home it should be easy to use that device as your DHCP server. I don;t know about your office infrastructure, but a DHCP server should not be too hard to setup…
If you want to stick with fixed IP addresses, try the command line tool NetSh.
NetSh /? should give you a good indication what it can do, but I’ll give the first examples:
netsh interface ip set address name=”Local Area Connection” static 192.168.168.10 255.255.255.0 192.168.168.1 1
‘ Used to set the address to 192.168.168.10 with gateway 192.168.168.1
netsh interface ip set dns “Local Area Connection” static 192.168.200.200
‘ Set the 1st DNS server fixed to 192.168.200.200
netsh interface ip add dns “Local Area Connection” 192.168.200.201
‘ Set the secondary DNS server
netsh interface ip set wins “Local Area Connection” static 192.168.200.202
‘ Set the WINS server
Keep in mind that the command accesses your netwerk interface by name, so change the name “Local Area Connection” to whatever your network card is labeled.
You can easily put these NetSH commands in a batchfile, and thus create two batchfiles that do the trick (one for office settings, one for home settings).
Good luck!
This looks like the XP method but with different keys for static and DHCP IP entries.
Now can this be used to set a static address while still using DHCP?