📅  最后修改于: 2023-12-03 15:30:47.823000             🧑  作者: Mango
One of the common ways to troubleshoot networking problems is to clear or flush the DNS cache on your computer. In this article, we will explain how to flush DNS using Bash Shell scripts.
Before proceeding with the steps, ensure that you have the following:
To flush DNS using Bash Shell, follow the steps below:
Open a terminal window and switch to the root user using the below command:
sudo su
To flush the DNS cache, run the below command:
systemctl restart network-manager
This command will stop and start the network-manager
service, which clears the DNS cache.
Alternatively, you can use the following command to restart the networking service:
systemctl restart networking
You can also flush the DNS cache by restarting the DNS service using the following command:
systemctl restart systemd-resolved.service
This command will restart the systemd-resolved
service, which clears the DNS cache.
In this tutorial, we have explained how to flush the DNS cache using Bash Shell. Flushing the DNS cache can help resolve networking problems and improve performance.