The solution to Flush DNS cache locally in macOS Mojave, Sierra, OSX, Linux and Windows

The solution to Flush DNS cache locally in macOS Mojave, Sierra, OSX, Linux and Windows
0

This post will help you clear the DNS cache locally in multiple operating systems like macOS Mojave, High Sierra, Sierra, Mavericks, Yosemite, … Linux and Windows. If you are struggling with the problem that URLs are not working as you desire and you want to flush the DNS nameserver local cache, you have just arrived the right post.

How to flush the local DNS cache

To do this you need to launch your terminal and then enter the command line corresponding to each operating system.

macOS Mojave 10.14.0

sudo killall -HUP mDNSResponder;say DNS cache has been flushed

or

sudo killall -HUP mDNSResponder, sleep 2, echo macOS DNS Cache Reset | say

macOS High Sierra 10.13.0

sudo killall -HUP mDNSResponder;say DNS cache has been flushed

macOS Sierra 10.12.0

sudo killall -HUP mDNSResponder;say DNS cache has been flushed

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