Every time you visit a website, stream online content, send an email, or connect to an online service, your device performs a Domain Name System (DNS) lookup to translate a human-readable domain name into an IP address. To improve speed and reduce unnecessary network requests, your operating system temporarily stores these DNS lookups in a local DNS cache. While this cache significantly enhances browsing performance, it can sometimes become outdated or corrupted, leading to connectivity issues, website loading errors, or security concerns.
Knowing how to flush your DNS cache is a valuable troubleshooting skill for anyone who uses the internet. Whether you are a casual user trying to access a recently updated website, a web developer testing DNS changes, or a system administrator managing multiple devices, clearing the DNS cache can often resolve network-related problems quickly and effectively.
What is DNS cache?
Before learning how to clear it, it is important to understand what the DNS cache actually does and why your computer maintains it. The Domain Name System functions like the internet’s phone book. Instead of remembering numerical IP addresses such as 142.250.190.78, users simply type domain names like example.com into their browsers.
DNS servers then translate these names into the correct IP addresses. To avoid performing this translation every time you visit the same website, your operating system stores recent DNS records locally. This temporary database is known as the DNS cache or DNS resolver cache. The cache typically stores:
- Recently visited domain names.
- Their corresponding IP addresses.
- Time-to-Live (TTL) values.
- DNS lookup results.
By using cached records instead of contacting DNS servers repeatedly, websites load faster and network traffic is reduced.
Why flush the DNS cache?
Although DNS caching improves performance, there are situations where the stored records become inaccurate or outdated. A DNS cache flush deletes all locally stored DNS entries, forcing your device to request fresh information from DNS servers the next time you access a website. Common reasons include:
1. Website has changed servers
When a website migrates to a new hosting provider, its IP address changes. If your computer still uses the old cached IP address, the website may fail to load properly. Flushing the cache forces your computer to retrieve the updated address.
2. DNS records have changed
Website administrators frequently modify DNS settings for:
- New servers.
- CDN updates.
- Security improvements.
- Domain transfers.
- Email configuration.
Cached entries may prevent you from seeing these changes immediately.
3. Fix website loading errors
Many browsing problems originate from outdated DNS records, including:
- Website not found
- Server unavailable
- DNS_PROBE_FINISHED_NXDOMAIN
- ERR_NAME_NOT_RESOLVED
Clearing the cache often resolves these errors.
4. Remove corrupted DNS entries
Sometimes cached DNS records become corrupted because of:
- Improper shutdowns.
- Malware.
- Network interruptions.
- Software bugs.
Removing the cache allows clean DNS information to be downloaded.
5. Improve privacy
The DNS cache contains a history of recently visited domains. While it is not a complete browsing history, flushing it removes these locally stored records.
6. Troubleshoot network issues
Network administrators commonly clear DNS caches during troubleshooting to eliminate cached information as a possible source of problems.
Is flushing DNS cache safe?
Understanding the effects of flushing the DNS cache helps eliminate unnecessary concerns about performing the operation. Flushing the DNS cache is completely safe. It does not:
- Delete browser bookmarks.
- Remove browsing history.
- Affect saved passwords.
- Delete cookies.
- Damage your operating system.
- Slow your computer permanently.
The only temporary effect is that your computer must perform fresh DNS lookups for websites you visit afterward, which may add a fraction of a second to the first connection. Once new records are cached, browsing speed returns to normal.
What happens after flushing DNS?
When the cache is cleared:
- All cached DNS entries are removed.
- Your computer contacts DNS servers for fresh information.
- Updated IP addresses are downloaded.
- New DNS records begin populating the cache.
- Internet connectivity continues normally.
The process usually takes only a few seconds.
How to flush DNS cache on Windows
Windows includes a built-in utility for clearing the DNS resolver cache through the Command Prompt or Windows Terminal.
Method 1: Using Command Prompt
This is the quickest and most reliable method.
Step 1: Open Command Prompt as Administrator
Search for:
cmd
Right-click ‘Command Prompt’, then select:
Run as administrator
Step 2: Enter the command
Type:
ipconfig /flushdns
Press Enter.
Step 3: Verify success
You should see:
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
The DNS cache has now been cleared.
Method 2: Using Windows Terminal
On modern Windows versions:
- Open Windows Terminal.
- Run:
ipconfig /flushdns
The result is identical.
View DNS cache before clearing
To display cached DNS records:
ipconfig /displaydns
This shows every cached hostname currently stored.
How to flush DNS cache on macOS
macOS uses different commands depending on the version installed. Apple has changed the DNS resolver implementation several times over the years.
macOS Ventura, Sonoma, Sequoia, and newer
Open Terminal and run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Enter your administrator password when prompted. No confirmation message usually appears, which is normal.
macOS Monterey and Big Sur
Use:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS Catalina and Mojave
Run:
sudo killall -HUP mDNSResponder
Older macOS versions
Older releases use different commands, but most users today are running versions that support the commands above.
How to flush DNS cache on Linux
Unlike Windows and macOS, Linux distributions do not share a single DNS caching system. The correct command depends on which DNS service is running.
Using systemd-resolved
Many modern Linux distributions use systemd. Run:
sudo resolvectl flush-caches
Or:
sudo systemd-resolve --flush-caches
depending on your distribution.
Restart nscd
If your system uses Name Service Cache Daemon:
sudo systemctl restart nscd
Restart dnsmasq
For systems using dnsmasq:
sudo systemctl restart dnsmasq
Restart BIND
If acting as a DNS server:
sudo rndc flush
The appropriate command depends entirely on your installed DNS service.
How to flush DNS cache in Google Chrome
Google Chrome maintains its own internal DNS cache in addition to the operating system cache. If website issues continue after flushing the OS cache, clearing Chrome’s DNS cache may help.
Steps
- Open Chrome.
- Type:
chrome://net-internals/#dns
or, on newer versions:
chrome://net-internals
- Locate the DNS section.
- Click:
Clear host cache
Restart Chrome afterward.
How to flush DNS cache in Microsoft Edge
Since Edge is Chromium-based, its DNS cache behaves similarly to Chrome. You can:
- Restart the browser.
- Clear host cache through Edge’s internal networking tools if available.
- Flush the operating system cache.
How to flush DNS cache in Mozilla Firefox
Firefox primarily relies on the operating system’s DNS resolver but also caches DNS entries internally. To clear it:
- Type:
about:networking
- Open DNS.
- Click:
Clear DNS Cache
Restart Firefox afterward.
How to flush DNS cache on Android
Android generally relies on network-based DNS rather than maintaining a large persistent DNS cache, but cached network information can still affect connectivity. Methods include:
a. Restart the device
A simple restart clears many temporary network caches.
b. Toggle Airplane Mode
- Enable Airplane Mode.
- Wait about 30 seconds.
- Disable Airplane Mode.
This forces network reconnection.
c. Renew Wi-Fi connection
Forget the Wi-Fi network and reconnect.
d. Change DNS server
Switching between automatic DNS and public DNS providers can refresh cached lookups. Popular public DNS servers include:
- Google DNS
- 8.8.8.8
- 8.8.4.4
- Cloudflare DNS
- 1.1.1.1
- 1.0.0.1
How to flush DNS cache on iPhone and iPad
iOS does not provide a dedicated DNS flush button. Instead, you can refresh DNS information using several methods.
a. Restart the device
Power the device off and back on.
b. Toggle Airplane Mode
Enable Airplane Mode for approximately 30 seconds before disabling it.
c. Renew Wi-Fi lease
Navigate to:
Settings → Wi-Fi → Your Network → Configure IP
Renew the DHCP lease if available.
d. Change DNS settings
Switch DNS servers and reconnect.
How to verify DNS changes
After clearing the cache, you can confirm new DNS information using network diagnostic tools.
a. Windows
Use:
nslookup example.com
b. macOS and Linux
Run:
dig example.com
or
nslookup example.com
These commands display the IP address currently returned by your configured DNS server.
Common DNS problems that flushing can fix
Clearing the DNS cache frequently resolves a wide range of connectivity issues.
a. Website loads an old version
Following a website migration, cached DNS records may continue directing traffic to the previous server.
b. Domain cannot be found
Incorrect cached records may generate domain resolution errors.
c. SSL certificate warnings
If DNS points to an outdated server, browsers may encounter certificate mismatches.
d. Email delivery issues
Mail servers depend heavily on accurate DNS records. Clearing outdated cache entries can help resolve connection problems after DNS updates.
e. VPN conflicts
VPN software often changes DNS servers. Cached entries from previous connections may interfere with the new configuration.
When flushing DNS will not help
Although useful, flushing the DNS cache is not a universal solution. It will not fix:
- Internet service outages.
- Broken websites.
- Router hardware failures.
- Wi-Fi signal problems.
- ISP network failures.
- Firewall restrictions.
- Browser extensions causing issues.
- Incorrect proxy settings.
If problems persist after clearing the cache, additional troubleshooting may be necessary.
Tips for managing DNS effectively
Maintaining healthy DNS performance involves more than simply clearing the cache whenever problems arise. Consider these best practices:
- Keep your operating system updated to benefit from the latest networking improvements and security fixes.
- Use reliable DNS providers that offer fast response times, strong uptime, and built-in security features.
- Avoid flushing the DNS cache unnecessarily. Frequent clearing provides little benefit under normal circumstances and removes useful cached records.
- Restart your router periodically, especially if multiple devices experience DNS-related issues.
- Verify DNS propagation before assuming a website configuration change has failed. Global DNS updates can take anywhere from a few minutes to 48 hours, depending on the record’s Time-to-Live (TTL).
- Scan your computer for malware if DNS problems occur frequently. Certain malicious programs modify DNS settings or poison cached records to redirect users to fraudulent websites.
- Combine DNS troubleshooting with other network diagnostics, such as checking your IP configuration, testing connectivity with
ping, or tracing routes withtraceroute, to identify the root cause of more complex networking issues.
Conclusion
The DNS cache plays an essential role in improving internet performance by storing recently resolved domain names locally, allowing websites and online services to load more quickly. However, when cached records become outdated, corrupted, or inconsistent with current DNS information, they can cause frustrating connectivity issues, website errors, and delays in accessing updated online content.
Flushing the DNS cache is a simple yet highly effective troubleshooting step that forces your device to discard obsolete records and retrieve fresh DNS information from authoritative servers. Whether you are using Windows, macOS, Linux, Android, or iOS, the process typically takes only a few seconds and poses no risk to your files, applications, or personal data.
While clearing the DNS cache is not a cure for every network problem, it is often one of the first and most effective solutions to try when websites fail to load, DNS records have recently changed, or internet connections behave unexpectedly. Combined with good network maintenance practices and reliable DNS providers, understanding how to flush your DNS cache equips you with a valuable skill for resolving common internet issues quickly and keeping your online experience running smoothly.
































































































































































































