This article explains how to flush the local DNS cache in a Linux server. If your computer encounters difficulty accessing a particular website or server, it could be credited to a corrupted local DNS cache.

Follow the steps-

  1. Access the command line by opening your terminal.
  2. Using the su command, log in as the root user-
    user@host:~$ su 
    Password: (type your root user password here) 
    root@host: 
  3. Restart the name service cache daemon (NSCD)-
    root@host: /etc/init.d/nscd restart
  4. NSCD, which stands for Name Service Caching Daemon, is a commonly used DNS caching application in Linux.
  5. If you have NSCD installed, you can clear the local DNS cache for the current user by running the following command in your terminal or shell. To flush the local DNS cache for the current user-
    nscd –i hosts
  6. To flush the local DNS cache for all users-
    nscd -I hosts

Note: The name service cache daemon (NSCD) may not come pre-installed on your Linux system. You can install it using your distribution’s package manager – use yum for RedHat-based distributions like Fedora and CentOS, or apt-get for Debian-based distributions such as Ubuntu and Kubuntu. 

This way, you can flush the local DNS cache in the Linux server. If you liked our article then you will surely love our support. Additionally, you can discover How To Manage DNS Zone Editor in cPanel

Popular Posts You May Read

Explore more hosting insights, tips and industry updates.

What Is Email Spam – Definition and Prevention

In online advertisements, there is a common behavior of sending mass e-mails to many users…

What is the Best Way to Make a Blog Post for your WordPress Website?

We’ll show you how to make a blog post for your WordPress website in this…

Offshore Hosting – What Is It and Why Do Businesses Use It?

Offshore hosting refers to hosting a website or application on servers located outside your home…