This part in the SCCM Lab series will cover installing and configuring the DHCP and DNS Server roles on our headless Windows 2019 server we configured in Part 1. Here we go.
The DNS server was created when AD DS role installed the root forest. We can see that the DNS role is installed using the Get-WindowsFeature command:
Get-WindowsFeature -name "DNS*
As you can see, the DNS Server feature is installed – BUT If your DNS server is not installed, you can install it with this command:
Install-WindowsFeature DNS -IncludeManagementTools
The DNS primary zone is created when the forest is generated. Next, the network ID and file entry is made:
Add-DnsServerPrimaryZone -NetworkID 10.0.1.0/24 -ZoneFile “10.0.1.2.in-addr.arpa.dns”
Next, the forwarder is added:
Add-DnsServerForwarder -IPAddress 8.8.8.8 -PassThru
You should now be able to test your dns server:
Test-DnsServer -IPAddress 10.0.1.2 -ZoneName "sccmlab.net"
That’s it for configuring DNS – now let’s look at the DHCP Server Feature
To do this, you have to set a static IP address on your server. This we covered in Part 1, but if you totally forgot, don’t worry. Set a static IP address like this:
New-NetIPAddress -InterfaceIndex 2 -IPAddress 10.0.1.2 -PrefixLength 24 -DefaultGateway 10.0.1.3
Next, install the DHCP Server Feature.
Install-WindowsFeature DHCP -IncludeManagementTools
After this, a security group is created using the netsh command. The service is then restarted. When the following command is run, the DHCP Administrators and DHCP Users security groups are created in Local Users and Groups on the DHCP server.
netsh dhcp add securitygroups restart-service dhcpserver
Now that the DHCP role and security groups are installed, we need to configure the subnets, scope and exclusions. Configure the DHCP scope for the domain. This will be the addresses that are handed out the to network by DHCP.
AddDhcpServerV4Scope -name "Lab Servers Scope" -StartRange 10.0.1.10 -EndRange 10.0.1.30 -subnetmask 255.255.255.0 -State Active