downinspector
downinspector
Guides / Flush your DNS cache

How to flush the DNS cache on Windows, Mac, Linux, Android and iPhone

A DNS cache stores the addresses of sites you visited so pages open faster. When a site moves to a new server, that stored address can point to nowhere. Clearing it takes under a minute.

Published


What the DNS cache does

Every website name, such as example.com, has to be translated into a numeric server address before your device can connect. That translation is called a DNS lookup. To save time, your operating system, your browser and often your router remember recent answers for a while. Most of the time this is invisible and helpful. It becomes a problem when a site changes servers: your device keeps using the stored address until it expires, while everyone else already reaches the new one.

Flushing the cache throws away those stored answers so the next visit asks for a fresh address. It is quick, safe and often the missing step when a site works everywhere except on one device.

Windows 10 and 11

  1. Open a command prompt

    Press the Windows key, type cmd and choose Command Prompt.

  2. Run the flush command

    Type ipconfig /flushdns and press Enter.

  3. Look for the confirmation

    Windows replies that it successfully flushed the DNS resolver cache.

macOS

  1. Open Terminal

    It is in Applications, inside the Utilities folder.

  2. Run the flush command

    Type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and press Enter.

  3. Enter your password

    Terminal asks for the account password and shows nothing while you type. There is no confirmation message when it succeeds.

Linux

Most current desktop distributions use systemd-resolved. Run resolvectl flush-caches in a terminal, with sudo if your system requires it. Older systems with the nscd service use sudo systemctl restart nscd. If neither applies, your system is probably not caching DNS locally and there is nothing to clear.

Chrome and other Chromium browsers

Chrome, Edge, Brave and Opera keep an internal cache of their own. Open chrome://net-internals/#dns in the address bar (Edge uses edge://net-internals/#dns) and press the clear host cache button. Then open chrome://net-internals/#sockets and flush the socket pools so old connections close.

Android and iPhone

Phones do not offer a flush button, but two simple actions do the same job. Turning airplane mode on for ten seconds and off again clears network state, including stored lookups. Restarting the phone clears everything. On Android, the Private DNS setting in the network settings also controls which DNS server the phone uses.

Firefox and Safari

Firefox keeps a small DNS cache of its own. Type about:networking#dns in the address bar and press the Clear DNS Cache button on that page. Safari has no separate cache to clear; it relies on macOS, so the Terminal command above covers it.

Encrypted DNS in the browser

Browsers can bypass the system’s DNS settings altogether. Firefox turned on DNS over HTTPS by default for users in the United States in 2020, and Chrome and Edge have a secure DNS setting that uses an encrypted service when your provider offers one. With encrypted DNS on, the browser asks a different server than the rest of your computer does. That explains a puzzle that confuses many people: a site loads in Firefox but not in another browser on the same machine, or the other way round, even after the system cache was flushed. In Firefox the setting sits under Settings, Privacy & Security, DNS over HTTPS; in Chrome it is under Settings, Privacy and security, Security, Use secure DNS. Switch it off for a test and reload the site. Turn it back on afterwards if you rely on it for privacy.

Some app error codes are DNS failures in disguise. Steam’s error -105 on a store page often clears after a flush, and the Steam status page covers its other causes.

The router has a cache too

Many home routers cache DNS answers for the whole household. If every device on your Wi-Fi fails to reach a site that works on mobile data, restart the router after flushing the devices. Unplug it for about thirty seconds, then wait until all lights settle before testing again.

When flushing does not help

If the site still fails after clearing every cache, run the outside check on the homepage. A failed check means the site itself has a problem. A passing check combined with a failure on every device of yours points to your provider’s DNS servers, and switching the router or device to a public DNS server is the next thing to try.

Questions

Is it safe to flush the DNS cache?

Yes. The cache only holds temporary lookups. Clearing it removes nothing personal and has no lasting effect; the first visit to each site afterwards takes a few milliseconds longer while the address is looked up again.

How do I know if DNS is the problem?

A site that works on mobile data or another device but not on yours, while an outside check shows it as reachable, is a typical sign. Error messages that mention a name not being resolved point the same way.

Does flushing DNS fix slow internet?

Rarely. It fixes wrong or outdated addresses, not slow connections. If every site is slow, test your connection speed and restart the router instead.

Do I need to restart my computer after flushing DNS?

No. The change is immediate. Closing and reopening the browser helps, because browsers keep their own short cache as well.

What is the difference between the browser cache and the DNS cache?

The browser cache stores copies of pages, images and scripts. The DNS cache stores the server addresses behind site names. They fix different problems, and clearing one does not clear the other.

Should I change my DNS server?

If lookups fail often or your provider's DNS is slow, a public DNS server can help. Changing it is a router or network setting; flushing the cache alone does not change which server you use.