How to Flush DNS cache in Ubuntu
DNS Cache stores the IP Addresses of Web Servers that host the website. Some times you need to Flush, Reset or clear your DNS cache to resolve the new ip address of your favorite website or to take effect /etc/hosts file changes.
Flush DNS cache in Ubuntu
Flush DNS using systemd :
Open your terminal app and type the below command and hit enter.
sudo systemd-resolve --flush-caches
You can check you status of your current cache size using the below command in terminal.
sudo systemd-resolve --statistics
Flush DNS using dns clean:
To flush DNS cache on ubuntu, you need to open terminal and run the below command.
sudo /etc/init.d/dns-clean restart
or
sudo /etc/init.d/networking force-reload
This should work very well on Ubuntu 14.04 LTS and later. If it is not working for you , can try the above method to flush your DNS,
(more…)