Dec 02, 2025
Aris S.
5min Read
The steps for flushing the domain name system (DNS) cache vary depending on your operating system and web browser. To clear your computer’s DNS, open your system’s command-line interface and run the appropriate commands with administrator privileges. For browsers, head to the DNS management page and select the option to delete the cache.
Flushing DNS removes corrupted or outdated data from your system, helping to resolve connectivity issues and boost security. Whether you’re an administrator or a regular user, knowing how to do this can save you time and frustration.
In a hurry? Check out this video tutorial for a quick and easy walkthrough on flushing your DNS cache.
We’ll cover the steps for each system and explore use cases where this process is helpful. But first, let’s take a quick look at what DNS cache actually is.
A DNS cache is a file your device creates to remember how to find websites. It stores information like a website’s IP address after you visit it, helping your browser load the site faster next time.
This data comes from a process called a DNS lookup, where your browser contacts a domain name system (DNS) server to retrieve the information.
However, the cache can sometimes become outdated or corrupted, which may prevent your browser from loading the site correctly. In such cases, clearing the DNS cache forces your browser to fetch fresh data.

The steps to flushing the DNS cache differ across operating systems. We’ll walk you through the process on Windows, macOS, and Linux.
Flushing DNS on Windows is similar across most versions, especially newer ones. Here are the steps:
Ipconfig /flushdns
Your system will automatically delete the stored DNS cache and reset the resolver settings. Once the process is complete, you should see a confirmation message in Command Prompt.

Important! Make sure to launch Command Prompt as an administrator. Otherwise, you won’t have the necessary permissions to flush the DNS cache.
Flushing the DNS cache on macOS requires different commands depending on the operating system version. Follow these steps:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSRespondersudo killall -HUP mDNSRespondersudo discoveryutil udnsflushcachessudo killall -HUP mDNSRespondersudo dscacheutil -flushcachesudo lookupd -flushcacheOn macOS, most DNS flush commands don’t display a confirmation message, even when they work. If you run the command and don’t see an error, it likely completed successfully. To double-check, try visiting a website you recently accessed. If it takes a bit longer to load or the previous issue is resolved, the flush probably worked.
Still having issues? See our guide on DNS server not responding on Windows and macOS for more troubleshooting tips.
Commands to clear DNS cache on Linux vary by distribution since they might use different DNS services. For example, Ubuntu uses dnsmasq, while Red Hat Enterprise Linux typically utilizes NCSD.
If you’re unsure which DNS service your system uses, check it by running the following command in Terminal. Replace dns_service with dnsmasq, ncsd, or bind:
sudo systemctl status dns_service
Here’s the general procedure to flush DNS caches on a Linux system:
sudo /etc/init.d/dnsmasq restartsudo /etc/init.d/nscd restartsudo /etc/init.d/named restart && sudo rndc restart && sudo rndc execThe DNS service will stop briefly and reboot. If systemctl can’t find any of the DNS services, use the following command to flush the cache:
sudo resolvectl flush-caches
Web browsers typically store their own DNS cache, so you might need to flush them separately. Here’s how to do it in popular browsers:
chrome://net-internals/#dnsedge://net-internals/#dns about:networking#dnsopera://net-internals/#dns
Important! Safari doesn’t have a page for flushing the DNS cache and uses the system-level configuration instead. This means resetting your macOS system’s DNS will also flush the web browser’s data.
Flushing your DNS cache removes outdated or incorrect data that can interfere with how websites load. While DNS records usually expire on their own (thanks to a setting called time-to-live, or TTL), some situations call for a manual refresh.
A common example is troubleshooting website issues. If a page isn’t loading properly, clearing your DNS cache forces your system to request fresh information from the DNS server, often resolving glitches caused by outdated or corrupted records.
Flushing the cache can also protect against DNS spoofing. In rare cases, attackers manipulate cached DNS data to redirect you to fake or malicious websites. Resetting the cache clears any tampered entries and helps restore accurate routing.
It’s also useful after DNS changes. If you’ve updated your domain’s DNS settings, like pointing it to a new hosting provider, your system might still rely on outdated information. Flushing the cache forces your device to request the latest records, helping your changes take effect faster and reducing delays during DNS propagation (the time it takes for updates to spread across the internet).
You don’t need to flush your DNS cache regularly since it clears itself automatically after a set period. However, it’s a helpful step when you’re troubleshooting website issues, switching DNS providers, or updating domain settings.

Flushing your DNS cache is a safe and effective way to resolve common browsing issues. It clears outdated or corrupted data, allowing your system to fetch fresh DNS information and connect to websites more reliably.
Keep in mind that some browsers have their own DNS cache, so it’s worth clearing both your system and browser cache for best results. On most systems, flushing the DNS cache requires admin access, but browser-level clearing is often just a click away.
When done correctly, flushing your DNS cache helps websites load properly, protects against DNS spoofing, and speeds up the effects of changes like domain or hosting updates by reducing DNS propagation delays.
Comments
May 13 2018
To check DNS and IP addresses accessed by Chrome, you can go to: chrome://net-internals/#dns
May 23 2018
Hello, Cesar I appreciate your input. I was not aware of the provided tool and it seems really useful!
July 02 2021
Hello : The article was very good and ilustrative , I didn't know that flushing the cache , prevents to several problems from attacks and stole our credentials. Every day we learn something interesting !! Thank you
January 16 2022
DNS_PROBE_FINISHED_NXDOMAIN I request u to do from your team pls fix it
January 18 2022
Hi there, feel free to check our guide on solving DNS_PROBE_FINISHED_NXDOMAIN error. If you're having any trouble with it, don't hesitate to contact your host - in case you're hosting with Hostinger, you can find how to contact the Customer Success team here :)