How Do I Clear My Local DNS Cache? Updated on February 17, 2025 by Carrie Smaha 3 Minutes, 16 Seconds to Read DNS resolves domain names to IP addresses so people do not have to remember a series of numbers (IP addresses) when trying to visit a website. In order the speed up this process and reduce the traffic on the DNS servers, most computer operating systems will store or cache DNS lookups on your computer locally. At times, you may need to clear the cache to see changes. In this tutorial, we’ll show you how to clear the DNS cache for the major operating systems on the market. Typically, this process is referred to as clearing or flushing the local DNS cache. Table of Contents Flushing Local DNS Cache in Windows Flushing Local DNS Cache in Mac OS OS X 10.7 and above OS X 10.6 and below Flushing Local DNS Cache in Linux 1. systemd-resolved (Ubuntu 18.04+, many modern distributions) 2. nscd (Name Service Cache Daemon) 3. dnsmasq 4. BIND 5. NetworkManager (alternative approach) Checking Which Method Applies Flushing Local DNS Cache in Windows Open the command line window, and depending on your version of Windows, this can be done in one of the following ways: Windows 11: Click the search box on the taskbar Type PowerShell in the search box Click the Windows PowerShell app to open it Windows 10: Click on the Start Menu Type cmd in the search box Click the Command Prompt app to open it Windows 7 and Vista: Click on the Start Menu Type cmd in the search box Right-click on cmd in the program search results and choose Run as Administrator. Windows 98/NT/2000/XP Click on the Start Menu Select Run Type or select cmd to open the command line window Once the command line window is open type the following command at the prompt and hit enter. ipconfig /flushdns After the flushdns is completed, type exit to close the command line window. exit Flushing Local DNS Cache in Mac OS OS X 10.7 and above Open a Terminal window from Applications > Utilities. Type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderand press Return. Close the terminal window. OS X 10.6 and below Open a Terminal window Type this command and hit Return sudo dscacheutil -flushcache Close the terminal window To easily clear the cache on an iOS device, turn on Airplane Mode for 5-10 seconds and turn it back off by going to Settings > Airplane Mode. Alternatively, you can reboot your phone. Flushing Local DNS Cache in Linux Flushing the local DNS cache on Linux depends on which service handles your DNS caching. Typical services include systemd-resolved, nscd, dnsmasq, or BIND. Below are the typical methods for each: To clear the cache on an Android device, open Chrome, tap the three vertical dots at the top-right corner, choose History, and then tap Clear browsing data. 1. systemd-resolved (Ubuntu 18.04+, many modern distributions) If your system uses systemd-resolved, you can flush the DNS cache with: sudo systemd-resolve --flush-caches To confirm that your system is using systemd-resolved, check: systemctl is-active systemd-resolved and/or verify that /etc/resolv.conf is managed by systemd-resolved. 2. nscd (Name Service Cache Daemon) If you have nscd (Name Service Cache Daemon) installed: sudo systemctl restart nscd or on older (SysVinit) systems: sudo service nscd restart If nscd is not installed, you can typically install it on Debian/Ubuntu with: sudo apt-get install nscd and on Fedora/CentOS/RHEL with: sudo yum install nscd 3. dnsmasq If you are running dnsmasq as a local DNS server/cache, restart it: sudo systemctl restart dnsmasq or on older systems: sudo service dnsmasq restart 4. BIND If you’re using BIND as a caching DNS server, you can clear the cache by running: sudo rndc flush If you want to flush only specific domain entries, you can use: sudo rndc flushname example.com 5. NetworkManager (alternative approach) Some Linux distributions (notably Ubuntu or Fedora) will also leverage NetworkManager for DNS settings. You can try: sudo systemctl restart NetworkManager This doesn’t directly flush a DNS cache if you don’t have a dedicated caching service running, but it may reset DNS-related states. Checking Which Method Applies Check if systemd-resolved is active systemctl is-active systemd-resolved Check if nscd is running: systemctl status nscd Check if dnsmasq is active: systemctl status dnsmasq Pick the flush method based on which service is actually in use. Trust your business to an industry leader in fast and reliable website hosting solutions. InMotion Hosting offers secure web hosting with 99.99% uptime, 24/7 expert human support, and 100% money-back guarantee. Share this Article Carrie Smaha Senior Manager Marketing Operations Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth. More Articles by Carrie Related Articles How to Change Your Domain Nameservers in AMP How To Fix the “DNS Server Not Responding” Error on Windows and Mac Wildcard Subdomains and DNS How to Set Up Custom Nameservers for Resellers Using Custom Nameservers Domain Names – Registrar Transfer versus NameServer Change How Do I Clear My Local DNS Cache? How to Use the Track DNS Tool in cPanel Using Custom Nameservers as a Reseller What Is a Name Server?