How To Flush DNS Cache Locally

Smart Web Creative - Knowledge Base Article - How To Flush DNS Cache Locally

Troubleshooting website issues can be challenging, especially when you’re unsure where to begin. One common issue is a corrupt local DNS cache, which can prevent your computer from reaching specific websites or servers. In this guide, Smart Web Creative will show you how to clear or flush DNS cache locally on various operating systems.

Flush Local DNS Cache on Windows

Clearing your local DNS cache on Windows is straightforward using the Command Prompt or Windows PowerShell. Here’s how you can flush your DNS cache:

Step 1: Open an elevated command prompt from the Power Users menu by typing the shortcut Windows Key + x. Then, click on Windows PowerShell (Admin).

Step 2: Input the following command and press Enter:

ipconfig /flushdns

You should see the following confirmation message:

Successfully flushed the DNS Resolver Cache.

Flush Local DNS Cache on macOS

For macOS, flushing your DNS cache requires running a command in the terminal. The command varies depending on your macOS version. Follow these steps to flush your DNS cache:

Launch Terminal and enter the appropriate command for your OS version. You will also need to input your password for permission to run these commands.

Mac OS X 10.11 El Capitan, macOS 10.12 Sierra, macOS 10.13 High Sierra, macOS 10.14 Mojave, and macOS 10.15 Catalina:

sudo killall -HUP mDNSResponder

OS X 10.10 Yosemite:

sudo discoveryutil udnsflushcaches

OS X 10.7 Lion, 10.8 Mountain Lion, and 10.9 Mavericks:

sudo killall -HUP mDNSResponder

OS X 10.6 Snow Leopard:

sudo dscacheutil -flushcache

Flush Local DNS Cache on Linux

Many current Linux distributions do not utilize a local DNS resolver cache like Windows and macOS. If you are unsure whether your Linux installation uses local DNS caching, check the documentation for your Linux distribution.

Using Name Service Caching Daemon (NSCD) on Linux:

If you have NSCD installed, you can flush your DNS cache with the following commands:

To clear the local DNS cache for the current user:

nscd -i hosts

To clear the local DNS cache for all users:

nscd -I hosts

Using systemd in Ubuntu-based Linux Distributions:

Ubuntu-based distributions using systemd-resolved for DNS caching can use the following command to flush the DNS cache. You will need to enter your password to complete the process.

sudo systemd-resolve --flush-caches

Other Ubuntu-based Options on Linux:

Some Ubuntu and Debian-derived distributions use this command to flush the DNS cache:

sudo service dns-clean restart

Other Options on Linux:

For Linux distributions that are not Ubuntu-based, you may use this command to flush your DNS cache:

sudo /etc/init.d/dns-clean start

Final Thoughts

Don’t let access issues to specific websites frustrate you. Knowing how to flush DNS cache locally is a quick and effective way to determine if the issue lies deeper. Use these tools to troubleshoot and resolve connectivity problems.

Other Helpful Articles

Online Generator for Writing a Privacy Policy

Many websites need a privacy policy page. WordPress actually has a pre-built privacy policy page that users can edit. However, editing what they give you can be a little overwhelming. Furthermore, depending on your business, it may be better to use a lawyer to write up a more detailed privacy

Read More »
Smart Web Creative - Quick Resources: Date and Time in PHP

Quick Resources: Date and Time in PHP

If you want to display the date and time in PHP, it can be somewhat confusing what letters to use to bring in those elements. Below is a list of all the PHP date and time options that you can use on your site: To utilize these options in PHP,

Read More »

What Do You Need Done?:

(Please check all that apply)

Tell Us About You

Almost Done!

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info