3

Our environment has approximately 15 Domain Controllers that also provide DHCP functionality to their networks. We have discovered several to have incorrect DNS settings. Their are providing incorrect DNS servers for the secondary DNS. Recently we had to bring the main DNS server down for maintenance, so now PCs at some locations cannot resolve addresses correctly.

Is their a way to set DHCP via GPO?

To clarify I do not want to set the client settings. I want to set the DHCP Scope Options on the servers via GPO. So that way they provide correct DNS Servers when they issue leases.

0

1 Answer 1

2

You can deploy batch script over GPO to DHCP servers that will change DNS settings in DHCP scope using netsh utility.

A command to set DNS servers in scope with netsh is:

netsh dhcp server DHCP_server_IP_or_Hostname scope Scope_Network set optionvalue 006 IPADDRESS DNS1_IP DNS2_IP

If 10.10.10.1 is primary DNS, and 10.10.10.2 is secondary DNS, and 10.10.10.0 is DHCP scope, you would basically just need to run the following command on every DHCP server:

netsh dhcp server localhost scope 10.10.10.0 set optionvalue 006 IPADDRESS 10.10.10.10 10.10.10.2

Netsh commands for DHCP, TechNet article

Using netsh, TechNet article

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .