Flush the DNS cache on Mac

Clear cached DNS lookups when a site resolves to a stale IP address.

macOSDNSDiagnosticsTerminalMedium risk
Run the command below, enter your administrator password when prompted. Cached DNS records are cleared immediately — no restart needed.

01Command

Command
$ sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

02What it does

macOS caches DNS lookups. If a website changed servers and your Mac still remembers the old IP, flushing the cache forces fresh lookups. dscacheutil -flushcache clears the local directory-service cache and SIGHUP tells the mDNSResponder daemon to drop its DNS cache. The command is safe and completes instantly.

03Risk

RiskMedium risk
RequirementsAdministrator password (sudo)
CompatibilitymacOS 10.11 El Capitan – 15 Sequoia
!Warning: Requires sudo. It briefly clears all cached lookups, so the next few website visits may load marginally slower.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2025-11-18 · Category: Network

06Related solutions