Configuring the Registry Part I: Disabling APIPA
Being confident when configuring the Windows registry is an important strength for a computer technician. Of course, we’re not talking about computerized wedding gift lists here. We’re talking hardcore Windows configurations. If you can’t do it in the GUI, and you can’t do it in the command-line, then do it in the registry. It’s as close as you can come to programming Windows without going over!
Some fear the registry, but there’s no need; it’s not the reaper! Don’t fear the registry! As long as you remember a few simple rules when dealing with the registry, you should be able to make modifications easily… and safely.
- If you don’t know what it is, don’t mess with it!Sometimes the urge can be very great to change a setting without really knowing what it does. Try to avoid this “uncontrollable” urge. Constantly tell yourself that the consequences could turn a 15-minute configuration (including research) into a 2-hour long fiasco.
- Export your settings, or the entire registry database, before making changesAs long as you backup the contents of the registry, you can always revert back to the original if your changes don’t work. You might also opt to create a restore point before you make any changes.
- Test your configuration changes before they go liveRun thorough tests of your changes on the computer(s) affected by the change. This means restarting the computer several times, checking affected applications, and verifying that unaffected yet required applications still function normally.
A Registry Configuration Example
Let’s go ahead and make a basic configuration change in the registry. In this example we will disable Automatic Private IP Addressing (APIPA). This example often amuses at first, but can become an interesting reality if the following scenario ensues:
Scenario: A Windows XP computer normally gets an IP address from a DHCP server, and it has for some time with no issues. The IP address it normally obtains is 10.1.1.137. However, one day, the computer fails to access the LAN and the Internet. After analyzing the computer for a short time, an ipconfig/all command shows that the network adapter is not using the IP address 10.1.1.137 anymore. Instead, it is showing the address 169.254.38.56. What happened?
Well, there are several things that could have led to this. Let’s assume that the DHCP server was down on the day when the computer failed to access the network properly. If this happens, by default, the computer will look for another DHCP server, and if it cannot find one it will self-assign an IP address-in this case, the IP address 169.254.38.56. We are fairly certain that this is an APIPA address because it is on the 169.254 network; most network administrators will not use the 169.254 network number for LAN computers. The problem is that in some cases APIPA will not go away, even if the original DHCP server comes back up. This will depend on several factors, but let’s assume in this scenario that the computer in question could not shake the APIPA address, and could not obtain its original IP from the DHCP server. One solution would be to disable APIPA within the registry, thereby removing the 169.254.38.56 address, and allowing the computer to seek a proper DHCP server. Let’s show how to do this now.
Access the Registry Editor
- Click Start > Run. Alternatively, you could press the Windows + R keys on the keyboard to open the Run prompt. Note that you will need to have administrative rights to open the Registry Editor.
Type regedit.exe (or simply regedit) to bring up the Registry Editor. You should see the Registry Editor application similar to Figure 1.
Figure 1 The Registry Editor Window
Backup the Registry
- Click My Computer to highlight it
- Click File > Export. This will bring up the Export Registry File window.
- In the File name field type in the name of the registry backup, for example regbackup and click Save. By default, this will save the entire registry. Now you can work confidently knowing that you have a full backup just in case. As an added protective measure you could create a system restore point.
Navigate to the appropriate network adapter within the registry.
This can be done by navigating the following path:
Then, locate the proper network adapter; each is labeled as a different hexadecimal subkey. Click on each one until you find the subkey with the correct IP address. For example, in Figure 2, the IPAddress entry reads as 169.254.38.56. This is the third network adapter within the Interfaces subkey.
Figure 2 Accessing the Appropriate Network Adapter
- Right-click anywhere in the right window pane and select New > DWORD Value.
- A new entry appears. Name the new entry ipautoconfigurationenabled.
- Verify that it is set to zero (off) which is the default.
- Close the registry and restart the computer
Test the new configuration and verify network connectivity
- Type ipconfig/all in the command-line to see if the correct IP address is being obtained from the DHCP server. You can also test whether your registry entry was applied correctly by viewing the Autoconfiguration Enabled field within the results of the ipconfig. It should say No.
- Connect to LAN servers, domain controllers, and to the Internet to verify network connectivity. Of course, the IP address you obtain will most likely be different than the one in the scenario; also, it might be a different IP than the computer was using previously.
If you experience other issues after rebooting, double-check the network settings, and the registry settings, and verify that the DHCP server is functional. You could also try applying a static IP address, saving it, and then returning the network adapter to dynamic (obtain automatically), thereby restarting the entire 4-step DORA DHCP process. If necessary, import the old registry database and/or restore to an older system restore point. However, chances are that the steps listed previously have fixed the problem.