Flush DNS cache locally on macOS Ventura, Monterey, Big Sur, OSX, Linux and Windows

When URLs are just not resolving the way you want, it may be time to clear or flush the DNS nameserver local cache – enter the relevant command in the Terminal/command line for the macOS operating system you are on.

How to flush the local macOS DNS cache

macOS Ventura 13.0.0

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

macOS Monterey 12.0.0

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

macOS Big Sur 11.0.0

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

macOS Catalina 10.15.0

sudo killall -HUP mDNSResponder

macOS Mojave 10.14.0

sudo killall -HUP mDNSResponder

macOS High Sierra 10.13.0

sudo killall -HUP mDNSResponder

macOS Sierra 10.12.0

sudo killall -HUP mDNSResponder

OSX 10.11.0

sudo killall -HUP mDNSResponder

OSX 10.10.4

sudo killall -HUP mDNSResponder

OSX 10.10.0 – 10.10.3

sudo discoveryutil mdnsflushcache

OSX 10.9 – 10.8 – 10.7

sudo killall -HUP mDNSResponder

OSX 10.5 – 10.6

sudo dscacheutil -flushcache

Windows

ipconfig /flushdns

Linux (depending on what you’re running)

/etc/init.d/named restart
/etc/init.d/nscd restart

Leave all Comment