Skip to contentGo to the directory tree
FileRisk: Do not touch
  • Windows Server

dhcp.mdb C:\Windows\System32\dhcp\dhcp.mdb

DHCP server database of leases and configuration on Windows Server; do not handle it directly, back it up with Backup-DhcpServer.

Updated on By AltF4 Formation

What it’s for

dhcp.mdb is the DHCP Server service database: the leases granted, and the configuration (scopes, options, reservations). The service loads it at startup. Lost or corrupted, it stops address distribution and wipes lease state.

What it contains

A Jet (ESE engine) database that only the DHCP service reads and writes. In C:\Windows\System32\dhcp it sits among its support files (transaction log j50.log, checkpoint j50.chk, tmp.edb), the DhcpSrvLog-*.log audit logs (see their page) and a backup subfolder where the service backs the database up automatically, every 60 minutes by default.

Risks and best practices

  • While the DHCP service is running, do not open, copy or move the database: it is locked, and a hot copy may be inconsistent.
  • To “start over”, use the DHCP console or PowerShell, never delete the file.
  • Back up with Backup-DhcpServer (database and configuration) or Export-DhcpServer (configuration only), and check that Restore-DhcpServer or Import-DhcpServer works before you need it. For a migration, export and import beat a file copy.
  • Leases contain MAC addresses and host names: protect backups.

Useful commands

Fenêtre de terminal
# Database location, its backup location and backup interval
Get-DhcpServerDatabase
# Full backup of configuration and database (as administrator)
Backup-DhcpServer -Path 'D:\Backups\DHCP'
# List the leases of every scope
Get-DhcpServerv4Scope | ForEach-Object { Get-DhcpServerv4Lease -ScopeId $_.ScopeId }

Report a mistake