Microsoft KB Archive/312468

= How to Request Additional DHCP Options from a DHCP Server =

Article ID: 312468

Article Last Modified on 9/14/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows NT Workstation 4.0 Developer Edition
 * Microsoft Windows NT Server 4.0 Standard Edition
 * Microsoft Windows NT Server 4.0 Enterprise Edition

-



This article was previously published under Q312468



IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SUMMARY
This article describes how to configure the DHCP Client service to request additional DHCP options (for example, option 11 [Resource Server]) and describes some differences between Windows NT 4.0 and Windows 2000.



MORE INFORMATION
All of the Windows DHCP client computers that are referenced in this article support the following DHCP options by default:

In addition, Windows 2000 supports option 31 (Perform Router Discovery) and option 33 (Static Route).

Windows NT 4.0
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

In Windows NT 4.0, the DHCP options are stored in the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DHCP\Parameters\Options

You can add a new key for the DHCP option that you want to request from the DHCP server. Options that are supported by the DHCP server are defined in Request for Comments (RFC) 1533. For example, if you want to request the Internet protocol (IP) address for a resource server, you must add DHCP option 11. To do so:  Start Registry Editor (Regedt32.exe). Locate and click the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DHCP\Parameters\Options

 Click Add Key on the Edit menu, and then add the following registry key:

Key Name: 11

Class: (Do not enter a name here)

 Click the new key in Registry Editor, click Add Value on the Edit menu, and then add the following registry value:

Value Name: KeyType

Data Type: REG_DWORD

Data: 0x3

NOTE: The Value for KeyType determines the Data Type for the new Key. The Value 0x3 will create a REG_BINARY Data Type, which is the best for getting the raw data. Click Add Value on the Edit menu, and then add the following registry value:

Value Name : RegLocation

Data Type : REG_SZ

NOTE: In the Data box, type the registry key where you want to store the option data. For example, you want to store the data in the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

In this case, type the following string in the Data box:

system\currentcontrolset\services\tcpip\parameters\resourceserver

 Quit Registry Editor, and then restart the computer.</li></ol>

NOTE: The client requests the option from the DHCP server and enters it as a hexadecimal value in the registry key that you typed in the Data box. If you want to convert the data, you must create your own logic to do so.

Windows 2000
The DHCP Client service in Windows 2000 has been updated from Windows NT 4.0. Windows 2000 clients must make a DhcpRequestParams API call to request custom parameters. The DHCP client stores data that is obtained from a DHCP server in its local cache. If the DHCP client cache contains all of the data that is requested in the pRecdParams array of a DhcpRequestParams function call, the client returns data from its cache.

If the data that is requested is not available in the client cache, the client processes the DhcpRequestParams function call by submitting a DHCP-INFORM message to the DHCP server. The DhcpRequestParams API call can also be used to request User or Vendor ClassID-based options. For more information, refer to Microsoft Developer Network (MSDN) documentation about the API call. You can find examples of code in the following MSDN documents:
 * DHCP Examples

http://msdn2.microsoft.com/en-us/library/Aa363345.aspx
 * DhcpRequestParams

http://msdn2.microsoft.com/en-us/library/Aa363298.aspx

For more information, refer to RFC 1533:

RFC 1533 - DHCP Options and BOOTP Vendor Extensions

Keywords: kbfaq kbhowto kbnetwork kbnofix KB312468

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.