ThorneLabs

Flush DNS Cache on macOS, Linux, or Windows

• Updated April 30, 2023


The various commands to flush the DNS cache on macOS, Linux, or Windows.

macOS

OS X 10.9 Mavericks to macOS 13 Ventura

Flush the DNS cache then reload DNS, in a one-liner:

dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Mac OS X 10.7 Lion and OS X 10.8 Mountain Lion

sudo killall -HUP mDNSResponder

Mac OS X 10.5 Leopard and 10.6 Snow Leopard

sudo dscacheutil -flushcache

Mac OS X 10.4 Tiger

sudo lookupd -flushcache

Linux

Linux distributions using systemd

systemd-resolve --flush-caches

Windows

Windows 10 and Windows 11

ipconfig /flushdns

References