In this article, I will explain how to clear the Domain Name System (DNS) cache on your computer.
A lot of operating systems use caching to store DNS lookup results, which usually helps accelerate network performance. The cache’s validity period is determined by Time To Live (TTL), and as long as the DNS cache files are still valid on the internet, they will respond to content requests without having to go through the DNS server.
However, this might be a problem when developing a website or configuring domain settings. Due to the DNS cache, changes might not be visible for some time.
So, if you are facing problems with DNS cache, this article is just for you. Here are the steps to clear DNS cache for your preferred computer's operating system or web browser.
Windows Operating Systems
- Open a DOS command window. To do this, type
cmd
in the search bar and press Enter.
- At the command prompt, type the following command:
ipconfig /flushdns
- Press Enter, and your DNS cache will be cleared.
macOS Operating System
- Open a Terminal window, which can be found via Applications → Utilities → Terminal, or press the F4 key and enter "Terminal" in the Launchpad’s search field.
- Type the appropriate command for your macOS version. You can find the correct command on the official Apple support website.
- Press Enter, and the DNS cache will be cleared.
Linux Operating System
Some Linux distributions do not use DNS caching at the operating system level. However, some applications, such as web browsers, maintain their own internal caches. To clear an application’s DNS cache, you will need to restart the application.
If your Linux computer uses a DNS caching service, you will need to check the internet for documentation.
Google Chrome Browser
- Open Google Chrome and type the following in the address bar:
chrome://net-internals/#dns
- Google Chrome will display a list of hosts in its internal DNS cache.
- Click "Clear host cache".
- In the address bar, type:
chrome://net-internals/#sockets
- Click "Close idle sockets" and then click "Flush socket pools". Your DNS cache is now cleared.
These steps will help you clear the DNS cache on your computer or browser, ensuring you can see the most recent changes to your DNS settings.