How to change the subnet mask of DHCP scope

19 June 2009

Changing the DHCP scope subnet mask

Change the subnet mask in existing DHCP scope

You can’t change the subnet mask of the DHCP scope directly without deleting the scope, need to delete the DHCP scope first then recreate the scope with new subnet, but this will lead to large amount of manual work

To avoid the manual work use the below netsh command to Change the subnet mask in existing DHCP scope with the simple steps

Use the below command to export the scope configuration


C:\>netsh dhcp server \\”Server name” scope “scope subnet” dump>c:\dhcp.txt


C:\>netsh dhcp server \\Test01 scope dump>c:\dhcp.txt

To change the subnet mask of the scope

Open the dhcp.txt file and change the subnet mask, dhcp.txt file resemble the following

Changed the current scope context to scope.

Dhcp Server add scope "Vlan-1" "Vlan-1"
Dhcp Server Scope set state 1

Edit the file and save

After this, delete the scope and run the below command to create the scope from the txt file

C:\>netsh exec c:\dhcp.txt

This will automatically create the DHCP scope with the new subnet mask

This way you can change other configuration details along with subnet mask change, like IP range and Excluderanges

Subscribe to Windowstricks by E-mail to get the free updates and free tools

Share this . . .


Diego,  11 May 2011 15:31  

Great post ! Worked for me on a 2008R2 machine saving the time of reconfiguring the whole DHCP Scope on 2 servers. Thank you!

Anonymous,  24 September 2011 08:11  

This is awesome.

Anonymous,  30 November 2011 14:30  

Thanks a lot!

It works, however, in addition to changing scope's mask in the dump-file, it is necessary to change its IP-address, too, to match its new mask. Otherwise the command:

C:\>netsh exec c:\alabala.txt

fails with appropriate error message.

Anonymous,  14 December 2011 06:26  

ive read this post and have one quick question i hope can be answered before i make the changes.
im just changing the subnet mask from to

When i delete the existing scope and quickly import the new one using this method.Will my clients automatically renew or does it need to be forced on the client..I dont want to make the change and have all the users calling as they have lost connectivity in a hospital enviroment.

Anonymous,  30 January 2012 09:44  

Worked great for me with one addition. My range was originally with a subnet of When i just changed the subnet to the import woud fail with "bad parameter" I had to do a search and replace of the with and then it was able to import. Just found a simple subnet calculator online to tell me that a 252.0 subnet containing 67.0 had to start at 64.0.

Anonymous,  1 May 2012 23:14  

awesome .. double awesome .. just great .. thanks a bunch

Anonymous,  28 June 2012 16:52  

Thanks a lot!!!

Anonymous,  26 July 2012 20:29  

Thanks !!

Anonymous,  6 November 2012 02:43  

Thank you, from Italy!

Adam Kessler 22 November 2012 21:36  

There is a significant step left out in the process expressed above. One that can lead to significant frustrations and network down time.
The instructions to delete the scope after you have dumped the DHCP configuration is seriously incomplete. Before you can effective import a modified scope you must rename the dhcp.mdb and dhcp.pat files in the dhcp system folder. Without this step, the import process will always load the existing configuration and try to update it with the contents of the dump file. This will not work when attempting to change the network mask. The existing files must be renamed in order to create a new scope with the changed mask. I would highly suggest trying this on a non-production server first. I did so by first creating a new scope with the parameters I needed for the network definition. I did not define anything else. Once this was done, I dumped this to view the file for a scope as I needed it to be configured. I then copied out the parts reflecting the changes into the approriate areas of my production server's dump and then imported that into the test server and checked the DHCP gui for proper completion. Once I was sure this worked, I used this file to import the changes into my production server. In this case because of the need to change the network mask, I had to rename the ,mdb and .pat files on the production server to basically create the new scope.

Anonymous,  30 January 2013 00:13  

This worked on a 2008r2 server with multiple scopes, followed the process outlined to (almost) to the letter, I only needed to change one scope. Perhaps if you have only one scope you would need to delete your mdb files, it was not neccessary in my case. This saved me a lot of work, thank you!

Anonymous,  6 February 2013 14:30  

Notwork for windows2003 DHCP server...It is not changing the DHCP scope
subnet mask

Bayarbyamba Sambuu 12 March 2013 08:05  

Thank you very much! Works great! My scope IP and subnet was I can change it

Clay Tsuhako 27 August 2013 20:02  

This looks very good for what I would like to do ( to My question would be what would I have to do to the devices (servers, switches,etc.) that have static IPs and the old subnet mask of Would I still have to manually change all their subnet masks to

Anonymous,  9 January 2014 12:56  

Just did this and it works exactly as the instructions suggest. No need to rename dhcp mdb and pat files as another poster has suggested.

Thank You,  26 February 2014 09:32  

Awesome !!!!! worked like a charm. I had around 20 reservations in my scope and all got restored after changing Scope and mask both, in 10 seconds !!!!

Anonymous,  11 June 2014 22:32  

Great Post! This saved me tons of time today.

Wolfgang Ruthner 16 July 2014 11:48  

Thank you! Saved me a lot of time ;-)

Post a Comment

Copyright   © 2014 - - all rights reserved | Powered by Blogger | Blogger template The Beach by

Back to TOP