How to Setup Dhcp on Windows Server 2016

Most home networks have a router provided by the Internet Service Provider (ISP) to connect to the internet. However, larger organizations or private companies often need more control over their networks. One crucial network service that can be set up on a Windows Server 2016 is the Dynamic Host Configuration Protocol or DHCP for short. DHCP allows a central server to assign IP addresses automatically to clients on a network. This relieves network administrators of the burden of assigning IP addresses to individual clients manually.

This blog post is mainly aimed at network administrators or individuals who want to learn how to set up DHCP on Windows Server 2016. We have included three methods possible to set it up and additional tips to optimize your network.

Video Tutorial:

The Challenge of Setting Up DHCP on Windows Server 2016

Setting up DHCP on Windows Server 2016 requires technical knowledge to configure the server, including the settings for the DHCP scope, the configuration of the router, and the client computers settings. It is also essential to prepare the necessary hardware, software, and network requirements before beginning to set up DHCP.

Things You Should Prepare for

Before proceeding, make sure you have the following:

  • A Windows Server 2016 installed and fully configured
  • At least one network switch or hub
  • A router with a DHCP relay agent or DHCP forwarding capability
  • A range of IP addresses to assign to clients in your network (DHCP scope)
  • Network cables and patch cables
  • A client computer that supports DHCP
  • A user account with administrative privileges for configuring the server

Method 1: Setting Up DHCP on Windows Server 2016 via Server Manager

The first method is setting up DHCP via Server Manager. Here are the steps to follow:

  1. Log in to Windows Server 2016 as an Administrator.
  2. Open Server Manager and click on Add Roles and Features.
  3. Select Role-based or feature-based installation and click Next.
  4. Select the server you wish to configure and click Next.
  5. Scroll down and select DHCP Server from the list and click Next.
  6. Click on Install.
  7. Once the installation is complete, click on Complete DHCP Configuration.
  8. On the DHCP Post-Installation window, select Configure DHCP option.
  9. On the DHCP Configuration window, select Add a DHCP scope and click Next.
  10. Enter the scope name and click Next.
  11. Enter the IP address range of the scope and click Next.
  12. Set up any additional options as required and click Next.
  13. Configure lease duration as per your requirements and click Next to continue.
  14. Add the exclusion range of IP addresses in the scope if necessary.
  15. Configure any DHCP options that your end client devices (example: DNS servers, WINS servers, etc.) might require, and click Next.
  16. Confirm the review screen and click Complete to close the wizard.

Pros:

  • Easily configurable through Server Manager GUI, and suitable for small networks.
  • Automatically configures other DHCP enabled devices in the network.

Cons:

  • May require administrative privileges to configure.
  • Not suitable for larger networks or when extensive customizations are needed.

Method 2: Using PowerShell

If you prefer using PowerShell, follow these steps:

  1. Log in to Windows Server 2016 as an Administrator.
  2. Launch Windows PowerShell as an Administrator.
  3. Use the following command to install the DHCP role on your Windows Server:
    {% now ‘utc’ | rstrip %}Install-WindowsFeature -Name DHCP -IncludeManagementTools
  4. To configure a scope to your DHCP server, use the following command:
    Add-DhcpServerv4Scope -Name “ScopeName” -StartRange “StartIP” -EndRange “EndIP” -SubnetMask “SubnetMask” -LeaseDuration 8.00:00:00
  5. Optional: Add exclusions to your scope with the following command:
    Add-DhcpServerv4ExclusionRange -ScopeId 10.0.0.0 -StartRange 10.0.0.1 -EndRange 10.0.0.25
  6. Configure any other option that may be applicable to your network using:
    Add-DhcpServerv4OptionValue
  7. Type “Y” and hit enter to activate the DHCP scope.
  8. The configuration is complete.
  9. Pros:

    • PowerShell is more extensive and flexible for more advanced configurations.
    • More efficient to set up multiple DHCP servers inside a complex layout.

    Cons:

    • Requires a basic understanding of PowerShell scripting.
    • Not as visually appealing as Server Manager GUI, especially for inexperienced users.

    Method 3: Setting Up DHCP on Windows Server via Command Prompt

    Follow these steps for setting up DHCP via Command Prompt:

    1. Log in to Windows Server 2016 as an Administrator.
    2. Open CMD as an administrator.
    3. Type the following command to install DHCP role:
      dism /online /enable-feature /featurename: DHCP /all /norestart
    4. Type the following command to set up the DHCP scope:
      netsh dhcp add scope 10.0.0.0 “ScopeName”
    5. Type the following command to add a DHCP exclusions chain:
      netsh dhcp server scope add iprange 10.0.0.1 10.0.0.25
    6. Configure any other option that may be applicable to your network using:
      netsh dhcp server scope optionvalue>
    7. Activate the scope and close the window.

    Pros:

    • Quick and straightforward command-line driven DNS configuration
    • Applicable to the networks with DHCP server pre-configured images.

    Cons:

    • Not suited to complex network setups
    • Commands can be challenging for inexperienced users.

    Why Can’t I Set Up DHCP on Windows Server 2016?

    Several reasons might cause a failure to set up DHCP on Windows Server 2016. Here are the most common.

    1. Invalid IP Address or Subnet Mask:

    A valid IP address range is essential to set up a DHCP scope. Ensure that IP address range is correct and is within the subnet range defined by your network.

    Fix:

    Check the DHCP server subnet mask and the client’s subnet mask. Ensure conformity between the two. Also, check the status of other devices configured on your network to see if they are interfering with DHCP.

    2. DHCP Server Not Authorized on the Domain

    DHCP Server’s unauthorized status can prevent it from assigning IP addresses to clients connected on the network.

    Fix:

    Perform AD domain authorization by opening the DHCP console, right-click the DHCP server, and select “Authorize.”

    3. Incorrect Scope Settings:

    DHCP scope settings are specific to a network environment and must be correctly set up to function properly.

    Fix:

    Double-check the scope settings, including IP address range, subnet mask, and the duration of IP address lease.

    Additional Tips

    • Configure a DHCP reservation for fixed IP address assignments that are necessary for your network infrastructure and servers. This eliminates the need to hunt down spreadsheet IP address listings.
    • Group workstations and servers and use different scopes that inherit default gateway, DNS servers, and WINS for different groups.
    • Regularly update DHCP for IP address changes, new subnet creations, and server changes.

    5 FAQs about Setting Up DHCP on Windows Server 2016

    Q1: After installing the DHCP role on Windows Server 2016 via Server Manager, can I configure it to provide a secondary DNS server’s IP address?

    A: Yes, using the Server Manager, open the DHCP console, click DHCP, and then click “Server options.” Next, click “Configure options,” follow the wizard, and enter a secondary DNS IP address.

    Q2: Can I configure DHCP with a failover partner?

    A: Yes, you can configure DHCP with a failover partner, and that feature is available from Windows Server 2012 R2. Also, your DHCP server must be approved in Active Directory and replicating within your domain before checking the box Failover.

    Q3: Does configuring DHCP role over the server eats up many server resources?

    A: No. DHCP services consume very nominal resources on the server if rightly set up.

    Q4: As a best practice, how long should the IP address lease be for a DHCP scope?

    A: The ideal period is eight days or shorter, as this decreases the chances of running out of IP addresses in the lease pool.

    Q5: Can I use Windows Server 2016 and DHCP to manage other vendors client devices?

    A: Yes, DHCP is compatible with various vendors, mainly when using the default DHCP client options and vendor options available on the DHCP server.

    In Conclusion

    Setting up DHCP on Windows Server 2016 is a crucial service that enables automatic IP address configuration and assignment to client devices on your network. In this post, we have seen three methods to set up DHCP on a Windows Server 2016 via Server Manager, PowerShell, and Command Prompt. We have also included the common challenges faced while setting up DHCP and additional tips to optimize your network. By following the instructions mentioned above, you should now have a good understanding of how to set up DHCP on Windows Server 2016 on your own without much difficulty.{“@context”:”https://schema.org”,”@type”:”FAQPage”,”mainEntity”:[{“@type”:”Question”,”name”:” After installing the DHCP role on Windows Server 2016 via Server Manager, can I configure it to provide a secondary DNS server’s IP address?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” Yes, using the Server Manager, open the DHCP console, click DHCP, and then click “Server options.” Next, click “Configure options,” follow the wizard, and enter a secondary DNS IP address.”}},{“@type”:”Question”,”name”:” Can I configure DHCP with a failover partner?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” Yes, you can configure DHCP with a failover partner, and that feature is available from Windows Server 2012 R2. Also, your DHCP server must be approved in Active Directory and replicating within your domain before checking the box Failover.”}},{“@type”:”Question”,”name”:” Does configuring DHCP role over the server eats up many server resources?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” No. DHCP services consume very nominal resources on the server if rightly set up.”}},{“@type”:”Question”,”name”:” As a best practice, how long should the IP address lease be for a DHCP scope?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” The ideal period is eight days or shorter, as this decreases the chances of running out of IP addresses in the lease pool. “}},{“@type”:”Question”,”name”:” Can I use Windows Server 2016 and DHCP to manage other vendors client devices?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” Yes, DHCP is compatible with various vendors, mainly when using the default DHCP client options and vendor options available on the DHCP server.”}}]}