In my previous post on “DHCP” article series, we had configure the “DHCP Scope” for DHCP server. Now it is time to set the “Sever Options” for the DHCP server.
We are going to set the below server options.
Setting Server Options
We have to use the “Set-DhcpServerv4OptionValue” cmdlet to set server options for the DHCP Server. In this cmdlet we have to use the “OptionID” and it’s “Value” parameters mainly.
Open DHCP manager from tools and you can see that there is no “Server Options” are configured yet.
Run, “ipconfig /all” on client machine and you can see, there is NO entries for, Gateway, Connection specific DNS Suffix and DNS Server ..
Setting DNS Server
Let’s set the DNS Server option first, the OptionID for DNS server is 6 , I am setting , 22.214.171.124 as a DNS Server.
Set-DhcpServerv4OptionValue -OptionId 6 -Value 126.96.36.199
You can also set multiple DNS server by providing multiple comma separated values.
Set-DhcpServerv4OptionValue -OptionId 6 -Value 188.8.131.52 , 184.108.40.206 , 220.127.116.11
The option ID for gateway is 3, I am setting the value 192.168.1.99 as a gateway address.
Set-DhcpServerv4OptionValue -OptionId 3 -Value 192.168.1.66
Setting DNS Suffix
The OptionID for DNS Suffix is 15
I am setting my website domain name a DNS suffix.
Now open DHCP server manager and click on “Server Options” and you will see all of our entries which we configured and set by PowerShell are there.
It’s time to test the configuration, Now, do the following on your client machine
1. Run “Ipconfig /release”
2. Run “Ipconfig /renew”
3. Run “Ipconfig /all”
Here you go, you can see all of our configured setting there.
That’s all for now. See you in my next blog article.