The objective of DNS is to resolve names to numbers. To be more specific, it resolves URLs to IP addresses. If someone types google.com in
As discussed, it helps your computer network with servers more efficiently. In large setups, resolving domain names to their respective IP addresses can consume a fair amount of time and bandwidth. That’s where a DNS cache comes in handy.
It stores the resolution of your recently queried URLs on your computer, eliminating the need to communicate with the server every time.
You can find the details in our post “What is a DNS Cache?” for a more in-depth explanation of the DNS cache and its purpose.
Coupled along with the apparent advantages are some disadvantages. For instance, storing a copy of a resolution for later use and the original changes will leave you with bad data in your local cache and will not direct you to the intended location. Many malicious actors can also target your local cache to redirect you to harmful web pages.
Therefore, you must frequently flush your DNS cache to avoid such problems. So, how do you flush your DNS cache? If you are running Ubuntu 20.04, you can find a step-by-step guide here.
Now, if you are on Ubuntu 22.04, the “system-resolved” method will not work for you anymore. Let’s check the size of your cache currently. Open up your Ubuntu terminal and run the following:
Now, let’s flush the DNS cache of your Ubuntu system:
Depending on the size of your cache, the process will take some time. As you see, the size of the shown cache wasn’t much. It was completed instantly. Now, let’s check the stats once more to ensure this has been completed successfully.
As you see that the Current Cache Size is down to 0, it means that the DNS flush was successful.
In this guide, we learned what a DNS (Domain Name System) is, the benefits of having a local DNS cache, why it’s essential to flush the DNS cache, and how you can manually flush the DNS cache.
We also discussed how you could flush the DNS cache on Ubuntu 20.04 and Ubuntu 20.04, along with how you can view the statistics regarding your cached data.
Fortunately, the process has gotten fairly straightforward in Ubuntu 22.04.
2024 was the GenAI year. With new and more performant LLMs and a higher number…
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…