How to Flush DNS Cache?
How to Flush DNS Cache From Your Computer?

This article is the guide to flush DNS cache and reset the DNS resolver cache, which stores the IP address attached to frequently used DNS names. It is also useful to speed up the DNS propagation for a newly added or modified website, at least it will remove the local cache from your terminal/PC and allow you to receive most recent cache.
Flushing the DNS cache is a crucial step in maintaining your system’s browsing speed and connectivity. The Domain Name System (DNS) cache stores the IP addresses of websites you’ve visited to speed up future access. However, over time, this cache can become outdated, leading to issues like loading problems or errors when accessing websites. Flushing the DNS cache can help resolve these issues and improve your browsing experience by ensuring you’re always using the most up-to-date IP addresses. In this guide, we’ll walk you through the steps to flush the DNS cache on Windows, Mac, and Linux systems, so you can troubleshoot any issues and improve your online browsing performance.
Why Flushing DNS Cache is Important?
When you visit a website, your computer stores its DNS information in the cache to make subsequent visits faster. However, when a website’s DNS records change (due to a server migration, for instance), your cache may still contain outdated information. This can lead to errors or slow loading times when trying to access the website. By flushing your DNS cache, you can clear any outdated information and force your computer to retrieve the latest DNS records, ensuring a smoother online experience.
Flush DNS Cache in Microsoft Windows
In Microsoft Windows, you can use the below command to flush the DNS resolver cache
ipconfig /flushdns
1.
Click Start > All
Programs > Accessories > Command Prompt
2.
Input below command and press Enter.
ipconfig /flushdns
3.
A successful flushed process will display the following result.
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
Flushing DNS in Mac OS X Leopard
1. Open up a Terminal window from under Applications/Utilities.
2.
Type below command and press Enter.
lookupd -flushcache
Flushing DNS in Mac OS X
1. Open up a Terminal window from under Applications/Utilities.
2. Type below command:
dscacheutil -flushcache
(OR)
sudo dscacheutil -flushcache
3. If you are using OS X 10.5 or earlier, try the following command:
lookupd -flushcache
Flushing DNS in Linux
Flush nscd DNS cache
nscd caches requests issued to the Name Service by libc library. This service can largely speed up consecutive access to the same data and increase overall system performance.
For clearing nscd cache, just restart nscd service:
# sudo /etc/rc.d/init.d/nscd restart
(OR)
# service nscd restart
(OR)
# service nscd reload
nscd provides caching for the most common name service requests. The default configuration file, /etc/nscd.conf, determines the behavior of this service.
Flush dnsmasq DNS cache
dnsmasq is a lightweight DNS server which provides both DNS and DHCP service together to a network. dnsmasq accepts DNS queries and either answers them from a small, local cache or forwards them to a real, recursive DNS server.
Just restart the dnsmasq service using below commands 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 a zone master server in response to a host query and then saves caches the data locally. All you have to do is restart bind service to clear its cache:
/etc/init.d/named restart
You can also use rndc command as below to flush out all cache:
# rndc restart
(OR)
# rndc exec
BIND versions from v9.3.0 and above will support flushing all of records attached to a domain name with rndc flushname command. For flushing all records related to example.com domain, the below command can be used:
rndc flushname example.com
It is also possible to flush out BIND views. For example, LAN and WAN views can be flushed using the following command:
rndc flush lan
rndc flush wan
In this guide, we will explain how to flush DNS cache on Microsoft Windows, Mac, and Linux systems. Flushing DNS cache can help resolve internet connectivity issues caused by outdated DNS records. Whether you’re troubleshooting or need to refresh your system’s DNS settings, flushing DNS cache is an essential step to ensure you have the latest DNS information