Changing DNS

From the research I've done, I know that this is a limitation of what NIC settings can be controled via GPO. One of those challenges is changing the Primary and Secondary DNS servers.

We are a static IP assignment enviroment. What solutions if any (including 3rd party software) are available that would allow us to change the DNS servers automatically rather than having to manually touch each PC to change these settings?

Who is Participating?
Leon FesterSenior Solutions ArchitectCommented:
You mention the reservation is booked on your MAC address, but is it booked on your IP address?
NOTE: Creating a reservation does not remove the possibilty that a hard coded IP addresses could clash on your network.

Run nslookup <<ip_address>> to check the DNS records for that workstation.
You can check the name of that server/workstation directly by doing the following.
1. Connect to the network, without the conflict.
2. Use the runas functionality to launch a command prompt as a domain admin.
(Keep down shift, and right-click Command Prompt and select "Run as different user" and enter your domain admin or remote admin credentials.)
3 When your command prompt opens type:
wmic /node:<<ip_address>> computersystem get name
- This should give you the computer name if you admin account has permissions on this workstation.
wmic /node:<<ip_address>> computersystem get username
- Will return the username of the currently logged on user.
do you have a domain controller on your network. if so, might be worth implementing a DHCP server and creating reservations for each machine. Could be time consuming dependent on how many machines you have.
tgarrityAuthor Commented:
yes, the domain controllers are here on sight. Thanks for bringing up that point about DHCP. I haven't considered that yet.

On-Demand: Securing Your Wi-Fi for Summer Travel

Traveling this summer?Check out our on-demand webinar to learn about the importance of Wi-Fi security and 3 easy measures you can start taking immediately to protect your private data while using public Wi-Fi. Follow us today to learn more!

RartemassService Desk AnalystCommented:
The DNS entries are in the registry here:

You can create a registry file with the changes and then deploy it to all computers via policy, logon script, batch job or various other methods.
Probably the best option is to make the changes on a single computer via the network options. Then in regedit go to the above key and export (right click on Parameters key and click export). Save this as a .reg file that can be deployed to every PC on the domain (excluding servers).
Here is a vb script I made for another person to update TCP/IP settings.

You can adapt it for your need.  Just remove extra settings, or put what you need.

You can probably use a GPO to run it on machines.  You need to edit the popup messages for your purpose - remove them so the script does not pause for a repsonse.

It searches the adapters on the PC and pops up the name, the user selects which adaptor they want to change.  You can change the search so that it only changes the adapater you need to change (in case there are more than 1 in the PC).

strComputer = "."
Const DEFAULT = 0
Const ENABLED = 1
Const DISABLED = 2

arrDNSServerSearchOrder = Array("", "", "", "")
arrDNSDomainSuffixSearchOrder = Array("", "", "", "", "", "", "", "", "")
strWINSPrimaryServer = ""
strWINSSecondaryServer = ""

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objWMIService2 = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set nics = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

Set nics2 = objWMIService2.ExecQuery("Select * from Win32_NetworkAdapter")

For Each adaptr in nics2
     nicName = adaptr.NetConnectionID
     if Left(NicName ,1)<> "" Then
       Answer = MsgBox("Set this NIC adaptr?" & nicName ,4)
       if Answer = vbYes then
        MsgBox ("Configuring adaptr : " & nicName)
        For Each nic In nics
            if nic.MACAddress = adaptr.MacAddress then
              nic.SetWINSServer strWINSPrimaryServer, strWINSSecondaryServer
              Set nicClass = objWMIService.Get(nic.Path_.class)
           end if
       end if
     end if
tgarrityAuthor Commented:
Not too sure what's going on here but here's the problem.
I installed the DHCP role on our Windows 2008 R2 domain controller.
I defined the scope and set a reservation for just my IP (for testing purposes)
As soon as I release my static IP address on my PC using command prompt, I get an error message stating there is an IP conflict on the network.

This doesn't make sense A) we are a staic IP enviroment B) I created a reservation for my PC using the MAC address on my NIC

Any ideas?
RartemassService Desk AnalystCommented:
Remove the reservation on the server and set the PC to obtain IP automatically.
Ensure the scope of the DHCP server does not include the range of current static IP addresses.
For example if the highest IP address is, start the DHCP scope at
This will avoid conflicts.
Then once your PC gets an IP from the server, you can reserve it again. This should avoid any conflicts.

Once that is done you can change each PC to dynamic IP one at a time. I'd reserve the IP on the server (in the above listed scope) then change the PC to dynamic.
Once all PCs are done you can extend the scope if you wish.
If you want to keep the existing IP addresses, then you should change all PCs to DHCP first, then set the scope on the server, then reserve the same IP from before.
Please let me know if I lost you with the above.
In the DHCP service on DHCP Properties Advanced Tab, have you tried changing the Conflict Detection attempts to 1 or 2 ?
tgarrityAuthor Commented:

Thank you for your reply, but this did not solve the problem.
Could it be that DHCP needs to be turned on our Cisco router or even on our HP ProCurve switch?
tgarrityAuthor Commented:
Set to 2 attempts
RartemassService Desk AnalystCommented:
Could it be that DHCP needs to be turned on our Cisco router or even on our HP ProCurve switch?

You only want one server/device providing the IP address on a network. As long as the PCs can reach the device that is acting as a DHCP server, then it should obtain the address. As it appears you are getting an IP address from the server, this isn't the problem.

Have you searched for the conflict as dvt_localboy suggested?
tgarrityAuthor Commented:
I will do so and submit my findings. Thanks for the assistance.
tgarrityAuthor Commented:
Sorry, didnt get a chance to do this today. Will test tomorrow. Thanks
tgarrityAuthor Commented:
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.