Sometimes when you can’t access a website, it may be due to DNS caching issues rather than your ISP directly. DNS clients (like your computer or router) store the results of domain name lookups to speed up browsing. But if a bad or outdated DNS record is cached, it can prevent your browser from finding the site.
What Is DNS Cache?
DNS cache stores the IP addresses of websites you’ve visited recently. If the cache holds wrong information, you might see errors or be unable to visit certain sites until the cache updates or is cleared.
How to Fix This: Flush Your DNS Cache
Flushing the DNS cache forces your system to discard stored DNS records and fetch fresh information from DNS servers.
How to Flush DNS Cache on Windows
Open Command Prompt (type
cmdin Start menu and run as administrator).Run this command:
bash
CopyEdit
ipconfig /flushdnsYou should see:
nginx
CopyEdit
Windows IP Configuration Successfully flushed the DNS Resolver Cache.Optional: To view current DNS cache entries, use:
bash
CopyEdit
ipconfig /displaydns
Disable DNS Caching on Windows (Temporary)
If you want to temporarily stop DNS caching (until reboot), run:
arduino
CopyEdit
net stop dnscache
or
arduino
CopyEdit
sc servername stop dnscache
To permanently disable, change the DNS Client service startup type to Disabled via Services tool.
Adjust DNS Cache Settings on Windows
You can fine-tune DNS cache time-to-live (TTL) via Windows Registry:
MaxCacheTtl= max time DNS results are cached (default: 86400 seconds / 24 hours).MaxNegativeCacheTtl= max time failed lookups are cached (default: 900 seconds / 15 minutes).
Set these values in:
sql
CopyEdit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
How to Flush DNS Cache on macOS
On macOS Leopard and newer:
nginx
CopyEdit
sudo dscacheutil -flushcacheOn macOS 10.5.1 and older:
nginx
CopyEdit
sudo lookupd -flushcache
How to Flush DNS Cache on Linux
Most Linux systems use the nscd daemon for DNS caching.
Restart nscd to flush DNS cache:
swift
CopyEdit
sudo /etc/init.d/nscd restart
Summary
If you can’t see your website, try flushing your DNS cache first. This often solves DNS-related issues without needing to contact your ISP. If problems persist after flushing DNS, then it might be worth checking with your ISP or hosting provider.