Forums/OpenDNS Community/Troubleshooting and Support

Clearing the DNS Cache on Computers and Servers

Chris Frost
posted this on Feb 01 12:48

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

Please add any additions, corrections, updates or suggestions to the comments on this article to better help the community.

 

Operating System    To get to the Command Prompt/Terminal   

Command to use to clear DNS Cache at the Command Prompt/Terminal

         
Windows   Go to Start Menu > Run > Type "cmd" > press Enter/Return  

 

ipconfig /flushdns

 

         
Mac OSX 10.4 (Tiger)   Click the Terminal icon in the dock or in Finder (in /Applications/Utilities/)  

 

lookupd -flushcache

 

         
Mac OSX 10.5 & 10.6 (Leopards)   Click the Terminal icon in the dock or in Finder (in /Applications/Utilities/)  

 

dscacheutil -flushcache

         
Mac OSX 10.7 & 10.8 (Lions)   Click the Terminal icon in the dock or in Finder (in /Applications/Utilities/)
 

 

sudo killall -HUP mDNSResponder

 

         
Mac OSX 10.9  (Mavericks)   Click the Terminal icon in the dock or in Finder (in /Applications/Utilities/)  

dscacheutil -flushcache;sudo 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/networking restart 

 

         
         
         

 

 

 

 

 

Comments

User photo
vasinc

Didn't seem to work with Mavricks

February 11, 2014 06:20
User photo
Kristy Patullo
OpenDNS

Thanks for pointing this out.  The latest version of OS X requires the following commands entered in the Terminal in order to flush the DNS cache:

Enter this command:

dscacheutil -flushcache

Then, to reload DNS type this command:

sudo killall -HUP mDNSResponder
February 11, 2014 08:48
User photo
island123

Didn't seem to work for me with Mavricks also. Did both commands - it asks for a password in terminal

February 13, 2014 12:04
User photo
Kristy Patullo
OpenDNS

These commands must require administrative authority to run in terminal on your device.  If you are the administrator of your device enter your keychain password.

February 13, 2014 12:36
User photo
sryokan

dscacheutil -flushcache;sudo killall -HUP mDNSResponder

same as above but in a single string. 

February 18, 2014 22:34
User photo
icevirg

This part worked just like your instructions & illustrations indicated!! Now to purge my web browser caches. ;)

February 19, 2014 13:34
User photo
drrdm

I tried the instructions for Mavericks, but when I get to the password request, the terminal won't respond to the keyboard. I type, but nothing shows, so I can't enter my password.

February 22, 2014 09:49
User photo
rotblitz

What do the Apple support forums say?  Here are the OpenDNS experts, the Apple experts are somewhere else.

February 23, 2014 05:58
User photo
paul

When you type, the Mac will see your password, even if you can't. Trust that you can type the correct password and hit enter. Voila.

February 24, 2014 19:49
User photo
patechmanager

This advice needs major revisions

a) add support for Mac os 10.9

b) Delete the picture

c) Add text examples that can copy and paste

ps: THe picture does not allow me to copy/paste into a terminal.  

 

February 26, 2014 16:09
User photo
skylar_l

@island123 and drrdm:

Mac OS X and I'm pretty sure Linux requires you to enter in the administrator (or Keychain) password to perform this action. When you type in the password, it will NOT show any dots or text (This is a security measure). Just press Enter/Return once you have finished typing it.

As for Windows Vista, Seven, and Eight: After typing cmd into the search, you need to right click on cmd.exe and click "Run as Administrator"; Then type in "ipconfig /flushdns".

February 26, 2014 19:36
User photo
mattp1
OpenDNS

Hi all,

Thanks for the feedback, and apologies for the delay in the corrections/updates.  The feedback is greatly appreciated, please let us continue to update this as required, as new operating systems or instructions become available.

Best regards,

Matt

March 14, 2014 09:32
User photo
patechmanager

Fixed.  Thanks for adding text we can copy and paste.   And thanks for adding OSX 9 command.   Just needed this again today.   It' so easy to google this, then bingo, copy and paste to flush.        We have a lot of educational apps that only work after flushing the DNS cache.   

March 14, 2014 11:30
User photo
bcrouch5

My windows isn't working I input - ipconfig /flushdns

and I get the following error message: The reqested operation requires elevation.

What does that mean and what's the next step?

Thanks

bcrouch5

 

March 29, 2014 12:38
User photo
skylar_l

@bcrouch- Quite literally three comments up, I explained that you have to right click on cmd, then click "Run as administrator".

March 29, 2014 13:30
User photo
jtorres

I take it Windows Server 2012 is very similar to 2008, but is there anything additional that would need to happen after the forwarders are entered and the ipconfig /flushdns is ran as an admin on the server?

April 01, 2014 10:22
User photo
rotblitz

No.

April 01, 2014 23:23
User photo
ramirgl

I'm having the same problem.  Running Vista.  After typing cmd in the run menu, the C:\Windows\system32\cmd.exe dialogue box pops up.  I enter ipconfig/flushdns and am told that "the requested operation requires elevation".  I have tried to right click as was suggested above to select "Run as administrator", but that is not an option when I right-click.  I only have the dialogue box properties if I click on the box heading, or "Mark, Paste, Select All, Scroll, Find" if I right click in the box field.  Any advice would be greatly appreciated.  Thanks.

April 02, 2014 08:46
User photo
rotblitz

Start > All Programs > Accessories > Right-click "Command Prompt" > Run as Administrator

(Hoping you don't drive a car with the same skill level for cars. :shocked:)

April 02, 2014 09:02
User photo
patechmanager

This is my attempt to help bcrouch5 and ramirgl.

The failure with "ipconfig" command on your computer is due to security restrictions on your account or computer.  Most likely your computer was purchased and setup by another person with the privileges to maintain the computer.   This is a protection mechanism to keep novice users from  harming their own computer.  

Your windows computer has several user accounts and you are using an account that does not have the security privileges that are needed to run "ipconfig".      Right click "run as admin" will fail until you logout and logon as an admin user. 

solutions:  

a) avoid using ipconfig and istead  reboot.   Just reboot the phone, ipad, tablet, or computer.  In most cases a full restart will flush the DNS cache.   

b) call a friend who knows windows and networking and can help you and explain this

b) Use another account on your computer and then use ipconfig.   Go to your control panel , then users, and you should see 2 or more user accounts.    

Do not use an account with "standard user"

Do use an account with "administrator"

note: using ipconfig is a job that requires a lot of networking background and knowledge.   The 2nd sentence written by Chris Frost states that you need administrator privileges.      What is also implied is that you need administrator skills and training.  

April 02, 2014 09:35
User photo
notfalse

For Ubuntu it is: sudo service network-manager restart

April 03, 2014 13:49
User photo
philp777

Ok, so I reset the setting for DNS and then went to the Start menu and entered "cmd" and then pressed "Enter" and a black window came up and a chill went down my spine. 

Presumably that black window is the Command Prompt/Terminal where it tells you things about Miccrosoft and says "C:UsersPhillip>"

So I typed in "ipconfig /flushdns" and it thought about that and said "The requested Operation Requires Elevation" so I took my PC onto the roof but it made no difference!

Have I gone wrong somewhere?

Please advise,

Phil

April 10, 2014 07:28
User photo
rotblitz

"went to the Start menu and entered "cmd" and then pressed "Enter""

This was wrong.  Proceed as I have described in my previous answer to get to the elevated prompt.

Better copying & pasting it to here for your convenience:

Start > All Programs > Accessories > Right-click "Command Prompt" > Select "Run as Administrator"

April 10, 2014 10:06
User photo
mixelixx

@notfalse - Thanks for the Ubuntu info. Works for Lubuntu.

April 15, 2014 11:52
User photo
armpit44

Anyone know how to flush Safari?

April 18, 2014 19:19
User photo
rotblitz

You flush the website cache from the tools icon.

April 19, 2014 05:58
User photo
rotblitz
April 19, 2014 06:00