14.3. Configuring Server Options

Problem

You want to configure DHCP options at the server level. These server options will be applied to all of the scopes on the server unless overridden within a scope.

Solution

Using a graphical user interface

  1. Open the DHCP snap-in.

  2. In the left pane, right-click on DHCP and select Add Server.

  3. Type in the name of the DHCP Server you want to target and click OK.

  4. Expand the server entry in the left pane.

  5. Click on Server Options, then right-click it and select Configure Options.

  6. Check the box beside the option you want to configure.

  7. This will make the Data entry section of the dialog box active.

  8. Enter the value(s) for the option and click OK.

Using a command-line interface

The following command configures a server option:

> netsh dhcp server \\<ServerName> set optionvalue <OptCode> 
                  <DataType> 
                  <OptValue>

In the following example, the "domain name" option (code 015) is configured with a value of "rallencorp.com" on the DHCP server named dhcp01:

> netsh dhcp server \\dhcp01 set optionvalue 015 STRING rallencorp.com

You can view all of the server options that have been configured with this command:

> netsh dhcp server \\<ServerName> show optionvalue

Using VBScript

See the Introduction for more information on how to run the netsh command from within a script.

Discussion

When a DHCP Server responds to a client request for a lease, the server also responds with any configured options for the scope. Options are nothing more than bits of configuration information, such as the ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.