Flush the DNS cache on Mac
Clear cached DNS lookups when a site resolves to a stale IP address.
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 mDNSResponder02What 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
!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
- dscacheutil — directory service cache utilityEvidence: dscacheutil -flushcache clears the directory service cache; mDNSResponder reload resets DNS caching.
- mDNSResponder and DNS cache on modern macOSEvidence: SIGHUP to mDNSResponder flushes its DNS cache on current macOS releases.
Last verified: 2025-11-18 · Category: Network
06Related solutions
Test if a host and port are reachable on Mac
Check TCP connectivity to any server, useful for firewall debugging.
Find which process is using a port on Mac
Identify the app holding port 8080 (or any other port).
Show a saved Wi-Fi password on Mac
Reveal the password of a network your Mac has joined before.