A DNS cache temporarily stores DNS lookup information to help your device load websites faster. However, outdated or corrupted cache entries can sometimes cause browsing or connectivity issues. Clearing the DNS cache removes this stored information and forces your device to request updated DNS records. This can help resolve access problems, remove outdated DNS records, and ensure you’re connecting to the latest version of a website.
In this guide, we’ll explain what DNS cache is, why it matters, and how to clear it on different operating systems and browsers.
What is DNS Cache?
A DNS cache is temporary storage on your device that keeps a record of website addresses you’ve recently visited. When you open a website, your system saves the IP address linked to its domain name. This allows your device to find the website more quickly the next time you visit without requesting the same information again.
For example, when you enter example.com into your browser for the first time, your device asks a DNS server for the website’s IP address and stores the result in the DNS cache. The next time you visit the site, your device can use the cached information instead of repeating the lookup, helping the website load faster.
If you’d like a deeper look at how DNS works behind the scenes, read our guide all about the Domain Name System (DNS).
Why is DNS Cache Important?
DNS caching speeds up your internet experience. Without it, your device would need to request a website’s IP address from a DNS server each time you visit, which could slow down browsing.
Key benefits of DNS caching include:
- Faster website loading: Your device can reuse stored information instead of requesting it again.
- Improved efficiency: Fewer lookup requests need to be sent to DNS servers.
- Reduced DNS lookup delays: Previously resolved domain names can be reused until their cache entries expire, reducing the need for repeated DNS queries.
How to flush DNS cache
The steps for clearing DNS cache vary depending on your operating system or browser. In most cases, the process only takes a few minutes and can help resolve issues caused by outdated DNS information. Follow the instructions below for your device to clear the cache and force it to request updated website information.
1. Microsoft Windows
Flushing the DNS cache on Windows is a quick process that can be completed through the Command Prompt. The required command is the same across most modern Windows versions, although the steps for opening the Command Prompt may vary slightly.
Windows 11 and 10
- Click the Start button.
- Type Command Prompt in the search bar.
- Right-click Command Prompt and select Run as administrator.
- In the Command Prompt window, type:
ipconfig /flushdns
- Press Enter.
- Wait for the confirmation message stating that the DNS Resolver Cache has been successfully flushed.
Windows 8
- Open the Apps screen.
- Locate and open Command Prompt.
- Type the following command:
ipconfig /flushdns
- Press Enter.
- Confirm that Windows displays a message indicating the DNS cache has been cleared.
Windows 7
- Click the Start button.
- Navigate to All Programs > Accessories.
- Open Command Prompt.
- Type the following command:
ipconfig /flushdns
- Press Enter.
- Wait for the confirmation message that the DNS Resolver Cache has been successfully flushed.
2. Google Chrome
If the issue appears to be limited to Chrome, you may need to clear the browser’s DNS cache instead of your operating system’s DNS cache. Chrome maintains its own DNS cache to help speed up website loading.
- Open Google Chrome.
- In the address bar, enter: chome://net-internals/#dns
- Click Clear host cache.
- Then enter: chrome://net-internals/#sockets
- Click Flush socket pools.
- Restart Chrome and test the website again.
3. Linux Operating Systems
Unlike Windows, Linux doesn’t have a single DNS cache that can be cleared with one universal command. The exact process depends on your Linux distribution and the DNS service handling DNS requests on your system.
Before clearing the DNS cache, determine which DNS service is running on your system. Linux distributions can use different DNS services, and the correct command depends on the one installed on your device.
- Open the Terminal application on your Linux system.
- Check if systemd-resolved is active. Type the following command and press Enter:
systemctl is-active systemd-resolved
If the result is:
active
Your system uses systemd-resolved.
- Check if dnsmasq is active. If the previous command does not return “active”, type:
systemctl is-active dnsmasq
If the result is:
active
Your system uses dnsmasq. This is more commonly found on older distributions or systems configured with a local DNS cache.
- Check if NSCD is active. If neither of the previous services is active, type:
systemctl is-active nscd
If the result is:
active
Your system uses NSCD (Name Service Cache Daemon). This is common on some Red Hat-based systems and in enterprise environments.
5. Use the matching command. Once you’ve identified the DNS service running on your system, use the corresponding command in the table below to flush the DNS cache.
| Linux distribution/setup | DNS service | Command to flush DNS cache |
|---|---|---|
| Ubuntu 18.04+, Ubuntu 20.04+, Ubuntu 22.04+, Ubuntu 24.04+ | systemd-resolved | sudo resolvectl flush-caches |
| Debian 12+, Fedora, and many modern Linux distributions | systemd-resolved | sudo resolvectl flush-caches |
| Older distributions using dnsmasq | dnsmasq | sudo systemctl restart dnsmasq |
| Red Hat systems using NSCD | NSCD | sudo systemctl restart nscd |
Note: Some Linux systems do not run a local DNS caching service. In those cases, there may be no DNS cache to clear on the device.
4. macOS
If you’re using an Apple computer, the process for clearing the DNS cache is similar across macOS versions, but the command varies depending on the version installed on your device. To flush the DNS cache, open the Terminal application, find your macOS version in the table below, and run the corresponding command. You may be asked to enter your administrator password before the command can run.
| macOS version | Terminal command |
|---|---|
| Snow Leopard (10.6) | sudo dscacheutil -flushcache |
| Lion (10.7), Mountain Lion (10.8), Mavericks (10.9) | sudo killall -HUP mDNSResponder |
| Yosemite (10.10) | sudo discoveryutil mdnsflushcache sudo discoveryutil udnsflushcaches |
| El Capitan (10.11), Sierra (10.12), High Sierra (10.13), Mojave (10.14), Catalina (10.15) | sudo killall -HUP mDNSResponder |
| Big Sur (11), Monterey (12), Ventura (13), Sonoma (14), Sequoia (15), Tahoe (26) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
Why Should You Flush DNS Cache?
Flushing the DNS cache isn’t something you need to do regularly. When working as intended, cached DNS information helps websites load more efficiently. However, stored records can become outdated, inaccurate, or inconsistent after network or infrastructure changes.
When that happens, clearing the cache can help your device retrieve fresh DNS information and eliminate problems caused by stale records.
Here are some common situations where flushing the DNS cache can help:
- Fix Website Loading Issues: If a website has changed its IP address, your device may still be using an older cached record. This can prevent the website from loading correctly or cause you to reach the wrong destination. Clearing the DNS cache forces your system to request the latest DNS information, helping restore access to the site.
- Prevent Security Threats: In some cases, attackers can manipulate DNS records through a technique known as DNS cache poisoning. This may cause users to be redirected to fraudulent websites that imitate legitimate ones. While flushing the DNS cache is not a replacement for proper security measures, it can help remove suspicious or compromised DNS entries stored on your device.
- Update Cached Information: Websites occasionally undergo infrastructure changes such as server migrations, hosting changes, or DNS updates. If your device continues using outdated cached records, you may not see those changes immediately. Flushing the DNS cache ensures your system retrieves the most current DNS information available.
- Resolve Connectivity Problems: Corrupted DNS cache entries can sometimes lead to website errors such as “DNS Server Not Responding.” Clearing the cache is often one of the first troubleshooting steps because it removes potentially faulty DNS records and allows your device to start with a fresh lookup.
- Enhance Privacy: Your DNS cache stores information about websites that your device has recently accessed. Although it does not contain your complete browsing history, clearing the cache removes these locally stored records, reducing the amount of browsing information retained on your device.
Conclusion
DNS caching plays a crucial role in improving internet speed and reducing server load. However, outdated or corrupted cache entries can lead to browsing issues and security risks. Flushing your DNS cache ensures you access the most recent website information, improves security, and resolves connectivity problems.
Knowing how to clear the DNS cache is a useful skill that can save time and help maintain a smoother browsing experience.
For website owners, DNS management is just one part of keeping an online presence running smoothly. Having the right tools in place can make it easier to keep your website accessible, secure, and ready for growth.
BigRock offers a range of solutions, including domain registration, web hosting, business email, and website security, helping you manage the essential elements of your online presence from one place.
Frequently Asked Questions (FAQs)
Yes. Flushing the DNS cache is generally safe and can help resolve issues caused by outdated or incorrect DNS records.
The process depends on your device and operating system. On Windows, for example, you can open Command Prompt and run ipconfig /flushdns. Other operating systems and browsers use different methods.
No, flushing DNS only removes stored DNS records. It doesn’t delete your browsing history.
We’d love to hear from you! Share your thoughts or questions in the comments below!







