Change IP address and HostName of NT machine | CodeGuru

Change IP address and HostName of NT machine

Environment: NT4 SP5 How to set local machine IP addresses from your program ? Follow this steps 1. Open registry on the HKEY_LOCAL_MACHINE 2. Find the subKey = SOFTWAREMicrosoftWindows NTCurrentVersionNetworkCardsnetcard# netcard# usually is “1” but you can control any subkey and find specific netwrok Adapters Refer to “MSDN Registry Entries for Network Adapter Cards” 3. […]

Written By
CodeGuru Staff
CodeGuru Staff
Jul 29, 1999
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: NT4 SP5

How to set local machine IP addresses from your program ?

Follow this steps

1. Open registry on the HKEY_LOCAL_MACHINE

2. Find the subKey = SOFTWAREMicrosoftWindows NTCurrentVersionNetworkCardsnetcard#
netcard# usually is “1” but you can control any subkey and find specific netwrok Adapters Refer to “MSDN Registry Entries for Network Adapter Cards”

3. Get data for the value “ServiceName”

4. Find the subKey = SYSTEMCurrentControlSetServices”ServiceName”ParametersTcpIp”

5. Set data for the value “IpAddress” to change IP address

6. Set data for the value “SubnetMask” to change subnet mask

7. Set data for the value “DefaultGateway” to change default gateway

8. Reboot your PC.

How to set local machine HostName from your program ?

Follow this steps:

1. Open registry on the HKEY_LOCAL_MACHINE

2. Find the subKey = SYSTEMCurrentControlSetServicesTcpIpParameters

3. Set data for the value “HostName”

4. Find the subKey = SYSTEMCurrentControlSetControlComputerNameComputerName

5. Set data for the value “ComputerName”

6. Reboot your PC and HostName will be set.

WARNING: Modify registry incorrect can cause serious, system-wide problems . Use this at your own risk

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.