macOS Networking

Flush DNS cache on macOS

Clear stale DNS on Mac after resolver changes or flaky site loads.

6 min read Beginner Updated 9 Jun 2026

Step-by-step guide

Work through each section in order. Stop when your issue is resolved — you do not need every step for every situation.

Warning

Create a Time Machine backup before major updates, disk operations, or security changes on macOS.

What you will achieve

Clear stale DNS on Mac after resolver changes or flaky site loads.

1) Flush DNS cache

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

2) Verify resolver behaviour

scutil --dns | grep 'nameserver\[[0-9]\]'

3) Re-test affected domains

Open the previously failing site and check whether stale records are gone.

Related guides

dns macos network