In this article, we'll explain how to clear the Domain Name System (DNS) cache on your computer.
Most operating systems use caching to store DNS lookup results, which typically improves network performance. The cache's validity is determined by the Time To Live (TTL), and as long as the DNS cache files are valid, they will respond to content requests without needing to query the DNS server.
However, this can cause issues when developing a website or configuring domain settings, as changes might not be immediately visible due to the cached DNS data.
If you're experiencing problems with the DNS cache, this guide will help you clear it on your preferred operating system or web browser.
Clearing DNS Cache on Windows
Open a Command Prompt window by typing "cmd" in the search bar and pressing Enter.
At the command prompt, type the following command:
- Press Enter. Your DNS cache will now be cleared.
Clearing DNS Cache on macOS
Open a Terminal window. You can do this by navigating to Applications > Utilities > Terminal or by pressing the F4 key and searching for "Terminal" in the Launchpad.
Type the appropriate command for your version of macOS. You can find the correct command on the official Apple support website.
Press Enter. Your DNS cache will be cleared.
Clearing DNS Cache on Linux
Some Linux distributions do not use DNS caching at the operating system level. However, certain applications, like web browsers, maintain their own internal caches. To clear an application's DNS cache, simply restart the application.
If your Linux system does use a DNS caching service, refer to the documentation available online for specific instructions.
Clearing DNS Cache in Google Chrome
- Open Google Chrome and type the following in the address bar:
`chrome://net-internals/#dns`
Chrome will display a list of hosts in its internal DNS cache. Click Clear host cache.
Next, type the following in the address bar:
`chrome://net-internals/#sockets`
- Click Close idle sockets and then Flush socket pools. Your DNS cache is now cleared.