Oct 062008
 

Have you ever wondered where the network configuration settings like IP Address Subnet mask or the same settings provided by your DHCP server (propably your home broadband router) on a network interface or a wireless interface are stored on your computer?

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
                            \

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)

DHCP IP Settings

DHCP Settings in Registry

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)
Static IP settings

Static IP settings in registry

zp8497586rq

  7 Responses to “DHCP & Static IP Settings in Windows Registry”

  1. 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.

  2. 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!

  3. 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?

  4. Thanks for this excellent article!
    But if a would like to browse where my laptop has been connected (public or private wifi networks), where can I find that information? (OS Win 7 home premium)
    Thanks in advance for any help you could give me.
    ( Sorry for any errors :) )

  5. Thanks for this excellent article!
    But if I would like to know where my laptop has been connected (public or private wifi networks), where can I find that information? (OS Win 7 home premium)
    Thanks in advance for any help you could give me.
    ( Sorry for any errors :) )

  6. Hi all,

    Is there a way that can block specific ip address as default gateway?

  7. we had a problem on our BB server but now Alhamdulillah it’s solved

Sorry, the comment form is closed at this time.