How to Flush DNS in Windows, Mac and Linux

When do you want flush DNS (Domain Name System)?

You visit one of the most frequently viewed websites in your list and find it’s not loading up, it could be very frustrating at times.

The site can be down for more than one reason, the most common one being, the remote server being down. To ensure if the server is up, ping the server directly, and the response tells you the status.

Let’s assume that the servers working fine, but still the site does not load up in your browser! DNS failure can be the cause. And this us a common case if server is relocated and/or the site is moved on to a new server, as DNS propagation normally takes anywhere from 24 – 72 hrs to propagate and work fine.

This scenario is also true when you set up new domain on a server.

If the site fails to show up even after 72 hrs, you may have to clear your DNS cache to ensure the request is not going to the old ips of the site you are trying to load.

Clearing DNS cache will ensure your PC does not have old records of bad DNS entries. If the bad entries are not flushed then you need to wait up to 24 hours for it to be dropped from the cache automatically, which is a scheduled activity in some computers.

The following list gives you the set of commands to flush DNS on different platforms:


If you are on Microsoft Windows:

1. Use the command ipconfig/flushdns in your command prompt.
2. The ipconfig/displaydns can be used to view the DNS resolver cache.

If you wish to turn off DNS Caching on Microsoft windows then The client-side DNS caching can be disabled by using either of these two commands:

1. net stop dnscache
2. sc servername stop dnscache

Until the next reboot DNS caching will be disabled and to make this permanent user the Service Controller tool or the Services tool to disable DNS Client service startup type.

If you use Mac OS X Leopard:

1. Use dnscacheutil -flushcache
Eg: bash-2.05a$ dnscacheutil -flushcache

And if you are on any version of Linux:

1. Use nscd daemon which manages the DNS cache.
Restart the nscd daemon by using the command /etc/init.d/nscd restart

Click here for more information on DNS.


Feel free to post comments. :)

0 comments: