The DNS cache is a transitority database about an operational formula that retail outlets perform DNS lookups (data about Internet sites and Internet domains at scale). How it works is simple: when you stop on an online page multiple times, its operation formula retrieves the data from the online page from the locally stored cache, rather than having to use the slower public DNS records. For this reason, loading those sites from the Internet is significantly faster.
However, there are times when a DNS cache may be corrupted. You may also notice an example when it has changed, but your browser insists on loading the previous (cached) edition of the site.
When that happens, what do you do? You empty your operating system’s DNS cache. Once the DNS cache is emptied, the initial load of Internet sites will be slower, but they will be successful. Once a site’s DNS is cached, the load on that site will be accelerated.
How you empty the DNS cache depends on your operating system. I need to show you how simple it is to flush the DNS cache into the Linux operating system.
VIEW: Quickly resolve your PC with those 10 PowerShell command applets (TechRepublic download)
All I want to do is a Linux distribution that uses systemd and a user with sudo privileges. This same procedure will work with Ubuntu and Red Hat-based distributions. I tried the procedure on Ubuntu 18. 04 and CentOS 8 and it works perfectly. .
The first thing you need to do is make systemd-solved run. To do this, open a terminal window on your desktop or server and run the command:
At the launch of this order, you will only see:
If so, you can go on. Then we’ll look at some statistics for the DNS cache with the command:
When you run this command, you see a list of DNSSEC transactions, cache, and verdicts (Figure A).
Figure A
DNS Cache Statistics on Ubuntu Server 18. 04.
The data bit is the existing length of the cache, we will reset it to 0, emptying the cache with the command:
Again, factor the command:
Now you see that the length of the existing cache is 0 (Figure B).
Figure B
We control emptying our DNS cache on Ubuntu Server 18. 04.
If you are using a Red Hat-based distribution, other than CentOS, you may find that the systemd-resolution command works. If this is the case, you may want to verify one of the following commands to flush your DNS cache:
Yes:
One or the other, one of the commands presented here will flush the DNS cache of your Red Hat-based Linux distribution.
And that’s all it takes to flush this DNS cache. If you find that sites are not loading properly, or that something unstable is happening on your network and you cannot identify the problem, give this DNS a little and see if it doesn’t resolve the issue.
How a Network Administrator: A Cheat Sheet (TechRepublic)
Recruitment Kit: Network Administrator (TechRepublic Premium)
What is NDS? How the All Software Defined Network (ZDNet)
The most productive VPN for 2020 (CNET)
5G: more reading required (TechRepublic on Flipboard)
Jack Wallen is an award-winning techRepublic, The New Stack and Linux New Media. He has covered a variety of topics for over twenty years and is an avid promoter of open source. For more information about Jack Wallen, visit his jackwallen website. . . .