Flush DNS overview

Overview #

Operating systems normally cache DNS records, which is good because web sites load faster. The downside of this is that cached records are not updated when the web page changes and becomes inaccessible. However, if DNS has recently changed, it may be necessary to flush the cache on your computer in order to retrieve the new DNS records. What this does is remove the local cache from your system and allow you to grab the most recent cache that your ISP.

Flushing your DNS records is a good idea if your computer has recently had a new domain added or modified. Here are some steps you can take to clear up any resulting DNS resolution issues –

  • Flushing your DNS cache in Windows
  • Flushing your DNS cache in Mac OS X and Linux

Flushing your DNS cache in Windows #

Windows 8 & 10 #

  1. Click the Windows logo while holding the R key at the same time.The run box appears.
  2. In the run box, type cmd and then hit the ‘Enter’ key.
  3. In the command prompt that pops up, enter:C:\Users\username> ipconfig /flushdnsThe command runs and returns to the prompt.
  4. Type exit, and then press the ‘Enter’ key to close the window.

When exiting the Windows command prompt, you may see a pop-up box claiming that Windows “…cannot end the program as it may still be running…” – it’s completely safe (and required) to click the End Now button to exit.

Windows 7 #

  1. Click the Start button, and then type ‘cmd’ in the search bar (where it says ‘search for programs and files’).
  2. In the command prompt that pops up, enter:C:\Users\username> ipconfig /flushdns
  3. Press the ‘Enter’ key, and then repeat the process two more times.
  4. Type exit, and then press the ‘Enter’ key to close the window.

Flushing your DNS cache in Mac OS X and Linux

The commands to flush cache in OS X are slightly different depending on the version you’re running. First, make sure you’ve opened up your terminal on your computer.

  • SSH client software

Once opened, run the command below that corresponds to your version of OS X.

OS X 10.12 (Sierra) and later #

macbook$ sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache

OS X 10.11 (El Capitan) and OS X 10.12 (Sierra) #

macbook$ sudo killall -HUP mDNSResponder

Older versions #

OS X 10.10 (Yosemite) #

Versions 10.10.4+ #

macbook$ sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder

Versions 10.10.1, 10.10.2, 10.10.3 #

macbook$ sudo discoveryutil udnsflushcaches

OS X 10.9 (Mavericks) #

macbook$ dscacheutil -flushcache; sudo killall -HUP mDNSResponder

OS X 10.7 (Lion) and 10.8 (Mountain Lion) #

macbook$ sudo killall -HUP mDNSResponder

OS X 10.5 (Leopard) and 10.6 (Snow Leopard) #

macbook$ dscacheutil -flushcache

OS X 10.4 (Tiger) #

macbook$ lookupd -flushcache

Flushing your DNS cache in Linux #

Most current Linux distributions do not use a DNS resolver cache in the same way that Windows and Mac OS X use. To confirm which particular daemon is installed for your Linux distribution, check the website or its forum pages.

However, a common DNS caching application sometimes used is the Name Service Caching Daemon (nscd). It’s most likely not installed by default so there is no need to flush the cache. But, if you’ve already installed it you can flush the cache by running the following command in a terminal:

[local]$ sudo service nscd restart

Alternatively, you can try these commands:

[local]$ /etc/rc.d/init.d/nscd stop [local]$ /etc/rc.d/init.d/nscd start

Additional suggestions #

  • Any open browser windows will continue to read from the previous cache that was loaded into memory, so be sure they are all closed. Restart the browser after that, then try to view your website. You should be able to view your website online after giving it some time (usually a couple of hours). If not, it’s quite probable that your ISP hasn’t changed its DNS cache; there is no way to go around this without making some hosts file changes.
  • Alternative: You can manually contact a third-party DNS server, such OpenDNS, to update any domain’s cache by visiting their website. You must manually update your computer’s configuration in order for this to operate; keep in mind that in some business settings, using a third-party DNS server may not be possible or advised.
  • DNS modifications could take up to 72 hours to finish. Contact help via the Contact Support page if you discover your website isn’t functioning after that point.

Leave a Reply

Your email address will not be published.