Tag Archives: DHCP Role

Automatic DHCP server Backup

Dynamic Host Configuration Protocol (DHCP) server in organization may require backup and restore dhcp database in event of hardware failure, software failure, migration or in fault configuration change. How many of you guys know that Microsoft automatically backup your dhcp database? Sounds strange right? but yes system automatically backup the DHCP server config. In this post let’s see how we can adjust the default parameters of this automatic backup process.

In my demo I am using a server with windows server 2012 R2 in a domain. It do have DHCP server role installed and configure.

To start the process log in to server as Domain admin or Enterprise admin.
Then Server Manager > DHCP


Once mmc load, right click on the server node and click properties.


In the new window you can see it shows backup path as C:\Windows\system32\dhcp\backup. This is the default path. But we can change it to local folder or network share. Click on brows to select the new path. In my demo it is set to C:\DHCPBackup. Once path set click on ok.



System automatically backup the config in every 60 minutes time. But we also can change this schedule as per our requirement.
To do that we need to do some registry key edit. To open the registry mmc, go to Run > regedit


Then go to path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters
In there you will be able to see a key called BackupInterval.


To edit the value double click on it, and then once open select, decimal value option.


As you can see default value is 60, to change it type the value you needs (the value represent the number of minutes) and press ok. In my demo I am going to set for 10 minutes.

Once done we can check the folder path we set to confirm the backup it’s made.


If you have any questions feel free to contact me on rebeladm@live.com


Microsoft has already announced that windows server 2003 / windows server 2003 R2 versions support is coming to end in 14th July 2015 (http://support2.microsoft.com/lifecycle/search/default.aspx?sort=PN&alpha=Microsoft+Windows+Server+2003&Filter=FilterNO ).

It’s no wonder that still organizations using windows server 2003 / windows server 2003 R2 in their infrastructure with different server roles. In last few post I have covered up how we can migrate different server roles from windows server 2003 to latest windows server 2012. This article also a part of the same series and it will explain how we can migrate DHCP server role.

For the demonstration I am using following setup

Server Name

Operating System

Server Roles



Windows Server 2003 R2 Enterprise x86


Network A –

Network B –

Network C –


Windows Server 2012 R2 x64

dhcp-2k3.canitpro.local server currently setup with 3 additional NIC to represent network A,B and C. they have configured with static ip addresses to match with relevant network it belongs to. The DHCP server host different DHCP scopes for each network.

Backup DHCP configuration in windows server 2003 R2

1)    Log in to the windows server 2003 as member of administrator group
2)    Load the DHCP server console Start > Administrative Tools >  DHCP


3)    In here we can see the configured DHCP scopes


4)    Now it’s time to back up the config. To do that open the command prompt using start > run > type cmd and then enter
5)    Then type netsh dhcp server export C:\DHCPbk\dhcpbk.txt all and press enter. In here C:\DHCPbk\dhcpbk.txt is the file path which backup will save in to. It can change according to your requirement.


6)    Now please move file C:\DHCPbk\dhcpbk.txt in to CANITPRO-DC2K12.canitpro.local server which will be configured as new DHCP server ( windows server 2012 R2)

Remove DHCP roles from windows server 2003 R2

Since we no longer need DHCP role running on this server we can go ahead and uninstall the DHCP service.

1)    Log in to the windows server 2003 as member of administrator group
2)    Start > Control Panel > Add or Remove Programs


3)    Then click on “Add/Remove Windows Components”


4)    In next window select “Networking Services” and click on details


5)    From next window de-select the DHCP option and click ok


6)    Then click next to uninstall the DHCP service

It will uninstall the DHCP role from the windows 2003 server.

Install DHCP Role in windows 2012 R2 server

1)    Log in to the windows server 2012 as member of administrator group
2)    Open Server Manager > Add Roles and Features


3)    It will open the wizard and click next to continue
4)    For the installation type select “Role-based or feature-based installation” and click  next
5)    Let the default selection run on server selection and click next to continue
6)    For the server roles select DHCP and it will prompt to add relevant features. Click on “Add features” to add them and next to continue


7)    For the features let it run with default. Click next to continue
8)    Then it will give brief description about DHCP server role and click next to continue


9)    Next window it will give the confirmation and click on install to continue


This will install the DHCP server role in the new server.

Restore DHCP configuration

1)    Log in to the windows server 2012 as member of administrator group
2)    Open Command prompt with Run > cmd
3)    Type netsh dhcp server import C:\DHCPbk\dhcpbk.txt all and press enter. In here C:\DHCPbk\dhcpbk.txt is the backup file we copied from windows 2003 server.


4)    Go to Server manager > tools > DHCP


5)    Right click on the server name > All Task > Restart


6)    Once Restart done we can see all the scopes are visible which was in 2003 server.


7)    We still need to authorize the dhcp server, to do it again right click on server name and select authorize


Now we completed with the restore process and I already can see its issues IP addresses.


if any questions about the post feel free to contact me on rebeladm@live.com

Step by Step Guide to install DHCP role and configure

Let’s see how we can configure DHCP server in a Windows Server Environment. For the demo I will be using Windows 2008 R2 Server.

To start first need to log in to the server with administrator privileges. Then start the “server Manager” by clicking on “Server Manager” icon on task bar. Then go to “Roles”


Then click on “Add Roles” option to open Add roles Wizard.


Then it will load the Roles Wizard and select the “DHCP Server” From the list and click next to continue.


Then it will give description about the role. Click next to continue.


Next window is asking to use which interface to serve DHCP clients. If server has multiple NIC with multiple IP you can add them also to serve DHCP clients.


In next window it will give opportunity to add DNS settings that should apply for DHCP clients.


Next window is to define the WINS server details.


In next window we can add the scope, the Starting IP, End IP of the DHCP range, subnet mask, default gateway, leased time etc.


In next Window it can configure to support IPv6 as well.


Then it will give the confirmation window before begin the install. Click on “Install”


Once installation finishes DHCP server interface can open from Start > Administrative Tools > DHCP


Using the DHCP it is possible to even configure multiple Scopes configurations to the network. In a network there can be different network segments. It is waste to setup different DHCP servers for each segment. Instead of that it is possible to create different Scopes to issue DHCP for them.