Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Update DNS server IP addresses remotely using PDQ?

We have two DNS servers with static IPs of, for example, 10.100.125.10 and 10.100.125.11.  The .10 IP is the primary DNS server and .11 is the secondary server.  These are set on approximately 300 client PCs.

We need to change the primary IP from 10.100.125.10 to 10.105.10.10 and secondary to 10.105.10.11.

Is there a way to:

1) create a PDQ Inventory collection that includes all clients that have 10.100.125.10 as the primary DNS server (so we can preview which clients need to be changed, prior to changing them).
2) run a powershell script launched from PDQ Inventory that will change the primary DNS server on each of those clients in the collection to 10.105.10.10?

 

0

Comments

1 comment
Date Votes
  • Modify as necessary but i use the 2 following and use 'Run Command' in Inventory then assign groups. Use the scanner profile to review them before changing them, run a report after scanning.

     

    Scanner profile is a powershell scanner 'DNS Addresses'

    • Get-DnsClientServerAddress | Select ServerAddresses -ExpandProperty ServerAddresses

     

    The inventory group 'Old DNS Servers'

    • Powershell (DNS Addresses) String Contains 172.16.1

     

    The 2 commands i run depending on the PCs

    • Get-DnsClientServerAddress | Where-Object ServerAddresses -like '172.16.1*'| Set-DnsClientServerAddress -ServerAddresses 172.x.x.10,172.x.x.11
    • Get-NetIPAddress | Where-Object suffixorigin -eq Manual | Get-dnsclientserveraddress | Where-Object {($_.ServerAddresses -like '*172.16.1*') -and ($_.AddressFamily -eq '2')} | Set-DnsClientServerAddress -ServerAddresses 172.x.x.10,172.x.x.11

    Once i was confident in the operations i have a heartbeat schedule targeting the rest. Have migrated ~1500 endpoints so far.

    0