Windows Server – Change a DHCP Scopes Subnet Mask

KB ID 0001177 


You have probably tried to do this and found he option ‘greyed out’ because in the DHCP management console you can’t change the subnet mask of a scope. 

I needed to change a clients DHCP scope because I was changing their subnet from /24 to /16. I could have simply deleted and recreated the scope, but they has a lot of custom settings for their phone system, and hundreds of reservations (which I know is unusual).


I wrote an article a long time ago about migrating DHCP scopes, this process uses the same method to take a backup of the scope, then you can edit the subnet mask, and ‘re-import’ the scope again.

First take a backup of the scope, open an administrative command window, and run the following command;

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

Server 2012 Export DHCP Scope


Then open the C:\dhcp.txt file, and locate the subnet mask;

windows scope change subnet mask

Edit it accordingly, and save the changes.

windows dhcp change mask


You can now DELETE the live scope, then reimport the one you just edited with the following command;

netsh exec c:\temp\dhcp.txt 

Server 2012 Import DHCP Scope

Note: As you can see even when is has successfully import dyou will still see a “The following command was not found d error

On older, (pre Windows Server 2012 machines) use the following syntax instead;

netsh dhcp server import c:\temp\dhcp.txt all

Related Articles, References, Credits, or External Links


Author: PeteLong

Share This Post On


  1. When I run the import command on 2012R2, I get the request is not supported.

    Post a Reply
  2. I get the same thing as Miles when running the import on 2012 R2 servers. “The request is not supported.” The dump file is from the same sever. Just trying to edit subnet mask.

    Post a Reply
    • There you go, updated for Server 2012 🙂


      Post a Reply
  3. My WDS server is on Windows Server 2016 and the second option worked for me
    netsh exec C:\Temp\dhcp.txt

    Post a Reply
    • Thanks a lot.
      It worked for me at Windows Server 2016 at last.

      Post a Reply
  4. This is very helpful for me, Excellent……… 🙂

    Post a Reply
  5. When I run the import command on 2012R2 I get the request The following command was not found: .


    Post a Reply
    • Hi Sorry it’s taken me a while to reply, I wanted to run up a 2012 server to make sure the post was still relevant, and the code was correct. The screenshots {above} are new ones I took today, so the procedure still works. Are you running the command window ‘as administrator’? See is UAC turned off, and can you try putting the export file in a sub folder i.e. so it’s NOT on the root of the C Drive.


      Post a Reply
  6. You should note that if you have issues importing it, make sure you go back into notepad, do a “save as” with Encoding: ANSI. that option is located in the drop down next to the “Save”.

    Post a Reply
    • Thank you! Changing my text file as ANSI solved my import issues! I would not have thought of that! Great suggestion!

      Post a Reply
  7. Very useful. It worked for me from the first try. I did same few years ago, I remember, but then I used the old syntax (with import)

    Post a Reply
  8. This just saved me a bunch of time. Thanks for the great write up!

    Post a Reply
  9. No need to change the subnet mask on the router interface?

    Post a Reply
    • Yes – and all other statically assigned IP addresses on the network, and possibly any dynamic routing, but the article is specific to DHCP scopes!


      Post a Reply
  10. Thank you So much, Excelling work, this really helped save bunch of time.

    Post a Reply
  11. Great job with the tutorial, thanks!

    Post a Reply
  12. I know this article is a few years old and am hoping you are still monitoring the comments… I was following your very clear guide, but during import of the txt file that contains the new mask, I receive an error: “The command needs a valid Scope IP Address”. I can re-import my old settings fine but the modification of the mask apparently isn’t enough. It seems I might need to yet modify the txt further but not sure what else I need to change. Any advice would be helpful. Thanks!

    Post a Reply
    • Whats your source and destination Server OS, l’ll test it on the bench?

      Post a Reply
      • Thanks for responding. I have an address pool starting Current mask is 254.0. All IPs before .61 are static so none of those are picked up by DHCP. The DC is Server 2016 Standard. Aside from some member servers of 2012R2 all my relevant servers are 2016 Standard (DCs, VMs, Hosts). I am trying to simply change mask so I get thru (32-35). I am already operating 34-35. Do to IP crunch, I am attempting to expand IPs by changing mask. As mentioned, it seems I may need to modify the output dhcp.txt further–just don’t really know what. Thanks!

        Post a Reply
        • OK well with a subnet is in the middle of (usable to Those IPs you want are already in that range?

          Post a Reply
          • Just wanted to let you know that I did finally resolve the import error. I changed all .34 entries in the export to .32, re-imported and it went well. I did have to Supernet in DHCP to get the additional IPs to become available. Thanks for your assistance.

  13. Hi Pete,

    I am planning on changing my network from /22 to /20 in order to get a larger address pool as I am running out of available addresses.

    Except for you command, what else would I need to do to my IP range in order to Include the extra odd 3000 addresses. Moving from with a /22 to a /20.

    Post a Reply
    • Other than the above change the subnet mask on your nodes that have static IP addresses.

      Post a Reply

Submit a Comment

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