How often have you needed to clear the DNS server cache?
Regardless how many domain controllers in your environment, a few simple lines of PowerShell can clear the cache on all of them.
First, we need to get the name of the domain. Of course, if you already know the name, you can simply use it.
|
|
Next, we find all name servers in the domain and show only the hostname.
|
|
Lastly, we execute the clear command for each one.
|
|
Of course, there are a few shortcuts you can do to get this to a one-liner.
|
|
For more information, please see the following Microsoft docs:
Have a great day!