How to clear the DNS Cache?

Overview

This article provides instructions on how to clear the DNS Cache on a computers and web browsers. This procedure is necessary in order for previously cached resolutions to be cleared out and subsequent lookup to be performed based on newly configured DNS settings.

Solution

The following tables provide instructions for clearing the DNS cache on computers and servers. The commands need to be run at the command prompt with administrator privileges.

Windows 7 and Earlier

Click the Start Menu

Go to All Programs

Choose Accessories and right-click Command Prompt

Choose Run as Administrator

Run the following command in the command line and hit enter

ipconfig /flushdns

Windows 8

Press the Windows Key or hover your mouse over the bottom left corner and click the Windows Icon

Begin typing Command Prompt

Right-click the application and select Run as Administrator

Run the following command in the command line and hit enter

ipconfig /flushdns

OS X 10.4 TIGER

Click the Terminal icon in the dock or in Finder under Application/Utilities/Terminal

Run the following command in the command line and hit enter

lookupd -flushcache

OS X 10.5 and 10.6 LEOPARD

Click the Terminal icon in the dock or in Finder under Application/Utilities/Terminal

Run the following command in the command line and hit enter

dscacheutil -flushcache

OS X 10.7 and 10.8 Lion

Click the Terminal icon in the dock or in Finder under Application/Utilities/Terminal

sudo killall -HUP mDNSResponder

OS X 10.9 and 10.10.4 Yosemite, 10.11 El Capitan and 10.12 Sierra

Click the Terminal icon in the dock or in Finder under Application/Utilities/Terminal

sudo dscacheutil -flushcachesudo killall -HUP mDNSResponder

Linux (most distributions)

Open a terminal window (gnome-terminal, konsole, xterm, etc)

sudo /etc/init.d/nscd restart

or

sudo /etc/init.d/nscd restart

Ubuntu Linux

Open a terminal window

Run the following command in the command line and hit enter

sudo service network-manager restart

Clearing the DNS Cache on Browsers

If you have recently set up your filtering, or just changed a setting, a cache clear may be necessary before you see your filtering take effect.

The following table provides instructions for clearing the DNS cache within common Internet browsers.

Browser

Steps to clear the DNS Cache

Internet Explorer 8 and above (Windows)

Go to the History menu, select Delete Browsing History, check all boxes (except passwords, if desired) and click Delete.

Mozilla Firefox (Windows)

Click on Firefox at the top left of your browser, go to the History menu, select Clear Recent History and check all boxes. Under Time range to clear select Everything (except passwords, if desired) and click Clear Now.

Apple Safari (Mac)

Expand the Cog Icon in the upper right corner and select Reset Safari. Check all boxes and click Reset.

Expand the Wrench Icon in the upper right corner and select History and check all boxes. Under Clear data for this time period, select Everything(except passwords, if desired) and click Clear Browsing Data.

Google Chrome (Mac)

Under Go to the Chrome menu, select Clear Browsing Data and check all boxes (except passwords, if desired). Under Clear data for this time period, selectEverythingand click Clear Browsing Data.