DNS cache is a temporary database that stores information about previous DNS lookups. In other words, whenever you visit a website, your OS and web browser will keep a record for the domain and the corresponding IP address. This eliminates the need for repetitive queries to the remote DNS servers and allows your OS or browser to resolve the website’s URL quickly.
However, in some situations like troubleshooting network issues or after changing DNS resolvers, you will need to flush the DNS cache. This will clear the cached DNS entries and perform a subsequent lookup to resolve the domain based on newly configured DNS settings.
This guide provides instructions on how to flush the DNS cache on different operating systems and web browsers.
Clear/Flush DNS Cache on Windows
The process of clearing the DNS cache is the same for all Windows versions. You need to open the command prompt with administrator privileges and run ipconfig /flushdns
.
- Type cmd in the Windows search bar.
2. Right-click on Command Prompt and click Run as administrator. This will open up the Command Prompt window.
3. On the command line, type the following line and press Enter
ipconfig /flushdns
4. Additionally you can run
ipconfig /release followed by ipconfig /renew
Clear/Flush DNS Cache on Linux
Most modern Linux distributions such as Ubuntu 18.04 are using systemd resolved service to cache DNS entries.
To find out whether the service is running use the following command:
Copysudo systemctl is-active systemd-resolved.service
If the service is running, the command will print active. Otherwise, you will see inactive.
To clear the Systemd Resolved DNS cache, type:
Copysudo systemd-resolve --flush-caches
On success, the command doesn’t return any message.
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.