Clear DNS Cache in Windows, Linux, Chrome
DNS works like the internet’s address book, matching domain names to IP addresses, so your system knows where to connect.
But cached entries can go stale or get corrupted, leading to failed connections, errors, or redirects. Clearing the DNS cache ensures accurate, up-to-date routing.
Whether you are managing a server, troubleshooting a PC, or working in a browser, knowing how to flush DNS on Windows, Linux, and Chrome is a key step in keeping things running smoothly.
To clear DNS cache:
- Use
ipconfig /flushdns
on Windows. sudo systemd-resolve --flush-caches
(or restart DNS services) on Linux.- Go to
chrome://net-internals/#dns
> Clear host cache in Chrome.
If you have invested in performance and reliability with a solution like buy VPS, mastering DNS hygiene helps you prevent downtime and keep your services running smoothly.
Steps to Flush DNS Cache on Windows (All Versions)
Whether you’re running Windows XP or the latest Windows 11, the method to clear DNS cache remains consistent
This universal use of the ipconfig /flushdns
command is one of the fastest and safest ways to clear DNS cache in Windows without relying on third-party tools.
It’s essential for fixing domain resolution issues, especially when managing DNS changes on remote servers or after you buy Windows VPS for hosting tasks.
Clear DNS Cache in Windows 10/11
1. Open Command Prompt:
Right-click the Start icon → Windows Terminal (Admin) or Command Prompt (Admin).
Or press Windows + R
, type cmd
, and hit Enter.
2. In the terminal, type:
ipconfig /flushdns
3. Press Enter.
If successful, you’ll see:
“Successfully flushed the DNS Resolver Cache.”
This clear DNS command ensures your resolver retrieves fresh DNS records from authoritative servers, avoiding cached routing errors.
Clear DNS Cache in Windows 8
1. Press Windows + X
and choose Command Prompt.
Or:
Open Start, go to Apps → Windows System → Command Prompt.
3. Run:
ipconfig /flushdns
4. Confirm the success message appears before closing the window.
Clear DNS Cache in Windows 7, Vista, and XP
1. Click Start → All Programs → Accessories → Command Prompt.
2. Enter the DNS flush command:
ipconfig /flushdns
3. Press Enter and wait for the confirmation.
Final Notes:
If using Windows Vista, and you see “Action Requires Elevation,” you’ll need to rerun Command Prompt as Administrator.
For older systems like Windows XP, this clear DNS cache Windows XP method helps resolve DNS resolution failures without advanced tools.
Steps to Clear DNS Cache in Linux
Linux does not have a default, unified caching system for DNS, which means clear DNS cache procedures can differ based on the active service and distribution you’re using.
Using Linux tools to help troubleshooting DNS issues can provide deeper insights when simple cache clearing doesn’t resolve complex DNS problems.
Some distributions rely on systemd-resolved
, dnsmasq
, nscd
, or BIND
to store cached DNS records, and each has a unique method to flush DNS Linux.
If you’re managing a Linux VPS for hosting or networking, performing a Linux clear DNS cache regularly helps prevent resolution errors, outdated records, or service misrouting.
Flush DNS on Ubuntu & Debian-Based Systems
If flushing the DNS cache doesn’t fully resolve your issues, adjusting or changing DNS server settings in Linux can often improve resolution speed and reliability.
On Ubuntu and its derivatives, systemd-resolved is typically responsible for DNS caching. Here’s how to clear DNS cache Linux effectively:
1. Open the terminal by pressing Ctrl + Alt + T
or searching for Terminal in Activities.
2. To flushdns Linux, run:
sudo systemd-resolve --flush-caches
3. To verify that the DNS cache is cleared:
sudo systemd-resolve --statistics
4. For systems running BIND, restart the service to ensure DNS records are reloaded:
sudo systemctl restart bind9.service
Clear DNS Cache in Red Hat, Fedora, and CentOS
On RHEL-based systems such as Red Hat, CentOS, and Fedora, the DNS services may vary:
1. For systems using NSCD (Name Service Cache Daemon), run:
sudo systemctl restart nscd.service
2. For systems using dnsmasq:
sudo systemctl restart dnsmasq.service
This will flush DNS Linux for these distributions, similar to running ipconfig dns flush
on Windows.
Flush DNS Cache for Other Linux Distributions
If you’re using a different Linux distribution or have a custom DNS service, you can use this clear DNS command to attempt a system-wide flushdns Linux:
sudo /etc/init.d/dns-clean start
This command provides a fallback for clearing DNS cache on various Linux versions that don’t rely on the standard services above.
How to Clear DNS Cache on Chrome
When Chrome starts resolving the wrong IPs or loads outdated content, it’s likely time for a browser-level DNS reset.
Chrome maintains its own internal DNS resolver separate from your system, and clearing it can fix issues faster than system-level changes.
This is why many network engineers recommend performing a flush DNS Chrome procedure before resorting to OS-level troubleshooting.
Access Chrome’s Internal DNS Tool
In your Chrome address bar, type the following and press Enter:
chrome://net-internals/#dns
This is the interface for DNS lookups handled internally by Chrome. It’s the official access point for chrome //net-internals/#dns clear operations.
- Note for Opera Users:
Since Opera is built on Chromium, it uses the same internal DNS resolver structure. To flush DNS in Opera, open your browser and enter opera://net-internals/#dns in the address bar.
Then click “Clear host cache,” just like in Chrome.
This executes the same opera net internals dns clear host cache function behind the scenes, ensuring Opera flushes outdated DNS records fully.
Clear Host Cache in Chrome
On this page, find and click the “Clear host cache” button to perform a chrome clear dns cache operation that removes outdated DNS entries stored within the browser.
This triggers the chrome //net-internals/#dns clear host cache
operation, wiping all cached domain resolutions. It’s a precise step to ensure DNS entries are fully resolved.
Note: This tool is part of the broader chrome //net-internals/dns clear
interface Chrome provides for advanced DNS cache handling.
Clear Chrome Sockets (Highly Recommended)
To fully flush socket-related caches, go to:
chrome://net-internals/#sockets
Here, click:
- “Close idle sockets”
- “Flush socket pools”
This step ensures Chrome drops all reused network connections, crucial after the Chrome flush DNS command.
Restart Chrome (Optional but Ideal)
Although optional, restarting Chrome after you clear DNS cache Chrome helps apply the reset fully, especially when testing CDN propagation, DNS failovers, or private zones.
Final Tips:
If you’re running Chrome on Linux and have already ran linux clear dns
or linux flush dns
at the system level, don’t skip the browser reset. Chrome stores a separate DNS cache that’s untouched by commands like ipconfig flushdns
or flushdns linux
.
Whether you’re on Ubuntu, Arch, or CentOS, you must use the Chrome method too.
To reset it fully, you should run the browser-level chrome net internals dns clear host cache process manually, especially when testing new DNS zones or resolving CDN routing conflicts.
Why You Should Clear DNS Cache?
Over time, your system’s DNS cache may store outdated or malicious records that cause connection issues, security risks, or privacy leaks.
Whether you’re on Windows, Linux, or Chrome, knowing how to clear DNS cache is an essential troubleshooting and protection step.
This step also helps prevent errors such as the Fix DNS_PROBE_FINISHED_NXDOMAIN in Linux & Windows Error by ensuring DNS settings are refreshed and accurate.
Fix Security Risks
Cached DNS entries can be hijacked or spoofed. Attackers may exploit them to redirect users to fake sites.
Running ipconfig /flushdns
on Windows or systemd-resolve --flush-caches
on Linux helps eliminate these threats.
Protect User Privacy
DNS history reveals your browsing behavior. On shared systems, this can be misused by tracking tools.
Use chrome://net-internals/#dns
to clear DNS cache in Chrome and remove host resolution history.
Resolve 404 & Load Errors
Sites moved to new servers can return 404 errors due to outdated cache. Use flushdns on Linux, or ipconfig dns flush
to force fresh lookups and fix mismatched domain resolutions.
Flushing the DNS cache often resolves connection interruptions, but if you encounter persistent errors like the Fix DNS_PROBE_FINISHED_BAD_CONFIG Error, deeper DNS configuration troubleshooting may be required.
Restore Site Access
If a site won’t load despite working elsewhere, DNS cache corruption may be to blame.
Clear DNS commands vary by system: ipconfig flushdns
, linux flush dns, or clear dns cache chrome depending on where the issue occurs.
FAQ
Does flushing the DNS cache increase internet speed?
Clearing the DNS cache doesn’t boost raw internet speed, but it can improve page load times by resolving DNS lookup issues.
It’s a smart maintenance step to fix connection errors and optimize browsing performance. For real speed gains, consider using faster or custom DNS servers at the router level.
How to access DNS records in Linux?
You can access DNS records in Linux by running the following 3 commands:
- Host Command
- Dig Command
- nslookup Command
Does clearing the DNS cache have any downsides?
No, clearing the DNS cache is safe. It simply removes stored domain lookups to refresh outdated IP records.
While it temporarily deletes cached data for frequently visited sites, it helps fix access issues, improves accuracy, and enhances privacy without causing any harm or system instability.
Does flushing the DNS cache remove all browsing data?
No, flushing the DNS cache only clears stored DNS information. It doesn't affect your browsing history, saved passwords, cookies, or other browser data.
How often should I clear my DNS cache?
Regularly clearing your DNS cache isn't typically necessary. However, consider flushing it when
- You experience frequent website loading errors or delays.
- You've changed DNS settings or switched networks.
- You're troubleshooting connectivity issues.
- After removing malware or resolving security threats.
Conclusion
Clearing DNS cache is a foundational layer of digital hygiene.
This guide walked through how to Linux flush DNS, use ipconfig /flushdns
on Windows, and clear DNS Chrome via chrome://net-internals/#dns
.
Whether you’re managing systems on Windows, securing endpoints on Linux, or troubleshooting performance in Chrome, the ability to flush DNS ensures accurate resolution, stronger privacy, and protection from spoofed or stale records.
By understanding these steps, users gain control over network integrity and browsing safety. Make it a regular practice, because smart systems begin with clean resolutions.
How can I clear the DNS cache on macOS?
You can do this using the following command: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
How do I clear DNS cache on Linux when using dnsmasq?
Dear Vina; if your Linux system uses dnsmasq for DNS caching, run the below command to restart the dnsmasq service and clear the DNS cache:
sudo systemctl restart dnsmasq
Once finished, you can verify that the DNS cache has been cleared by checking the statistics or logs of the respective services.Chrome's DNS cache not clear when using chrome://net-internals/#dns. what should i do now?
Dear Samudra; If Chrome's DNS cache doesn't clear using
chrome://net-internals/#dns
, consider the following actions: 1. Ensure that you're using an up-to-date version of Chrome, as older versions may have bugs affecting DNS cache clearing. 2. Try clearing the DNS cache in an Incognito window, as some extensions or settings may interfere with the process in regular browsing mode. 3. Disable browser extensions temporarily to rule out interference with DNS cache clearing. 4. Remember that Chrome maintains its own DNS cache separate from the system's DNS cache. Ensure that you've also cleared the system's DNS cache using the appropriate method for your operating system. Let me know if the problem is not solved after considering above solutions.I cleared the DNS cache on Chrome. Why does it still resolve to the old IP?
Dear Zahira, if Chrome continues to resolve to an outdated IP address even after clearing the DNS cache via
chrome://net-internals/#dns
, consider the following steps: 1. Navigate tochrome://net-internals/#sockets
and click on "Flush socket pools" to close any persistent connections that might be retaining old DNS data. 2. Restart Chrome. 3. Open Command Prompt and runipconfig /flushdns
; on Linux, usesudo systemd-resolve --flush-caches
as you learned in this guide to clear system DNS cache. 4. Check the hosts file to ensure there are no overriding entries in your system's hosts file that could be directing Chrome to the old IP. Check the IP and let me know if the problem is not solved.Is it possible to automate DNS cache flushing on Linux?
Dear Jamal, Yes. You can automate DNS cache flushing on Linux servers. To do this, you can create a cron job that runs the appropriate flush command at regular intervals. As an example, open the crontab editor and run:
crontab -e
Then, add a line to flush the DNS cache daily at midnight:0 0 * * * sudo systemd-resolve --flush-caches
In this way, this cron job will execute the flush command daily at midnight, ensuring that the DNS cache is regularly cleared.