Clearing your DNS cache forces your computer to fetch the latest DNS records from nameservers, which helps you see updated website information immediately. When you change DNS settings at OBHost, the updates happen instantly on our nameservers, but your local computer may still show outdated information for several hours due to cached DNS data. Flushing your DNS cache solves this problem by removing stored DNS records and forcing fresh lookups.
Why DNS Changes Take Time to Appear
Every DNS record includes a TTL (Time To Live) value that tells computers and servers how long to store that information before checking for updates. Most DNS records use a TTL of 14400 seconds (4 hours), though some have a 24-hour TTL (86400 seconds). This caching system reduces internet traffic by preventing constant DNS lookups, but it means DNS changes can take hours to propagate fully.
The delay becomes longer because multiple layers of caching exist. Your operating system caches DNS data to reduce requests to your internet provider. Web browsers maintain their own separate DNS cache. Your router may also cache DNS records. All these layers working together mean that even after the TTL expires on upstream servers, your device might still show old information.
How to Clear DNS Cache on Windows
Windows stores DNS information in a local resolver cache that you can flush using a simple command. This works for Windows 7, 8, 10, and 11.
Steps to flush DNS on Windows:
- Open Command Prompt as administrator (search for "cmd" in the Start menu, right-click it, and select "Run as administrator")
- Type the following command and press Enter:
ipconfig /flushdns
You should see a confirmation message stating "Successfully flushed the DNS Resolver Cache." This clears all cached DNS entries immediately.
To verify the cache is cleared:
You can view current DNS cache contents with this command:
ipconfig /displaydns
After flushing, this command should return minimal results or show only recently accessed domains.
How to Clear DNS Cache on Mac
Mac computers require different commands depending on which version of macOS you're running. You'll need to use the Terminal application with administrator privileges.
Opening Terminal:
- Go to Applications > Utilities > Terminal
- Or use Spotlight (Command + Space) and type "Terminal"
For macOS Monterey, Big Sur, Catalina, Mojave, High Sierra, and Sierra (10.12+):
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
For macOS El Capitan and Yosemite (10.10 - 10.11):
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
For macOS Lion and Mountain Lion (10.7 - 10.8):
sudo killall -HUP mDNSResponder
For macOS Leopard and Snow Leopard (10.5 - 10.6):
sudo dscacheutil -flushcache
For macOS versions before 10.5:
sudo lookupd -flushcache
You'll be prompted to enter your administrator password. Type it (you won't see characters appear) and press Enter. The command executes silently without confirmation messages in most cases.
How to Clear DNS Cache on Linux and Ubuntu
Most Linux distributions don't cache DNS by default unless you've installed a DNS caching service. If you're running a caching service like nscd (Name Service Cache Daemon), you can restart it to clear the cache.
For systems running nscd:
sudo /etc/init.d/nscd restart
Or on newer systems using systemd:
sudo systemctl restart nscd
For systems running systemd-resolved:
sudo systemd-resolve --flush-caches
Or on newer versions:
sudo resolvectl flush-caches
For systems running dnsmasq:
sudo /etc/init.d/dnsmasq restart
Or with systemd:
sudo systemctl restart dnsmasq
If you haven't installed any DNS caching service, Linux applications query DNS servers directly, so no cache clearing is necessary.
Additional Steps: Clear Browser DNS Cache
Web browsers maintain their own DNS cache separate from your operating system. After clearing your system DNS cache, you should also clear your browser cache or restart your browser completely.
Quick browser cache clearing:
- Chrome/Edge: Navigate to chrome://net-internals/#dns and click "Clear host cache"
- Firefox: Close and restart the browser, or go to about:networking#dns and click "Clear DNS Cache"
- Safari: Close and restart the browser (Safari doesn't have a separate DNS cache clear option)
Alternatively, simply close all browser windows and reopen your browser. This forces the browser to discard its DNS cache and use fresh system DNS data.
When to Clear Your DNS Cache
You should clear your DNS cache in these situations:
- After changing nameservers or DNS records for your domain
- When a website shows old content after you've updated it
- If you're experiencing "site not found" errors for domains that should be working
- After switching hosting providers
- When troubleshooting website connectivity issues
- If you suspect DNS poisoning or security issues
At OBHost, DNS changes propagate instantly on our nameservers, but clearing your local cache ensures you see these updates immediately rather than waiting for the TTL to expire.
Frequently Asked Questions
How long does it take for DNS changes to show after clearing cache?
After clearing your DNS cache, you should see DNS changes immediately on the next website visit. Your computer will query the nameservers directly and receive the current DNS records. However, if you're still seeing old information, check that you've also cleared your browser cache and that the DNS changes have actually been saved on the server side.
Will clearing DNS cache affect my internet connection?
Clearing your DNS cache will not disrupt your internet connection. You might notice slightly slower initial page loads for websites immediately after flushing the cache because your computer needs to perform fresh DNS lookups, but this delay is minimal (usually under a second). Once new records are cached, performance returns to normal.
How often should I clear my DNS cache?
You don't need to clear your DNS cache regularly under normal circumstances. Only clear it when troubleshooting DNS issues, after making DNS changes, or when you suspect cached records are causing problems. Clearing the cache too frequently can actually slow down your browsing experience by forcing unnecessary DNS lookups.
What's the difference between flushing DNS cache and renewing IP address?
Flushing DNS cache removes stored domain name to IP address mappings, while renewing your IP address (using ipconfig /release and ipconfig /renew on Windows) deals with your computer's network connection to your router or ISP. DNS cache flushing fixes issues with domain name resolution, whereas IP renewal fixes issues with network connectivity. They solve different types of problems.
If you need assistance with DNS configuration or have questions about propagation times, our support team is available 24/7. Visit our contact page or email support@obhost.org for help with any DNS-related issues.