DNS, or the Domain Name System, resolves domain names to IP addresses so you don't have to remember IP addresses for every website you want to visit. In order the speed up this process and reduce DNS server traffic, most operating systems will store or cache DNS look-ups on your computer.
If you find your domain is resolving to an incorrect server when accessed from your computer, particularly after a DNS change has had time to propagate, it is likely due to DNS caching. Here we cover the steps to clear, or flush, your DNS cache on Windows, Mac, and Linux.
Related Articles
Create a hosts File Modification
Windows
- Click the Start menu and type cmd
- Open the command prompt from the search results
- Enter the following into the command prompt
ipconfig /flushdns
- Press the Enter key
Mac
- Press Command+Space to open Spotlight
- Type Terminal and click Terminal from the search results
- Enter one of the following into the command prompt, based on which Mac OS version you are running, then press the Enter key
- macOS 10.15 (Catalina), macOS 11 (Big Sur), macOS 12 (Monterey), macOS 13 (Ventura)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- OS X 10.11 (El Capitan), MacOS 10.12 (Sierra), MacOS 10.13 (High Sierra), MacOS 10.14 (Mojave)
sudo killall -HUP mDNSResponder
- OS X 10.10 (Yosemite)
-
10.10.4+
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
-
10.10.1, 10.10.2, 10.10.3
sudo discoveryutil udnsflushcaches
-
- Mac OS X 10.7 (Lion), OS X 10.8 (Mountain Lion), OS X 10.9 (Mavericks)
sudo killall -HUP mDNSResponder
- Mac OS X 10.6 (Snow Leopard)
sudo dscacheutil -flushcache
- Mac OS X 10.5 (Leopard)
sudo lookupd -flushcache
- Mac OS X 10.4 (Tiger)
lookupd -flushcache
- macOS 10.15 (Catalina), macOS 11 (Big Sur), macOS 12 (Monterey), macOS 13 (Ventura)
- Press the Enter key
- Enter your Mac's password when prompted and press the Enter key
NOTE: Nothing will be displayed when typing the password. This is normal and expected bahavior. - If the process was successful, you'll be returned to a new command line prompt, no output will be shown
Linux
NOTE: Most Linux distributions do not use a DNS resolver cache. Refer to the documentation for your particular distrubution to confirm. However a common DNS caching application sometimes used is NSCD (Name Service Caching Daemon). It's generally not installed by default so there is no need to clear the cache, but if you have installed it or it's included in your distrubution, follow the below steps to clear it.
- Open a Terminal session
- Enter the following into the command prompt and press the Enter key
sudo service nscd restart