Search the articles in our knowledge base!

How to clear the local DNS cache in Linux?

You can flush your local DNS cache in Linux by following these easy steps:

1. Open your terminal to use the command line.

2. Log in as root using the su command:

user@host:~$ su
Password: <type your root password>
root@host:

3. Restart the name service cache daemon:

root@host: /etc/init.d/nscd restart

Please note that the name service cache deamon (nscd) may not be installed by default on your Linux distribution. You should be able to install it through the package manager of your distribution - yum for RedHad-based distros (Fedora, CentOS) and apt-get for Debian-based distros (Ubuntu, Kubuntu).

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!
VN:F [1.9.22_1171]
Rating: 2.5/5 (10 votes cast)
How to clear the local DNS cache in Linux?, Rating 2.5 out of 5 based on 10 votes

Latest articles from Linux FAQ