Clearing DNS Cache

When changing hosting providers or making DNS changes you may want to speed up the process of updating the domain resolution to the new IP address. 



If running Windows, open a command prompt with administrative rights by clicking run, type "cmd" and right click and select run as administrator. Once loaded type "ipconfig /flushdns" and hit the enter key.


To restart DNS cache on OS X performing the following base on the version you are using:

OS X Yosemite

Use the following Terminal command to reset the DNS cache in OS X Yosemite v10.10.4:

sudo killall -HUP mDNSResponder

Use the following Terminal command to reset the DNS cache in OS X Yosemite v10.10 through v10.10.3:

sudo discoveryutil mdnsflushcache


OS X Mavericks, Mountain Lion, and Lion

Use the following Terminal command to reset the DNS cache:

sudo killall -HUP mDNSResponder

Mac OS X v10.6

Use the following Terminal command to reset the DNS cache:

sudo dscacheutil -flushcache

 

For Linux it depends on what you have installed. 

Flush nscd dns cache

Nscd caches libc-issued requests to the Name Service. If retrieving NSS data is fairly expensive, nscd is able to speed up consecutive access to the same data dramatically and increase overall system performance. Just restart nscd:
sudo /etc/init.d/nscd restart

OR
service nscd restart

OR
service nscd reload

This daemon provides a cache for the most common name service requests. The default configuration file, /etc/nscd.conf, determines the behavior of the cache daemon.


Flush dnsmasq dns cache

dnsmasq is a lightweight DNS, TFTP and DHCP server. It is intended to provide coupled DNS and DHCP service to a LAN. Dnsmasq accepts DNS queries and either answers them from a small, local, cache or forwards them to a real, recursive, DNS server. This software is also installed many cheap routers to cache dns queries. Just restart the dnsmasq service to flush out dns cache:
sudo /etc/init.d/dnsmasq restart

OR
service dnsmasq restart


Flush caching BIND server dns cache

A caching BIND server obtains information from another server (a Zone Master) in response to a host query and then saves (caches) the data locally. All you have to do is restart bind to clear its cache:
/etc/init.d/named restart

You can also use rndc command as follows flush out all cache:
rndc restart

OR
rndc exec


To clear DNS cache in Chrome enter the following URL in your Chrome browser:

chrome://net-internals/#dns

and click "Clear Host Cache"



 

 


Share this page:


Was this article useful? Have any suggestions or improvements to the information?

Also Read

DNS Report Tools

To track down DNS related issues there are many websites available to assist you in isolated...

What is domain propagation?

Once you make changes to your domain with the registrar you purchased your domain from, the...

What is a domain name pointer or parked domain?

A domain name pointer is a domain name which simply points to your account. In other words,...

I changed the DNS pointers to your servers but still can't see my site.

It can often take up to 72 hours for the DNS zone transfers to replicate to some ISPs and for...

Redirecting non-www to www with .htaccess

Redirecting non-www to www with .htaccess If you ever point your www. record to another server...