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.

Business, Technology and Dedicated Servers

Today, with so much advancement in the technology, doing online business has become one of…

How to Install iotop in Linux

If you manage a Linux server and notice slow performance, high disk usage, or unexplained…

Install Fail2ban on Ubuntu

This guide explains how to install Fail2ban on Ubuntu 22.04. A strong intrusion prevention software…