Step-by-Step Guide to Clearing DNS Cache

Updated on August 6, 2025, by ITarian

how to flush dns cache

Is your internet connection acting up, or are websites failing to load properly? One effective solution is to flush DNS cache. Knowing how to flush DNS cache helps clear outdated records, resolve connectivity issues, and improve security.

This guide explains how to clear DNS cache on Windows, macOS, and Linux, why it’s important, and how IT managers can use it for troubleshooting and cybersecurity purposes.

What Is DNS Cache and Why Should You Flush It?

The DNS cache stores recent domain lookups to speed up website loading. However, outdated or corrupted cache entries can cause issues like:

  • Websites not loading or displaying outdated content.

  • Connection errors when DNS records change.

  • Security risks due to DNS spoofing or cache poisoning.

Flushing the DNS cache forces your system to retrieve updated DNS records.

How to Flush DNS Cache on Windows

Using Command Prompt

  1. Press Windows + R, type cmd, and press Enter.

  2. Type the following command:

cmd

CopyEdit

ipconfig /flushdns

 

  1. Press Enter. You should see: “Successfully flushed the DNS Resolver Cache.”

Using PowerShell

  1. Open PowerShell as Administrator.

  2. Type:

powershell

CopyEdit

Clear-DnsClientCache

 

  1. Press Enter.

How to Flush DNS Cache on macOS

For macOS Ventura and Later

  1. Open Terminal.

  2. Type:

bash

CopyEdit

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

 

  1. Enter your password and press Enter.

For Older macOS Versions

Use the same command but confirm compatibility with your macOS version:

bash

CopyEdit

sudo killall -HUP mDNSResponder

 

How to Flush DNS Cache on Linux

Different distributions may use slightly different commands.

For Most Linux Systems

bash

CopyEdit

sudo systemd-resolve –flush-caches

 

For Ubuntu/Debian Systems

bash

CopyEdit

sudo /etc/init.d/nscd restart

 

How to Verify DNS Cache Has Been Flushed

On Windows:

cmd
CopyEdit
ipconfig /displaydns

  •  This should return minimal or no entries.

  • On macOS/Linux:
    Use dig or nslookup commands to confirm updated DNS responses.

Why IT Managers Should Flush DNS Cache

  • Troubleshooting: Helps fix network issues without restarting systems.

  • Security: Clears potentially malicious DNS entries.

  • Policy Enforcement: Ensures updated domain access policies take effect.

Additional Tips for DNS Management

  • Use trusted DNS servers (Google DNS, Cloudflare, OpenDNS).

  • Automate cache flushing on enterprise systems using scripts.

  • Monitor DNS traffic for suspicious activity with security tools.

FAQs About Flushing DNS Cache

1. Will flushing DNS affect my internet connection?

No, it just clears cached records. Your device will fetch fresh DNS data.

2. How often should I flush DNS cache?

Whenever you face DNS issues or after changing DNS settings.

3. Does flushing DNS improve speed?

It may fix slow-loading websites caused by outdated records.

4. Is flushing DNS safe?

Yes, it’s completely safe and recommended for troubleshooting.

5. Can malware affect DNS cache?

Yes, some malware alters DNS settings. Always use antivirus software.

Final Thoughts

Knowing how to flush DNS cache is an essential troubleshooting step for IT managers and everyday users. It fixes connectivity issues, updates domain records, and improves network security.

Want enterprise-grade IT and network security management?
Sign up for free at Itarian to manage and protect your organization’s devices effectively.

See ITarian’s IT Management Platform in Action!
Request Demo

Top Rated IT Management Platform
for MSPs and Businesses

Newsletter Signup

Please give us a star rating based on your experience.

1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5 (1 votes, average: 5.00 out of 5, rated)Loading...
Become More Knowledgeable