Flushing Your Local DNS Cache
Clear outdated DNS data. Flush your local DNS cache on Windows, macOS, and Linux to fix connection errors and see site updates instantly.
Introduction
Your computer saves (caches) DNS records to load websites faster. However, if a website moves to a new server or changes its IP address, this saved data can become outdated, preventing you from seeing the new site. “Flushing” the cache forces your computer to look up the new, correct DNS records.
Prerequisites
- Admin access on your local computer.
Step-by-Step Instructions
Commands are Operating System-specific. Find your system, below:
Windows
- Open the Command Line.
- Windows 10/11: Right-click the Start button and select Windows Terminal (Admin), PowerShell (Admin), or Command Prompt (Admin).
- Older Versions: Search for
cmdin the Start menu, right-click Command Prompt, and select Run as Administrator.
- Type the following command and press Enter:
ipconfig /flushdns- You should see the message: Successfully flushed the DNS Resolver Cache.
Mac OS X
- Press Command + Space to open Spotlight, type Terminal, and press Enter.
- Copy and paste the command below that matches your OS version. You will be asked for your administrator password (it will not show on screen as you type).
macOS 11 (Big Sur), 12 (Monterey), 13 (Ventura), 14 (Sonoma), 15 (Sequoia) & newer:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSRespondermacOS 10.11 (El Capitan) through 10.15 (Catalina):
sudo killall -HUP mDNSResponderLinux
Many current Linux distributions do not utilize local DNS resolver cache like Windows and Mac OS X. Check the website for your Linux distribution to find information regarding default included software to find out if your Linux installation uses local DNS caching.
Most modern Linux distributions (Ubuntu 18.04+, Fedora, etc.) use systemd-resolved.
For Systemd-based distributions (Modern Ubuntu, Debian, Fedora)
sudo resolvectl flush-cachesFor distributions using NSCD
sudo /etc/init.d/nscd restart