What clearing DNS does and when you need it
Clearing your DNS cache means deleting the stored records your device uses to translate website names into addresses. When you type a web address like google.com, your device looks it up in this cache first before asking the internet. If that cached information is wrong or outdated, you get connection errors, slow loads, or pages that won't load at all.
You need to clear DNS when a website you know works suddenly stops loading, when you get "server not found" errors on sites that were working yesterday, or after your internet provider makes changes to their DNS servers. It's also worth trying if a website redesign isn't showing up on your screen even after refreshing.
Clearing DNS is safe — your device will rebuild the cache automatically as you browse. The process takes less than a minute and requires no special tools or administrator permission on most devices.
Key Takeaways
- DNS cache stores website addresses so your device doesn't have to look them up every time, but outdated information in that cache can break connections.
- Windows, Mac, and Linux each have different commands to clear DNS, and the steps differ depending on whether you're using the command line or settings menus.
- After clearing DNS, restart your browser completely — closing and reopening it — so it fetches fresh address information.
- If clearing DNS doesn't fix the problem, the issue is usually with your internet connection or the website itself, not your device's cache.
Clearing DNS on Windows
On Windows, the fastest method is using the Command Prompt. Open the Start menu, type cmd, right-click "Command Prompt," and select "Run as administrator." A black window will open.
Type this exact command and press Enter: ipconfig /flushdns. You'll see a message that says "Successfully flushed the DNS Resolver Cache." Close the Command Prompt window. That's it — your DNS cache is now empty.
If you prefer not to use the command line, you can also clear DNS through Windows Settings on Windows 10 and 11. Go to Settings > System > Network & Internet > Advanced Network Settings > DNS Server Settings, then toggle "Automatic" off and back on. This forces Windows to refresh its DNS information, though it's slower than the command-line method.
Clearing DNS on Mac
On Mac, you'll use the Terminal application. Open Spotlight by pressing Command + Space, type terminal, and press Enter. A white text window will open.
The command depends on your macOS version. For macOS 10.15 (Catalina) and newer, type: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. For older versions, type: sudo dscacheutil -flushcache. Press Enter, and the system will ask for your password. Type it (you won't see the letters appear) and press Enter again. Close Terminal when you're done.
If you see "command not found," your macOS version may be very old. In that case, restart your Mac — that clears the DNS cache automatically.
Clearing DNS on Linux
Linux doesn't store DNS in a single cache the way Windows and Mac do. Instead, most Linux systems use a service called systemd-resolved. Open a terminal and type: sudo systemctl restart systemd-resolved. Press Enter, type your password if prompted, and press Enter again.
If you're using an older Linux system or a different DNS service, you may need to restart that service instead. Common alternatives are dnsmasq or bind. If you're unsure which one your system uses, type sudo systemctl status systemd-resolved to check. If it says "inactive," your system uses something else — ask your system administrator or check your Linux distribution's documentation.
Clearing DNS in your browser
Your browser also keeps its own DNS cache separate from your device's cache. Clearing the device cache alone won't help if the browser is holding stale information. The easiest way to clear the browser's DNS cache is to close the browser completely and reopen it — don't just close the window and open a new one in the same session.
If you want to be thorough, you can also clear your browser's entire cache. In Chrome or Edge, press Ctrl + Shift + Delete (or Command + Shift + Delete on Mac), select "All time" from the dropdown, check "Cookies and other site data," and click "Clear data." In Firefox, press Ctrl + Shift + Delete, make sure "Cookies and Site Data" is checked, and click "Clear Now." This removes more than just DNS — it also clears login information and website preferences — so only do this if you're comfortable re-entering passwords.
What to do if clearing DNS doesn't fix the problem
If the website still won't load after clearing DNS and restarting your browser, the problem isn't your device's cache. Try these steps in order to narrow down the real cause.
First, check whether other websites load. If they do, the problem is specific to that one website — it may be down, or your internet provider may be blocking it. Wait a few minutes and try again. If other websites also won't load, restart your modem and router. Unplug both for 30 seconds, plug in the modem first, wait for its lights to stabilize (usually 1 to 2 minutes), then plug in the router and wait another minute. Try loading a website again.
If restarting doesn't work, try using a different DNS server. Your internet provider's DNS is the default, but you can switch to a public one like Google's (8.8.8.8 and 8.8.4.4) or Cloudflare's (1.1.1.1 and 1.0.0.1). On Windows, go to Settings > Network & Internet > Advanced Network Settings > DNS Server Settings, toggle "Automatic" off, and enter a public DNS address. On Mac, go to System Preferences > Network > Wi-Fi > Advanced > DNS and add a public DNS server to the list. If a different DNS server fixes the problem, your internet provider's DNS may be having issues.
Frequently Asked Questions
Will clearing DNS delete my passwords or browsing history?
No. DNS cache contains only website addresses and their IP numbers — nothing personal. Clearing DNS won't affect passwords, bookmarks, or history. If you want to clear those too, you have to do it separately through your browser's settings.
How often should I clear my DNS cache?
Most people never need to. Your device clears old DNS information automatically over time. Only clear it when you're having connection problems with a specific website or after your internet provider announces DNS changes.
What's the difference between clearing DNS and restarting my router?
Clearing DNS removes cached website addresses from your device. Restarting your router resets your internet connection entirely. If websites won't load, try clearing DNS first — it's faster. If that doesn't work, restart your router next.
Can I clear DNS on my phone?
On iPhone, go to Settings > Wi-Fi, tap the network you're connected to, and toggle "Forget This Network," then reconnect. On Android, go to Settings > Apps > Show System Apps, find "DNS," and tap "Storage" > "Clear Cache." Both methods clear DNS without affecting your data.
Why do I keep getting DNS errors on the same website?
If clearing DNS doesn't help and the problem keeps happening on one site, the website itself may have DNS configuration problems, or your internet provider may be blocking it. Try accessing the site from a different network (like a phone's hotspot) to see if the problem follows you or stays with your home connection.