How to flush DNS cache in Linux / Windows / Mac

Flush dns to get a new name resolution. Also flush dns cache when you can’t access a newly registered domain name. You can simply flush your dns cache anytime to get new entry. So, Flush your dns cache now.
To flush DNS cache in Microsoft Windows (Win XP, Win ME, Win 2000):-
- Start -> Run -> type cmd
- in command prompt, type ipconfig /flushdns
- Done! You Window DNS cache has just been flush.
To flush the DNS cache in Linux, restart the nscd daemon:-
- To restart the nscd daemon, type /etc/rc.d/init.d/nscd restart in your terminal
- Once you run the command your linux DNS cache will flush.
To flush the DNS cache in Mac OS X Leopard:-
- type lookupd -flushcache in your terminal to flush the DNS resolver cache.
ex: bash-2.05a$ lookupd -flushcache
- Once you run the command your DNS cache (in Mac OS X) will flush.
To flush the DNS cache in Mac OS X:-
- type dscacheutil -flushcache in your terminal to flush the DNS resolver cache.
ex: bash-2.05a$ dscacheutil -flushcache
- Once you run the command your DNS cache (in Mac OS X Leopard) will flush.
Posted at September 28th, 2006 by chua
If you think this article helps you to solve your problem and clear your headache, feel free to buy me a drink :)

February 9th, 2007 at 11:57 pm
On my Debian machine, the nscd daemon is not installed by default. (/etc/rc.d/init.d/nscd missing)
Description:
A daemon which handles passwd, group and host lookups
for running programs and caches the results for the next
query. You should install this package only if you use
slow Services like LDAP, NIS or NIS+
So i think “/etc/init.d/network restart” does also clear the cache. Does anyone know a better solution, let me know
April 3rd, 2007 at 12:45 pm
ipconfig /flushDNS dos not work with Windows 9x\ME
May 30th, 2007 at 7:38 am
[...] | DosBit – Techie Corner Publicaciones [...]
August 3rd, 2007 at 9:37 pm
this does NOT flush firefox internal cache.
August 7th, 2007 at 11:15 am
gabriel: this only flush ur pc dns cache. if you wan to clear Firefox internal cache, you can open firefox -> Tools -> Clear Private Data (Check the cache) and click “Clear Private Data Now”
September 1st, 2007 at 9:46 pm
i think gabriel means the internal firefox dns cache (yes firefox has it’s own dns cache… unnecessarily)
but i don’t know how to flush it… the only thing i can change, is the expiration interval.
September 12th, 2007 at 8:45 am
Normally the internal firefox cache will be clear once you close all the browser.
October 3rd, 2007 at 10:52 am
firefox’s about:config has an option: network.dnsCacheEntries
setting this to 0 will disable the cache and fallback to the local DNS cache.
October 24th, 2007 at 11:26 am
Hello Sir………..
To whom ever it may concern……………
Can you give me a solution for this………
Here we are using Terminal server with more than 50 clients at a time……..
but when i shutdown and restart that server then it will shows some errors
“IEXPLORER has encounter a problem”…………. Please can you give me a solution for this…………….. And we are using Domain environment also. Please give a solution for this……
October 27th, 2007 at 10:11 pm
Can someone help…! I can’t Clear my Cache…
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Dad>ipconfig /flushdns
Windows IP Configuration
Could not flush the DNS Resolver Cache: Function failed during execution.
C:\Documents and Settings\Dad>
November 1st, 2007 at 11:41 pm
Sam, which version of firefox has that option?
I cannot locate it in my about:config
January 12th, 2008 at 5:46 am
Hey dad.. try this.
1. Click the Microsoft Vista Start logo in the bottom left corner of the screen
2. Click All Programs
3. Click Accessories
4. RIGHT-click on Command Prompt
5. Select Run As Administrator
6. In the command window type the following and then hit enter: ipconfig /flushdns
7. You will see the following confirmation:
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
March 19th, 2008 at 5:08 am
/etc/init.d/network restart
Will clear the cache on Linux.
April 6th, 2008 at 5:46 pm
in MacOSX Leopard 10.5.2 its :
dscacheutil -flushcache
April 6th, 2008 at 11:44 pm
bash-2.05a$ lookupd -flushcache
When I try this on my Mac I get a command not found?
ryan-imac:~ ryan$ bash-2.05a$ lookupd -flushcache
-bash: bash-2.05a$: command not found
ryan-imac:~ ryan$
June 22nd, 2008 at 10:28 pm
[...] rnrn rn rn rn Re: flush DNS on Linuxrn rn rn rn rn rn Does this help?rnrnHow to flush DNS cache in Linux / Windows / Mac – Techie Cornerrn rn rn rn rn rnrn rn rn rn __________________rn Marcel Coxrn rn rn [...]
July 12th, 2008 at 6:15 pm
Ryan,
that’s because the headings for the two Mac OS X commands are around the wrong way.
If you’re using 10.5, use: dscacheutil -flushcache
Also, you want everything after the $ sign. The rest is what is written before the command prompt.
July 19th, 2008 at 7:34 am
I can’t flush my dns cache in win98.
ipconfig/flushdns is a bad command
I am unable to get to certain websites on both ie and firefox
I was able to get to the sites at one time, but once I get the server not found message i can’t get to the site.
Thanks for any help
September 1st, 2008 at 8:23 am
I had the same issue after I installed BIND 9 and racked my brains as a deconstructed my setup on my Ubuntu system. Finally tried editing /etc/hosts and found my localhost entry munged and repaired it. FireFox instantly began resolving again. Go figure. Note that I did retain the DNS server on board – Also, I found that you can use the “PortableApps” Firefox browser with Wine to work as a spare tire of sorts, since it was what got me through this. Just have Wine installed and then use the PortableApps Firefox browser.
Good luck.
Jon
September 18th, 2008 at 8:53 am
you have the leopard / non-leopard instructions backwards – pre-leopard uses lookupd
December 28th, 2008 at 8:27 am
Debian 4.0 Konsole
/etc/init.d/networking restart
April 1st, 2009 at 6:20 am
For all the Windows people the command is:
ipconfig \flushdns
Everyone has the slash the wrong way
April 3rd, 2009 at 8:48 am
I’ve get the same error message as Dad:
C:\WINDOWS\Dad>ipconfig/flushdns
Windows IP Configuration
Could not flush the DNS Resolver Cache: Function failed during execution.
C:\WINDOWS\
I tried what Kyle said and it pretty much changed nothing. Though he said something about Windows Vista and both me and Dad are on XP. I’m trying to do this to see if it will let me re-connect to google because I can’t connect to google and so far only google. If any of you got suggestions on that too, to help me re-connect, that’d be awesome.
April 3rd, 2009 at 8:51 am
Hi daftwill123, i suspect your PC was infected by virus.
Do a full system scan with your anti virus.
Here’s a free antivirus
http://www.techiecorner.com/102/avast-anti-virus-free-anti-virus-software/
http://www.techiecorner.com/166/avast-how-to-schedule-boot-time-scan-before-window-start/
April 6th, 2009 at 10:44 am
Thanks for the advice. I’ve ran anti-virus many many times, cleared out the system over and over of both spyware and virus and still having trouble. It might be so deep into the system though my protection programs aren’t picking them up. I’m using the latest versions of AVG Free (AVG
and Spyware search and destroy.
April 6th, 2009 at 11:00 am
Ok here’s another solution: Go to Control Panel -> Administrative tools -> Services and look for “DNS Client” and right click on it and Select Start. Once DNS client started you can try to flush the DNS again.
April 13th, 2009 at 10:34 am
Thank you!!!
April 27th, 2009 at 7:25 am
@Dad, kyle, daftwill123, and SoGua: should probably be *restart* the “DNS Client” service. If it isn’t already started then the service would have been disabled and there’s nothing to flush. Best to also check that the service is set to start on startup within the Right-click Properties dialog box.
@sweet bunny: I don’t believe any Windows versions prior to Windows 2000 did any caching at all without specifically installing a DNS caching service. Chances are the issue was with an upstream DNS server or maybe your firefox cache as per. See below or SoGua’s comment from August 7th 2007.
Re nscd, many *nix distros don’t have nscd installed by default. If “nscd -i hosts” doesn’t clear the cache (that’s the correct way to flush it btw) then installing it won’t help you except to install an empty cache. Also, there could be other daemons installed instead of nscd, dnsmasq or bind for example (Bind is generally not the best for a desktop – but is still installed on a lot of servers). Bind’s cache can be flushed with “rndc flush”. Dnsmasq I believe has to be restarted for the cache to be flushed.
Lastly, there’s also a lot of upstream cached records that might be totally outside of your control. In case your current DNS server has the incorrect info cached, try changing your caching DNS server settings in your Network Settings to use a different server.