Windows IT Pro
Windows IT Library
  - Advertise        
Windows IT Pro Logo

  Home  |   Books  |   Chapters  |   Topics  |   Authors  |   Book Reviews  |   Whitepapers  |   About Us  |   Contact Us

search for  on    power search   help
 






Dynamic Host Configuration Protocol
View the book table of contents
Author: Emmett Dulaney
Vijay Sankar
Sharon E. Sankar
Published: June 1999
Copyright: 1999
Publisher: 29th Street Press
 


Synchronizing with the Registry
Another important feature of the active lease dialog box is the Reconcile button, which synchronizes the DHCP database with the Registry. When you click this button, the DHCP database is searched for inconsistent entries — IP leases that are shown in the Registry but aren’t reflected in the DHCP database. It’s good practice to run Reconcile after restoring or after a system crash. Reconciling registers the inconsistent IP addresses in the DHCP database of active leases with arbitrary unique identifiers. As clients renew their leases, these identifiers are updated.

Logging and Conflict Detection
The Server/Properties page of DHCP Manager contains two troubleshooting features for DHCP: Logging and Conflict Detection. Logging records DHCP activity to the file dhcpsrv.log, and conflict detection pings an IP address before assigning it to discover whether the IP address is in use. (Conflict detection is an option only when Service Pack 2 or later for NT 4.0 is installed.) Conflict Detection must be enabled to allow the DHCP client to send dhcpdecline messages. Also, only IP addresses that were not given to the client in the last renewal are pinged to check for duplication.

A sample of the logging file from our network is shown in Figure 8.6. For this example, the lease time was set to 1 minute (don’t do this in your production network!). Also, for obvious reasons, we partially obliterated the IP address, host name, and MAC address.

Note that although lease time was set to one minute, the logging record shows the renewal process happening every thirty seconds (half of the lease’s time to live). This interval is consistent with the documentation, which states that the renewal process begins halfway through the lease period.

Errors in DHCP and How to Correct Them
Several errors can occur in your DHCP service. Below we outline some of the problems that can occur with Microsoft DHCP and how to resolve them.

A Full DHCP Database Volume
You’ll receive the following error message if the volume that contains the dhcp.mdb file is full: DHCP Event 1014.
The JET database call returned the following error with a hex data
status of “ff fd ff ff (0xfffffdff=-513)”
The only way to address this problem is to free up some hard-drive space.

Duplicate IP Addresses
Microsoft DHCP clients using non-Microsoft DHCP servers may receive a Duplicate IP addresses error message. NT Service Pack 2 includes a new packet type (dhcpdecline) that may not be recognized by non-Microsoft DHCP servers. If it’s not recognized, the IP address won’t be marked as bad and may be issued even though it has already been issued to another client.

Restoring a Corrupt DHCP Database File
You’ll receive the following error message if a DHCP database file (dhcp.mdb) becomes corrupt. Event ID: 1014
Source: DhcpServer
Description: The Jet database returned the following Error: –510 (or –1022 or –1850)
The usual culprits for DHCP database corruption are power failures, bad hard drives, and curious users who try to open the dhcp.mdb files using Microsoft Access.

If your DHCP database becomes corrupted, you can fix in in one of several ways, as outlined in the Microsoft Technet CD article “How to Restore a Corrupted DHCP Database File” (Q173396). For those of you who don’t have a copy of this CD or article, what follows is a paraphrase with a few additional steps and clarifications.

The DHCP server’s database is contained in the DHCP.mdb file located in the Systemroot\System32\DHCP folder. Most of the information in this file is also found in the Registry key

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DHCPServer\Configuration

During a normal shutdown, both the Registry key and the database file are backed up. The Registry key backup is made to Dhcpcfg, which for NT 4.0 and earlier is located in %Systemroot%\System32\DHCP\Backup. The database file (DHCP.mdb) for NT 4.0 is stored in %Systemroot%\System32\DHCP\ Backup\Jet\New folder.

You can recover a corrupt database in two ways. You can restore the backup copy of dhcp.mdb from a tape backup or disk. Or you can generate a new dhcp.mdb from the dhcp Configuration Registry key.

The first method is preferred. Both methods require you to reconcile the dhcp.mdb file with the Registry as described above. We give specific steps for each method below.

Before performing either of these procedures, heed the usual warnings about editing the Registry. Make a full backup of the server, including the Registry, before you edit it. Also, back up any files that are open, such as Microsoft Exchange files.

For both procedures, go to the command prompt and type

net stop dhcpserver

to prevent the DHCP service from starting while repairs are under way.

Tip: Jim Kenzig at http://thethin.net has pointed out that you can receive TechNet articles (and others) as e-mail by sending a message to mshelp@microsoft.com. In the Subject line of your message, type the article ID number. For example, to receive Q173396, your subject line should read

Subject: Q173396

You can have multiple articles sent to you in e-mail by typing multiple article ID numbers separated by a comma. For example

Subject: Q173396, Q173399, Q174062

To receive an index of articles, type Index in the Subject line. The MSHelp Index is updated monthly. For more information about MSHelp, see http://support.microsoft.com/support/kb/articles/q183/1/21.asp.

Restoring a Backup Copy of the DHCP Database
To restore a backup copy of the DCHP database, follow these steps:
  1. Move all files (but not subdirectories) in the %Systemroot%\System32\ DHCP folder to another directory. Make sure that the subdirectory structure remains unaltered. Copy all the files in the DHCP, BACKUP, JET, and NEW folders to a different directory and delete the original files.
  2. From the NEW directory, remove the database file, dhcp.mdb.
  3. Copy the backup database file into the %Systemroot%\System32\DHCP folder from %Systemroot%\System32\DHCP\backup\jet\new\dhcp.mdb. If this backup file is also corrupt or is inaccessible, copy this file from a tape backup.
  4. Compress the file using Jetpack.exe. To compress the file, first remove any file called Temp.mdb from the DHCP folder, then type the following at the command prompt:


  5. CD %Systemroot%\System32\DHCP
    Net Stop dhcpserver
    Jetpack Dhcp.mdb Tmp.mdb
    Net Start Dhcpserver

    The Net Stop command stops the DHCP service; the Jetpack command compacts the database by copying the file to a temporary database, compacting it, deleting dhcp.mdb, and then renaming tmp.mdb to dhcp.mdb. The Net Start command restarts the DHCP service.

    For more information about compressing the file, see Microsoft Technet CD article Q145881 “How to Use Jetpack.exe to Compact a Wins or DHCP Database.”
  6. To restore scope and reservation information, you must now restore the dhcpcfg file. Start the Registry editor by typing

    Regedt32.exe

    from the Run utility and go to the subkey

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Configuration.

    You will see a window similar to Figure 8.7..
  7. To restore configuration information from the backup file, select Restore from the Registry menu, go to the Browse list, and select %SystemRoot%\ System32\DHCP\Backup\Dhcpcfg. Click Yes to confirm the selection.
  8. Exit the Registry editor and start the DHCP Service from the services icon in the Control Panel or type

    net start dhcpserver

    at the command prompt.
  9. Open the DHCP Manager on the server and check to see that the scope information is correct. Select Active Leases, then click Reconcile as described in “Synchronizing with the Registry” earlier in this chapter. Repeat this procedure for all scopes.
  10. If you view the Active Leases Property page after reconciling, you will notice that the IP address and the computer name are listed but the unique identifier isn’t necessarily the MAC address; it may be an arbitrary number that will be updated as soon as the client renews its lease. If the Registry contains entries not contained in the new dhcp.mdb file, the entries are reconciled in this way. The Registry knows that the lease has been given out but the dhcp.mdb file doesn’t know to which client the IP address is assigned.
Generating a New Database File
If you suspect that your backup database file is also corrupt, you can generate a new DHCP database file. Generating a new file is the method of last resort because all current lease information is lost.
  1. Move all files (but not subdirectories) in the %Systemroot%\system32\ DHCP folder to another directory. Make sure that the subdirectory structure remains unaltered. Copy all the files in the DHCP, BACKUP, JET, and NEW folders to a different directory and delete the original files.
  2. If you are using NT 4.0, restart the DHCP server. Check to see whether the scope information is missing. If it is, stop the DHCP server and compress the file as outlined in step 4 above.
  3. Restarting the DHCP service causes the dhcp.mdb database file to be regenerated, but all current active lease information will be lost. To restore the configuration information, reconcile the Registry with the database file as outlined in steps 6 and 7 above.


Page: 1, 2, 3, 4

next page



ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

EXCHANGE 2007 Mastery Series – May 29, 2008
3 Info-packed eLearning seminars for only $99! Learn the pros and cons of your mailbox high availability options, see real-world examples of Transport Rules, and get started with basic PowerShell commands with Mark Arnold, MCSE+M and Microsoft MVP.

Windows IT Pro Master CD: Take the Experts with You!
Find the solutions you need in thousands of searchable articles, helpful bonus content, and loads of expert advice with the Windows IT Pro Master CD. Order comes with a 1-year subscription to the new, online articles posted every day!

SQL Server Magazine Master CD: Take the Experts with You!
Find the solutions you need in thousands of searchable articles, helpful bonus content, and loads of expert advice with the SQL Server Magazine Master CD. Order comes with a 1-year subscription to the new, online articles posted every day!

Attention User Group Leaders...
Announcing the eNews Generator—a FREE HTML e-newsletter builder for user group leaders. Build your HTML and text e-newsletters in minutes. And add Windows IT Pro & SQL Server Mag articles alongside your own message!.

Become a fan of Windows IT Pro on Facebook
Join the Windows IT Pro fan club on Facebook. Chat with other IT Pros, upload your pictures, check out what's up n' coming in the next issue and more!



Become a Response Point Specialist
Earn more with the small biz phone solution from Microsoft.

Get Started with Oracle on Windows DVD
Learn how Oracle gives you the power to grow by providing a scalable, easy-to-use platform for running your business at a price you can afford.

Agent-less Remote Backup Service, Free 30 Day Trial
Award winning remote backup service at a competitive price with no min GB/month. Sign up Now!
Windows IT Pro Home Register About Us Affiliates / Licensing Press Room Media Kit Contact Us/Customer Service  
SQL Connected Home IT Library SuperSite FAQ Wininfo News
Europe Edition Office & SharePoint Pro Windows Dev Pro Windows Excavator 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing