how to flush DNS?

How to flush DNS and most importantly, when should you flush your DNS? Flushing DNS is a process of clearing the cache and resolver caches, making sure that all the DNS records are up-to-date. The main purpose of this process is to improve the performance of the network and make it more stable. It also helps in resolving the hostnames to IP addresses. 

This article here shares a guide on how to flush DNS on different operating systems such as Windows, Google Chrome, Mac, and Linux.

What does Flushing DNS do?

DNS stands for Domain Name System and it’s a protocol that is used to translate hostnames into IP addresses.

When you enter the website name in your browser, your computer checks with the DNS server to find out the corresponding IP address of that domain.

Therefore, flushing DNS means resetting all the entries in the cache so that new data can be retrieved from authoritative servers.

Should I flush DNS manually?

DNS cache is a way of storing the information that’s relevant to finding a website. This can include IP address, hostname, and other DNS records. Your network’s DNS server keeps track of all of these records and makes sure they’re updated when they need to be.

A DNS cache periodically clears its own memory, without you having to do anything. Apart from storing all the information needed to locate a website, it also contains information about the Time-To-Live or TTL.

The TTL is how long an entry will stay in the DNS cache before it expires. So within this period, any answers to queries are retrieved from the local domain cache without resorting to asking a DNS server. When the TTL expires, a record of it will vanish from the cache.

For example, if the TTL for a website is set at three minutes, then the first request made after the TTL expiration will retrieve fresh information through the DNS server first instead of going through the local cache.

So should you flush DNS manually or not is your own decision, especially if you are a power user. For instance, if you’re experiencing a problem with your internet connection, you might want to consider flushing your DNS cache. This will make sure that any outdated information about websites is deleted and replaced with new data from the authoritative servers.

How To Flush DNS: For Windows 10, 8, 7, XP, and Vista Users

The steps below will walk you through how to clear your computer’s DNS cache in the latest and previous versions of Windows:

1. Click the Windows icon or Start button in the bottom left corner of your screen.

2. Click on or Search for Command Prompt.

3. Another way to open the command prompt console is by pressing Windows+R to bring up the RUN menu and enter cmd.

4. If you see a popup window asking if you want to allow Command Prompt to make changes on your computer, select Yes.

5. If you are asked for administrative login credentials at this point, please contact your system administrator.

6. Type ipconfig /flushdns in the command prompt window.

7. Press Enter.

8. You should see a message confirming that the DNS resolver cache has been flushed.

Note: The steps for flushing your DNS cache on Windows XP and Vista are nearly identical to those used in the latest Microsoft versions. However, the message at the end may differ or require admin privileges to proceed.

How To Flush DNS: For Mac Users

Flushing your DNS cache on a Mac is easy, but you will need to know what version of OS X you’re using so that you can use the correct command.

Go through these step-by-step instructions on how to flush DNS on a Mac:

1. Open Finder.

2. Click Applications.

3. Open the Utilities folder.

4. Open Terminal.

5. You could also find the Terminal app by searching for it in Launchpad.

6. In the Terminal window, type one of these commands based on your software version:

  • 10.7-10.9, 10.11-10.14 (Lion, Mountain Lion, Mavericks, El Capitan, Sierra, High Sierra, Mojave): sudo killall -HUP mDNSResponder
  • 10.10 (Yosemite): sudo discoveryutil mdnsflushcache.
  • 10.5-10.6 (Leopard, Snow Leopard): sudo dscacheutil -flushcache
  • 10.4 (Tiger): lookupd -flushcache 

7. Type your password, and press Enter.

8. You should see a window confirming that your Mac has flushed its DNS cache.

How To Flush Google Chrome’s DNS?

Ever wonder why Google Chrome keeps a DNS cache of its own?

The reason for this is simple: It’s faster! A DNS cache can significantly speed up your browsing experience, so it’s good to keep one.

However, if you’re having issues with websites not loading or sites taking forever to load, it might be time to clear Chrome’s DNS cache.

Here’s how to do it:

  1. Open Google Chrome.
  2. Type in the following address into your browser’s address bar: chrome://net-internals/#dns
  3. Click the Clear host cache button.

How To Flush Linux DNS?

While Windows and Mac OS X computers have DNS caches built in, Linux doesn’t. However, each distribution of Linux might use a different DNS service for its DNS record storage. You may need to restart the service for these changes to take effect.

Here’s how to do it:

1. Open a terminal window by pressing Ctrl+Alt+T.

2. In the Terminal window, type in one of these commands based on what version of Linux you’re using.

  •  NCSD: sudo /etc/init.d/nscd restart
  •  Dnsmasq: sudo /etc/init.d/dnsmasq restart
  • BIND: You may have to try multiple commands:
    ○  sudo /etc/init.d/named restart
    ○  sudo rndc restart
    ○  sudo rndc exec

3. You may be prompted to enter your password.

4. The service will stop and then restart before successfully flushing the cache.

Why Flush DNS?

Flushing DNS is a good way to clear out any cached information that might be causing issues with your network. It’s especially useful if you’re having problems accessing websites or other online services, as it can help get things back on track.

Flushing DNS may also improve performance by updating the server’s cache and preventing it from sending out incorrect responses based on outdated information.

Here are some more reasons why you might want to flush your DNS:

1. To Prevent DNS Spoofing

DNS spoofing or DNS cache poisoning is when an attacker gains access to your DNS cache, tempers with it such that certain domain names resolve incorrectly, and reroutes your DNS requests to their own website for fraudulent purposes such as phishing, man-in-the-middle attacks, malware distribution, and the like.

This can be prevented by flushing your DNS cache because when you flush your DNS cache, it forces the system to use a new cached version of the DNS record instead. By doing so, you prevent any rogue entries from being included in your system’s cache that might have been added by an attacker.

2. To Fix 404 Errors

If a website moves to a new domain or server, the DNS information stored on your computer may not be updated. You could end up seeing a 404 error when you try to visit that site—and need to flush (or clear) your DNS cache for the real address of that page to pop back into view.

3. Fix Website Not Loading Issues

The need for DNS flushing arises when a website is not loading correctly. This could be a result of an issue with the IP address or it could be because of the changes in the DNS server settings. In such situations, a DNS flush forces your browser to reload the DNS resolver, which will force it to look for the IP address of the website again.

4. Hide Your Browsing History

When you visit a website, your computer makes an entry in its cache that indicates how many times you visited that site. This way, if a data collector or hacker gets hold of your DNS cache, they can use this information to determine which websites you visit and when.

A DNS flush will erase the cache and make it impossible for anyone else to access this information. This will prevent your browsing history from being exposed, which can help protect you against hackers and data collectors.

5. Improve Your Security

While you can use a DNS flush to protect yourself from data collectors and hackers, it can also help to improve the security of your computer system.

This is because deleting all of the information in your cache will force your computer to re-download websites as needed, which means that any malicious code embedded within them will not be executed automatically.


Most web servers use DNS cache to store lookups of IP addresses. The purpose of this technology is to save time by not making repeated lookups in the Internet Protocol (IP) address system. In turn, this increases the speed at which the site responds to users; however, this can also lead to problems.

For example, if an IP address changes and no refreshes are made to the DNS cache then site visitors will still be directed to the old IP address, via cached results that remain on the system.

Also, your data can be exposed to external entities if the DNS cache is not properly managed.

Therefore, flushing the DNS is an important security step to take. It will ensure that you have the most up-to-date information in your DNS records, while also eliminating any outdated cached information. This can help reduce the risk of exposing sensitive data or being directed to an incorrect IP address.

Related Articles

  1. What is a DNS Record?
  2. Detecting Dangling DNS Records
  3. What is a DNS A Record?