Recipe14.9.Enabling Dynamic DNS Updates from the DHCP Server


Recipe 14.9. Enabling Dynamic DNS Updates from the DHCP Server

Problem

You want to configure the DHCP Server to perform dynamic DNS updates on behalf of clients.

Solution

Using a graphical user interface

To set the global dynamic DNS update configuration, do the following:

  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. Right-click the server node and select Properties.

  5. Click the DNS tab.

  6. Check the box beside Enable DNS dynamic updates according to the settings below.

  7. Select the radio button beside the desired option. You can have A and PTR records updated only when requested by DHCP clients, or have them always updated, even if the DHCP client doesn't request it.

  8. Unless you have a good reason otherwise, you should check the box beside Discard A and PTR records when lease is deleted.

  9. Check the box beside Dynamically update DNS A and PTR records for DHCP clients that do not request updates if you have legacy clients such as Windows NT or Windows 9x that you want to register dynamically in DNS.

  10. Click OK.

To set the dynamic DNS update configuration for a specific scope, do the following:

  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. Right-click on the target scope and select Properties.

  5. Click the DNS tab.

  6. Configure the settings as described above.

  7. Click OK.

Using a command-line interface

You can configure all of the dynamic DNS update settings with netsh. This is the format for the command:

> netsh dhcp server set dnsconfig <Enable> <Update> <DeleteOld> <Legacy>

There are four bits (0 for off or 1 for on) corresponding to each flag. The first setting is for enabling dynamic updates. If the second flag is 0, A and PTR records are always updated, and if it is 1, they are updated only if requested. The third flag, when set to 1, deletes A and PTR records when leases expire. The fourth flag, when set to 1, will cause the DHCP Server to send updates even if the client doesn't support it.

The following command enables dynamic updates (1), always performs dynamic updates (1), deletes records for expired leases (1), and does not perform updates for legacy clients (0):

> netsh dhcp server set dnsconfig 1 1 1 0

netsh doesn't support setting dynamic update settings on a per-scope basis as you can do with the GUI.


Using VBScript

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

Discussion

Dynamically assigning IP addresses to clients makes IP address management easier, but your clients may not always want to refer to other computers by IP address. If you are running the Windows Internet Naming Service (WINS) in your environment, client computers automatically register their names with that service, which allows users to use the NetBIOS protocol to resolve computer names. If you prefer to rely on the Domain Name System (DNS), clients will need to dynamically register their hostname via dynamic DNS updates. You could allow each client to register their own A and PTR records, but then each client would send its own set of DNS updates to your DNS servers. If you have hundreds of clients, that would be hundreds of computers that send dynamic updates. There are also some security issues with allowing clients to do this. Another option is to use the DHCP Server to send dynamic updates on behalf of clients.

For a detailed explanation on how DHCP works with DNS, visit http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/sag_DHCP_imp_InteroperabilityDNS.asp.


See Also

Recipe 14.19



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net