What clearing DNS does and when you need it

Clearing DNS means telling your device to forget the stored addresses it uses to find websites. Your device keeps a list of website names and their internet addresses so it doesn't have to look them up every time. Sometimes that list gets out of date or broken, and websites either load slowly, show an old version, or don't load at all. Clearing the cache forces your device to ask for fresh information the next time you visit.

You need to clear DNS when a website you know works fine refuses to load on your device, or when you get a "server not found" error even though other people can reach the site. It's also worth trying if a website looks wrong — missing images, old content, or broken buttons — because you might be seeing a cached version from before the site was updated.

This is different from clearing your browser cache. Your browser remembers web pages themselves. DNS is just the address book your device uses to find those pages in the first place. Clearing DNS takes seconds and won't delete anything important.

Key Takeaways

  • DNS cache stores website addresses on your device so it doesn't have to look them up repeatedly, but outdated entries can break website loading.
  • On Windows, you open Command Prompt as administrator and type one command; on Mac, you open Terminal and type a different command depending on your macOS version.
  • On phones and tablets, clearing DNS usually means forgetting the Wi-Fi network and reconnecting, or restarting the device entirely.
  • After clearing DNS, your first visit to a website will be slightly slower because your device has to look up the address fresh, then it returns to normal speed.

Clearing DNS on Windows

On Windows, you need to open Command Prompt with administrator rights. Click the Windows Start button, type cmd into the search box, then right-click "Command Prompt" and select "Run as administrator." Windows will ask if you want to allow this program to make changes — click "Yes."

Once Command Prompt is open, type this exactly: ipconfig /flushdns and press Enter. You should see a message that says "Successfully flushed the DNS Resolver Cache." That's it. Close Command Prompt and try visiting the website again.

If you see an error message instead, the most common reason is that you didn't open Command Prompt as administrator. Go back and repeat the steps, making sure to right-click and choose "Run as administrator."

Clearing DNS on Mac

On Mac, the command depends on which version of macOS you're running. Open Terminal by pressing Command + Space, typing terminal, and pressing Enter. Then type one of these commands and press Enter:

  • For macOS 10.15 (Catalina) and newer: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • For macOS 10.7 through 10.14: sudo killall -HUP mDNSResponder
  • For macOS 10.6: sudo dscacheutil -flushcache

macOS will ask for your password because these commands need administrator permission. Type your password (you won't see the letters appear) and press Enter. There's usually no confirmation message, but the cache is cleared. Close Terminal and try the website again.

If you're not sure which macOS version you have, click the Apple menu in the top left, select "About This Mac," and look at the version number listed under "System Software."

Clearing DNS on phones and tablets

On iPhones and iPads, there's no single "clear DNS" button, but you can force your device to get a fresh address by forgetting the Wi-Fi network. Go to Settings, tap Wi-Fi, find your network name, tap the information icon next to it, and select "Forget This Network." Then tap your network name again and reconnect with your password. Your device will request fresh DNS information when it reconnects.

On Android phones, the process is similar. Go to Settings, tap Network or Connections, select Wi-Fi, long-press your network name, and choose "Forget." Then reconnect to the network. Some Android devices also let you clear the DNS cache by going to Settings, Apps, and finding your browser, then selecting "Storage" and "Clear Cache," though this clears the browser cache rather than DNS specifically.

If forgetting and reconnecting doesn't work, restart your phone or tablet entirely. Power it off completely, wait ten seconds, and turn it back on. This clears the DNS cache along with other temporary data and often fixes connection problems.

What to do if clearing DNS doesn't fix the problem

If the website still won't load after clearing DNS, the problem is probably something else. Try visiting the website on a different device — your phone if you were using a computer, or a computer if you were using your phone. If it works on the other device, the problem is with your first device, not the website or your internet connection.

If the website doesn't work on any of your devices, the issue is likely your internet connection or the website itself. Restart your router by unplugging it for thirty seconds, plugging it back in, and waiting for the lights to stabilize. If that doesn't work, the website might be down — you can check by visiting a site like DownDetector to see if other people are reporting problems.

If only one website is broken and it worked before, it's worth waiting an hour and trying again. Sometimes website changes take time to spread across the internet, and clearing DNS won't help until the change has fully rolled out.

Why DNS gets stuck in the first place

Websites sometimes change their address — they move to a new server, switch hosting companies, or update their setup. Your device's DNS cache doesn't know about the change and keeps trying to use the old address. The website owner has set an expiration date on that cached address, but sometimes your device holds onto it longer than it should.

DNS can also get corrupted if your internet connection drops while your device is looking up an address, or if your router has a problem. In those cases, your device stores bad information and keeps trying to use it. Clearing the cache tells your device to throw out the bad data and start fresh.

This is why clearing DNS is one of the first things to try when websites stop working — it's quick, it can't hurt anything, and it fixes the problem about half the time.

Frequently Asked Questions

Will clearing DNS delete my passwords or browsing history?

No. DNS cache only stores website addresses, not passwords, history, or any personal data. Clearing it is completely safe and won't affect anything you've saved in your browser or on your device.

How often should I clear my DNS cache?

You don't need to clear it regularly. Only clear DNS when a website isn't loading or looks wrong. Most people never need to do this more than a few times a year, if at all.

Is clearing DNS the same as restarting my router?

No, they're different. Clearing DNS tells your device to forget stored website addresses. Restarting your router resets your entire internet connection. If a website won't load, try clearing DNS first — it's faster. If that doesn't work, then restart your router.

Why does the website load slowly after I clear DNS?

Your first visit after clearing DNS is slightly slower because your device has to look up the website address fresh instead of using the stored one. After that first visit, your device caches the address again and speed returns to normal.

Can I clear DNS on my router itself?

Most home routers don't have a DNS cache that you can clear from the settings menu. If you want to clear DNS at the router level, restart the router by unplugging it for thirty seconds and plugging it back in. This clears the router's memory and forces it to get fresh information.