Where is IP Address of my Ethernet settings stored in Registry

0

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.

GeneCode

Posted 2018-07-13T02:55:01.080

Reputation: 283

1This 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. – Pimp Juice IT – 2018-07-13T04:18:27.733

1Nice job to the person who downvoted but didn't say why. – GeneCode – 2018-07-13T04:22:44.517

@PimpJuiceIT ok i will have a look at the netsh command. Thanks! – GeneCode – 2018-07-13T04:23:29.940

Here's a starting point for some command examples for you: https://my.esecuredata.com/index.php?/knowledgebase/article/16/change-ip-address-in-windows-via-command-prompt 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.

– Pimp Juice IT – 2018-07-13T04:38:56.183

1it wan't me, but the downvote was probably due to lack of research effort. i.e, you could have done the search and waited the 8 days (or more like, probably less than an hour) while doing something else – Sir Adelaide – 2018-07-13T06:34:54.863

1See, that's the problem. people assume all the time. What make they think I have not made any efforts?? I have been searching on the net for the solution for half a day, and none worked for me. Even the HKLM///interfaces does not have the IP (all the strings are empty) in my Win10. – GeneCode – 2018-07-13T07:47:27.193

1I don't know why people can't just leave my question alone if they don't want to help. There is not one answer to one question because situations vary - Windows version, user accounts settings, and other differences. – GeneCode – 2018-07-13T07:48:25.317

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 – Pimp Juice IT – 2018-07-14T17:36:57.623

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. – Pimp Juice IT – 2018-07-14T17:40:08.610

So baby step it one step at a time and ask many questions if you need but get keep each simple and clarify as much as possible and tell briefly what you tried and you can get great help. Keep fine tuning your question asking skill Gene and you'll get it just like I had to. I don't ask many question on SU but I do on SO so I learned this and still learn every time and keep fine tuning it myself so you can do the same. – Pimp Juice IT – 2018-07-14T17:42:03.470

Answers

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

GeneCode

Posted 2018-07-13T02:55:01.080

Reputation: 283

3

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

Peter Hahndorf

Posted 2018-07-13T02:55:01.080

Reputation: 10 677