DHCP Database in Windows Server 2003

DHCP Database Topics

Perhaps you have never given the DHCP database a thought.  Well the time may come where you need to backup, reconcile or compact the DHCP database.  At the very least, I expect you will want to check your lease statistics.

Tutorial Topics for DHCP Database


DHCP – Display Statistics

Bizarrely, I find ‘Display Statistics’ the most difficult tab to find on the DHCP server.  This is because it’s the first item on the menu, and is often masked by the very highlight that should attract me.  I just hope that you are not afflicted by this blind spot. In any event, Display Statistics is one of the most interesting and rewarding items on the DHCP menu.

Display Statistics is available at both the server and the scope level.  My first thought is, ‘How many leases are left?’  Next, I look to see if there have been any NACKS or lease declines.  See the screen shot to find the Display Statistics… menu.

DHCP DatabaseDHCP Backup, Restore, Reconcile

DHCP has its own database.  Stored in this DHCP.mdb are the addresses, scopes and leases of the clients.  Understanding this database will help you backing up and restore a DHCP server.

Check out this folder: %systemroot%\system32\dhcp\dhcp.mdb

As time goes by the database will grow, and best practice dictates that you should consolidate the database by freeing up space taken up by old leases.

The procedure for compacting the dhcp.mdb database is this.

1) Stop the DHCP service.  Either right-click the DHCP Server icon, select All tasks then Stop.  Alternatively, go to the command line and type: NET Stop DHCPServer.  (For once the command really is DHCPserver, NOT DHCPyourservername.)

2) At the command line, navigate to: %systemroot%\system32\dhcp\dhcp.mdb.

3) Jetpack dhcp.mdb temp.mdb. What this does is copies the existing database, compacts it, then copies it back to the original location – clever.

4) Remember to restart DHCP.  Either use the GUI, or if you are at the command line, NET Start DHCPServer

Warning: Do not ‘mess’ with any of the files that you find in the %systemroot%\system32\dhcp folder, if you do, then DHCP will stop working and you will either have to restore, or else re-install DHCP.

Backing up the DHCP Database

The first surprise is that this dhcp.mdb database is backed up every hour.

The second surprise is that the old jetpack database engine controls the database.

The third surprise is that you can only automatically backup to a local folder.  Should you need a ‘real’ backup, then just backup the files in the %systemroot%\system32\dhcp\Backup\ directory.

Finally, and unsurprisingly, there is a GUI to backup the DHCP database.

Guy Recommends:  A Free Trial of the Network Performance Monitor (NPM)Review of Orion NPM v12 v12

SolarWinds’ Network Performance Monitor will help you discover what’s happening on your network.  This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.

Perhaps the NPM’s best feature is the way it suggests solutions to network problems.  Its second best feature is the ability to monitor the health of individual VMware virtual machines.  If you are interested in troubleshooting, and creating network maps, then I recommend that you give this Network Performance Monitor a try.

Download your free trial of SolarWinds Network Performance Monitor.


Reconcile is a technical term for making sure that DHCP information is consistent.  What can happen is that when you restore a database, there is a miss-match between lease information in the database and the same information in the DHCP server’s registry.  Specifically, the registry just stores basic or summary information, the detailed information from a recent restore maybe different, so a ‘Reconcile’ will ensure that the database and registry data are consistent once more.

Bear in mind that you can either reconcile individual scopes or choose all scopes.  It all depends on the ‘focus’ of what you select.  If you select an individual scope that that is the limit of what you can reconcile, however, when you select the server icon, you can: Reconcile All Scopes – see diagram above.  (not below)

DHCP Audit LogDHCP Audit, Statistic times

Once you setup DHCP auditing, you get a separate log for each day of the week.  The logs are a wealth of information, not just about the health of the server, but also which machine gets which IP address for how long.

To setup Auditing, right-click the DHCP server, then select properties.

Auditing removes the last reason for having static IP addresses, accountability.  Die-hards, Luddites who resist DHCP often justify static IP addresses on the grounds that you can always account for which machine had which IP address on a particular day.  With DHCP Auditing you can achieve the same result and have all the benefits of central administration, instant control over default gateways and a raft of other options.

Summary – DHCP Challenges

The DHCP database is full of surprises.  Discover how many leases you have issued with ‘Display Statistics.  Next discover where the database is situated, and master how to compact the dhcp.mdb.  Also, understand where you can Reconcile the scopes.  Finally, check whether or not auditing is set up on your DHCP server.


If you like this page then please share it with your friends


Related DHCP Server topics