I can go into the DHCP Admin GUI and change the values on the DNS tab of a reserved lease and see it reflected in netsh with
show reservedoptionvalue <reservedIP>
and see the setting of Option 81 (decimal), but I am unable to programatically SET the value using the expected syntax of
set reservedoptionvalue <reservedID> 81 DWORD 0
receiving the error "The specified option does not exist". It would appear that the value is read-only as far as netsh is concerned. Does anyone know of a solution?
When I try to change this option value at the scope level via NetSH I get this error: The specified option does not exist.
I can see the value using show optionvalue even though it doesn't "exist".
On my test server I tried adding the optiondefinition: NETSH Dhcp Server x.x.x.x Add Optiondef 81 "DNS Settings" DWORD 0 comment="Settings for DNS tab" 0
Once I did that I was able to set the option value via NetSH, and it changes the DNS settings tab as expected. Great!
My only questions are: Are there any unforeseen ill effects to adding the option definition? Why is the option value not available by default?
Although it works, I'm afraid to modify my production servers in this manner. I'd really like to be able to script these settings though.
You can set or retrieve the DNS settings using the command
netsh dhcp server set dnsconfig
netsh dhcp server show dnsconfig
DHCP Server Team
"at the scope level"
It works for me as a server-wide setting, but not for specific reservations, which is what I need. I've scripted the rest of the reservation creation process, but I still have to go into the GUI to uncheck the Dynamic Updates box.
I may look into adding option 81 as AJW suggested, but it would be nice to have a little more info.
The following netsh command would enable name protection for a scope in Dhcp Server :
netsh dhcp server v4 scope <scope_IpAddress> set nameprotection enable=1
The same command is available at global level (i.e. ipv4 context)