Changing primary and secondary DNS via GPO

Jeffrey Pascone 11 Reputation points
2023-05-08T15:35:11.7833333+00:00

Hi,

I am trying to change the primary and secondary DNS servers on all of my servers. I notice the GPO object states it is for Windows XP only.

I have tried running the following command but the primary DNS does not change. This is on my workstation.

netsh set dns "Ethernet adapter Ethernet 4" static 10.10.10.10 primary

Any ideas how I can change the primary and secondary DNS servers via GPO?

Thanks!

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,863 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,011 Reputation points
    2023-05-09T14:51:14.6566667+00:00

    Hi,

    I'd be happy to help you out with your question. Sorry for the inconvenience caused.

    To accomplish this task, follow the steps below:

    1. On a domain controller or a computer with Remote Server Administration Tools (RSAT) installed, open the Group Policy Management Console.
    2. Create a new GPO or select an existing GPO that you want to modify for this purpose.
    3. Within the GPO Editor, navigate to the following path: Computer Configuration → Policies → Windows Settings → Security Settings → Network List Manager Policies.
    4. In the right pane, locate and double-click on the network connection type that applies to your servers, such as "All Networks" or "Domain Networks."
    5. The Network List Manager Policies dialog box will open. Switch to the "Name" tab and find the network connection name that corresponds to your servers.
    6. Right-click on the network connection name and select "Properties" from the context menu.
    7. In the connection properties dialog box, go to the "DNS Servers" tab.
    8. Choose the option labeled "Specify DNS Server addresses."
    9. Now, enter the desired DNS server addresses in the "Primary DNS server" and "Secondary DNS server" fields.
    10. Save the changes by clicking "OK."
    11. Apply the GPO to the appropriate organizational units (OUs) that contain your servers.

    After the GPO is applied, your servers will receive the updated DNS server settings. Please note that it may take some time for Group Policy settings to propagate to all the affected servers.

    For more Information, please refer to following resources :-

    Changing Primary DNS Entry via Group Policy - https://social.technet.microsoft.com/Forums/lync/en-US/acee1483-160a-46f6-9a3b-9b109d1fc0d2/changing-primary-dns-entry-via-group-policy?forum=winserverDS

    If you have any other questions or need assistance with anything, please don't hesitate to let me know. I'm here to help.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.