Clear the DNS Cache on Windows
Empties the DNS client cache. Use it when a site resolves to the wrong IP or a DNS record has just changed.
- Windows18
- macOS5
- Linux5
- Network3
- Disk and storage4
- Inventory4
- Security9
- Updates4
- Maintenance4
Script
Clear-DnsClientCache
$remaining = (Get-DnsClientCache -ErrorAction SilentlyContinue | Measure-Object).Count
Write-Output "DNS cache cleared. Entries now: $remaining"Run it on every device with Moftgate
- 01
Add the script
In the Moftgate console, open Scripts > New script and paste the code.
- 02
Select the OS
Select Windows as the target operating system.
- 03
Test it
Run it on one test device first and read the output.
- 04
Roll out
Send it to all targets by group, profile or tag. Each device result is recorded separately.
These may help too
Reset the Windows Network Stack (Winsock and TCP/IP)
Resets the Winsock catalog and TCP/IP settings. Use it when the device cannot connect after a broken VPN or proxy install. A restart is required.
Windows · PowerShellWindows Disk Space Report
Lists size, free space and free percent for all local disks. Flags disks below 10% free.
Windows · PowerShellClean Up Temporary Files on Windows
Deletes files older than 7 days in the Windows Temp folder and every user's Temp folder. Reports the space recovered.
Manage scripts from one console
Target selection, a confirmation step, per-device output and an audit log. The first 200 endpoints are free for a year.