Back to commands

Apple Terminal

Stops processes

Flush macOS DNS Cache

macOS may keep using cached DNS answers after a domain, hosts entry, or local network record changes.

Command

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Before you run this

System impact: Stops matching processes. Can interrupt apps, databases, sync tools, or system services if the PID list is wrong.

When not to use it: Do not treat this as a harmless read-only check. It changes local resolver cache state, may require admin authentication, and will not fix authoritative DNS propagation.

Expected output

Usually no output, though sudo may ask for an administrator password before changing the local DNS cache state.

System impact

Stops processes. The local DNS cache state changes: cached resolver answers are cleared, and mDNSResponder is signaled to reload.

May require elevated permissions on protected paths or service-owned files.

When to use it

Use after DNS changes, hosts file edits, local domain testing, or VPN resolver confusion.

When not to use it

Do not treat this as a harmless read-only check. It changes local resolver cache state, may require admin authentication, and will not fix authoritative DNS propagation.

Recovery / rollback

There is no direct undo for a flushed cache. DNS answers will be cached again naturally as you browse or run lookups.

next steps

Related commands

Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.