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.
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) orExport-DhcpServer(configuration only), and check thatRestore-DhcpServerorImport-DhcpServerworks 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
# Database location, its backup location and backup intervalGet-DhcpServerDatabase
# Full backup of configuration and database (as administrator)Backup-DhcpServer -Path 'D:\Backups\DHCP'
# List the leases of every scopeGet-DhcpServerv4Scope | ForEach-Object { Get-DhcpServerv4Lease -ScopeId $_.ScopeId }