Table of Contents

DNS resolves domain names to IP addresses so people do not have to remember a series of numbers (IP addresses) when trying to visit a website. In order the speed up this process and reduce the traffic on the DNS servers, most computer operating systems will store or cache DNS lookups on your computer locally. At times, you may need to clear the cache to see changes.
In this tutorial, we’ll show you how to clear the DNS cache for the major operating systems on the market. Typically, this process is referred to as clearing or flushing the local DNS cache.
Flushing Local DNS Cache in Windows
Open the command line window, and depending on your version of Windows, this can be done in one of the following ways:
- Windows 11:
- Click the search box on the taskbar
- Type PowerShell in the search box
- Click the Windows PowerShell app to open it
- Windows 10:
- Click on the Start Menu
- Type cmd in the search box
- Click the Command Prompt app to open it
- Windows 7 and Vista:
- Click on the Start Menu
- Type cmd in the search box
- Right-click on cmd in the program search results and choose Run as Administrator.
- Windows 98/NT/2000/XP
- Click on the Start Menu
- Select Run
- Type or select cmd to open the command line window
Once the command line window is open type the following command at the prompt and hit enter.
After the flushdns is completed, type exit to close the command line window.
Flushing Local DNS Cache in Mac OS
OS X 10.7 and above
- Open a Terminal window from Applications > Utilities.
- Type
and press Return. - Close the terminal window.
OS X 10.6 and below
- Open a Terminal window
- Type this command and hit Return
- Close the terminal window
To easily clear the cache on an iOS device, turn on Airplane Mode for 5-10 seconds and turn it back off by going to Settings > Airplane Mode. Alternatively, you can reboot your phone.
Flushing Local DNS Cache in Linux
Flushing the local DNS cache on Linux depends on which service handles your DNS caching. Typical services include systemd-resolved, nscd, dnsmasq, or BIND. Below are the typical methods for each:
To clear the cache on an Android device, open Chrome, tap the three vertical dots at the top-right corner, choose History, and then tap Clear browsing data.
1. systemd-resolved (Ubuntu 18.04+, many modern distributions)
If your system uses systemd-resolved, you can flush the DNS cache with:
To confirm that your system is using systemd-resolved
, check:
and/or verify that /etc/resolv.conf
is managed by systemd-resolved
.
2. nscd (Name Service Cache Daemon)
If you have nscd (Name Service Cache Daemon) installed:
or on older (SysVinit) systems:
If nscd
is not installed, you can typically install it on Debian/Ubuntu with:
and on Fedora/CentOS/RHEL with:
3. dnsmasq
If you are running dnsmasq as a local DNS server/cache, restart it:
or on older systems:
4. BIND
If you’re using BIND as a caching DNS server, you can clear the cache by running:
If you want to flush only specific domain entries, you can use:
5. NetworkManager (alternative approach)
Some Linux distributions (notably Ubuntu or Fedora) will also leverage NetworkManager for DNS settings. You can try:
This doesn’t directly flush a DNS cache if you don’t have a dedicated caching service running, but it may reset DNS-related states.
Checking Which Method Applies
Check if systemd-resolved is active
Check if nscd is running:
Check if dnsmasq is active:
Pick the flush method based on which service is actually in use.
Hi,
I’ve uploaded a new home page to my public_html file but it’s not showing on internet? What can I do to resolve this??
Thanks
Sorry for the problem with your new home page not showing. I would first double-check and clear your browser cache. If you haven’t done that on your browser, then it’s possible you’re looking at a saved version of your site from your browser cache. If that doesn’t resolve it, then you should contact support or speak with a web developer to make sure that everything is properly setup.
After changing ip address in the host file and when tested it locally, site displays “The requested service is temporarily unavailable. It is either overloaded or under maintanence. Please try later.”
What could be the possible reason /how could i resolve it
Hello,
The most common cause for that error is port 80 not being open on the IP address you are trying to connect to. I would ensure you have entered the correct IP, If you have them I would recommend contacting technical support to have them check the configuration of the site and the server.
Best Regards,
Kyle M
Hi, I am using Windows 10 on a Dell laptop and I added the line needed in my Hosts file (IP example.com www.example.com), I went into cmd as Admin and typed ipconfig /flushdns, I cleared my cache on all internet browsers I use, I did a Disk Cleanup and I restarted my computer and for some reason when I go to my site or open my website WordPress Admin account it is still pointing to my old hosting company. I have not switched my dns yet to point to InMotion beccause I still need to test the site before I do. But I can’t test it if I can’t get my computer to point to InMotions server. Please let me know what else I can try to make sure all cache is cleared. Thanks in advance
You may want to check to make sure that you edited the source file as administrator, otherwise the changes won’t be saved. We have a full guide on setting a hosts file in Windows. After following those steps, make sure to clear the browser cache first before testing.
Thanks, my website loaded immideately afterflushing my DNS!
i am using windows 8 i am also 2 times sucessfully clear DNS cache but my site is not open proper show message (https://www.example.com/cgi-sys/suspendedpage.cgi
This Account Has Been Suspended
how to solve this problem please solve this as soon as possbile.
www.example.com
Hello Moin,
Thank you for contacting us. When I navigate to your site, I see “we are sorry but this store is down for maintenance
please try again later …”
Have you tried clearing your browser cache, testing in a different browser (such as Chrome FireFox, Safari, IE, etc.), or testing on a different computer, or device?
Are you able to try on different network, for example if you are on a college campus, library, or coffeeshop.
If it is only on one computer, check that you have not made any Host File Modifications.
Thank you,
John-Paul
The instructions you show for OS X 10.10 no longer work as of 10.10.4 as ‘discoveryutil’ was removed with that update. Per https://support.apple.com/en-us/HT202516, they’ve reverted to using “sudo killall -HUP mDNSResponder” for v10.10.4.
In the end, restarting my computer seemed to work best (OS X v10.10.4)
Hello Jenett,
Thanks for the information – I did update the article to reflect the change mentioned in the link that you provided.
If you have any further questions or comments, please let us know.
Regards,
Arnel C.
Youshould update these infos.
Use what apple suggests :
https://support.apple.com/en-ca/HT202516
Hello Jeffrey,
Thank you for your suggestion. I have updated the article with the latest information as per your recommendation.
The steps for clearing cache in Mac OSX should now be accurate.
If you have any further suggestions, please let us know.
Thank you,
John-Paul
I have windows 8 and I have tried 3 times to flush dns 3 times and it doesn’t work.
Hello Pete,
The command is the same for Windows 8, however is there a certain domain you are trying to go to but your DNS is cached? Can you provide such domain or why you are needing to flush your local DNS cache?
Kindest Regards,
TJ Edens