Flush the DNS Cache on macOS
Flushes the dscacheutil cache and reloads mDNSResponder. Requires root.
- Windows18
- macOS5
- Linux5
- Network3
- Disk and storage4
- Inventory4
- Security9
- Updates4
- Maintenance4
Script
#!/bin/bash
dscacheutil -flushcache
killall -HUP mDNSResponder
echo "DNS cache flushed"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 macOS 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
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.
Windows · PowerShellReset 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.
macOS · BashCheck FileVault Status on macOS
Checks whether FileVault disk encryption is on. Exits with an error if it is off.
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.