Flush Local DNS Cache

DNS resolves domain names to IP addresses so people do not have to remember the IP addresses when they want to visit a webpage. In simple words it is the Internet’s phone book.

In order the speed up this process and reduce the traffic on the DNS servers, most computer operating systems will store or cache DNS lookups on your computer locally. There are a few times though you may need to clear the cache to see changes. In this tutorial, I will show you how to clear or flush local DNS cache for the major operating systems on the market. So let’s get started.

Flushing Local DNS Cache in Windows

Windows 98/NT/2000/XP

  • Open Command Prompt by clicking Start\Run (alternatively press Windows Key + R), type CMD and hit enter or the OK button;
  • Once the command line window is open type the command:
ipconfig /flushdns

If it was successfully flushed you will see the below message:
Successfully flushed the DNS Resolver Cache.

Windows Vista/7, 8 and 10

  • Open Command Prompt by clicking Start and type CMD into the start menu search field (alternatively press Windows Key + R), type CMD and hit enter or the OK button (make sure you have admin access);
  • Once the command line window is open type the command:
ipconfig /flushdns

If it was successfully flushed you will see the below message:
Successfully flushed the DNS Resolver Cache.

Flushing Local DNS Cache in Mac OS X

Yosemite

If you are running Mac OS X 10.10, you need to do the following:

  • Open up the command terminal;
  • Run the command:
sudo discoveryutil udnsflushcaches

Lion, Mountain Lion, Mavericks

If you are running Mac OS X 10.7, 10.8 or 10.9, you need to do the following:

  • Open up the command terminal;
  • Run the command:
sudo killall -HUP mDNSResponder

Snow Leopard

If you are running Mac OS X 10.6, you need to do the following:

  • Open up a command terminal;
  • Run the command:
sudo dscacheutil -flushcache

Leopard and below

If you are running Mac OS X 10.5.1 or below, you need to do the following:

  • Open a command terminal:
  • Run the command:
sudo lookupd -flushcache

Flushing Local DNS Cache in Linux

With the various distributions of Linux, you will find that by some run a daemon in the background to manage DNS cache, while others do not. Ubuntu is a good example of a distribution that doesn’t run this daemon by default.

If you are running the nscd Name Service Cache Daemon then you will need to do the following:

  • Open up a command terminal (make sure you run it as root)
  • Run the command:
sudo /etc/init.d/nscd restart

Note: If you are not running nscd Name Service Cache Daemon then you you have to install it using the following command:

sudo apt-get install nscd

Please leave your comments below with your thoughts or alternative methods.

Nik

Experienced IT Consultant working and living in the UK. In early years he was born and raised up in Greece and been to the UK since studies. He is passionate with technology, gadgets and computers, he really likes the internet and IT in general.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *