6

In a LAN, I configure my IP address as needed, but once in a while I move to a different subnet and need to update my IP address quickly so I am thinking of making a simple application to help me with this. Thus I would like to know where is the IP address settings stored in Registry?

In the old days of Win95 I could just search for the string, but now in Win10, the registry has become so huge it would probably take 8 days to end the search. Halp.

6
  • 1
    This is likely overkill but these settings appear to be stored in HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces but you have to find the appropriate {########-####-####-####-############} container to adjust accordingly I suppose. Windows already has an app for this and also you can use netsh commands to set static IP settings and such too. Doing it from the registery seems like overkill but perhaps running applicable netsh commands from an app to spawn the cmd and run the commands would work better for you instead. Jul 13, 2018 at 4:18
  • @PimpJuiceIT ok i will have a look at the netsh command. Thanks!
    – GeneCode
    Jul 13, 2018 at 4:23
  • Here's a starting point for some command examples for you: my.esecuredata.com/index.php?/knowledgebase/article/16/… and if you use Python, something like Cmd = ["cmd.exe", "/C", "netsh interface ip set address "Ethernet" static <IPAddress> <SubnetMask> <DefaultGateway> 1"] followed by subprocess.Popen(Cmd, shell=True) or some variation as such may help. Jul 13, 2018 at 4:38
  • Gene - You can search the entire registry for the IP Address (e.g. 192.168.1.2) your interface is assigned too—just start regedit, highlight Computer, press F3, and then type in the IP address and press Find Next. It'll stop at the location in the registry it finds the IP so you can record that, and then move onto to find other location. Your question probably has too much detail as really you just want to know where to find the IP address settings in the registry and what all you need to change for IP settings from there for it to become effective, you may need to reset some services after Jul 14, 2018 at 17:36
  • 1
    You mention you are developing an app and Win 95 and searching the reg with Win 10 taking days and so forth and people are interpreting that so I find it best to keep your answer on point for your ultimate goal and make it plain and simple without the other distracting noise or people will assume stuff. You might also mention you tried searching the registry for xxxxx or whatever and didn't have any luck. If you determined where it's stored and how you can change from there to make effective after the change, then you can move on and come back with another question for your task later. Jul 14, 2018 at 17:40

2 Answers 2

8

The IP addresses of the various network interfaces are stored under:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces

but just changing a value there doesn't mean your active IP address changes.

Use existing Windows commands to change it, like:

Set-NetIPAddress

in PowerShell

0

What Peter answered is also useful but I found easier way than using powershell. Just use Command prompt and run netsh

netsh interface ip set address "Ethernet" static addr=192.168.2.1 mask=255.255.255.0 gateway=192.168.2.251 

And if you want to change DNS as well, use:

netsh interface ipv4 add dnsserver "Ethernet" 8.8.8.8 index=1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .