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.

Spam Filter Customization Guide

Spam filter customization is essential to keep your inbox organized and secure. Proper configuration reduces…

How to Create Custom Name Servers for Your Dedicated Server?

There’s a great crowd of webmasters searching on custom name servers, especially for branding. But…

How to Use WHM to Create MySQL Profiles

This tutorial outlines the process of creating MySQL profiles via WHM. MySQL profiles govern the…