How to change the subnet mask of DHCP scope

By | June 18, 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

Continue reading → page 2


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

23 thoughts on “How to change the subnet mask of DHCP scope

  1. Diego

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

  2. Anonymous

    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.

  3. Anonymous

    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.

  4. Anonymous

    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.

  5. Anonymous

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

  6. Adam Kessler

    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.

  7. Anonymous

    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!

  8. Anonymous

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

  9. Clay Tsuhako

    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

  10. Anonymous

    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.

  11. Thank You

    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 !!!!

  12. Craig Chapman

    Thank you for this! It worked like a charm and saved me a lot of time!

  13. Jon

    I’ve created my own step-by-step version of this. The original is flawed in the sense that if you try to modify the only DHCP scope you have. It won’t work properly. Following the direction of another user on here, here is what you need to do:

    1) CMD: netsh dhcp server \\”Server name” scope “scope subnet” dump>c:\dhcp.txt
    2) Modify the txt file with the correct DHCP scope and Subnet Mask. Save it.
    3) Go into Services and STOP both DHCP client and Server services.
    4) Navigate to C:\Windows\System32\DHCP and rename both the “dhcp.pat” and “dhcp.mbd” files to .old
    5) Restart both DHCP client and Server services.
    6) CMD: netsh exec c:\dhcp.txt
    7) Open the DHCP admin tool and verify the scope is correct.
    8) Restart both DHCP services again to verify functionality.


Leave a Reply

Your email address will not be published. Required fields are marked *