Categories
Interior

How to reset the dns cache on macos

Are you facing trouble while opening a website in macOS Catalina? DNS or Domain Name System resolves website names from IP addresses. If your browser is unable to load the website then the most obvious problem is the DNS error.

If you are facing this problem in macOS Catalina, then we have the solution for you. Reset and flush DNS cache will solve this error and it loads the websites properly. Also, clearing the cache will speed the website loading speeds faster in all OS’s including macOS Catalina.

How to Flush or Clear DNS Cache in macOS Catalina

There are several steps involved in flush DNS Cache in macOS Catalina which are very easy to follow. All you need to open Terminal on your mac to run a few commands.

1. macOS Catalina

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo killall -HUP mDNSResponder
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

For the older macOS versions, follow the below steps.

2. macOS Mojave

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo killall -HUP mDNSResponder
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

3. macOS High Sierra

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo killall -HUP mDNSResponder
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

4. macOS Sierra

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo killall -HUP mDNSResponder
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

5. macOS El Capitan

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo killall -HUP mDNSResponder
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

6. macOS Yosemite

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo discoveryutil udnsflushcaches
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

7. macOS Mavericks

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo killall -HUP mDNSResponder
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

8. macOS Mountain Lion

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo killall -HUP mDNSResponder
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

9. macOS Lion

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo killall -HUP mDNSResponder
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

10. macOS Snow Leopard and older versions

  1. Open Terminal (Application – > Utilities – > Terminal or click Go- > Utilities- > Terminal).
  2. Now type the below command in Terminal and hit the enter button.
    sudo lookupd -flushcache
  3. If you are using a password for authorization, then you need to enter the macOS password to execute the command.
  4. After, close the command.

That’s it. Once you follow the above steps you will clear DNS cache in Mac. Now restart your browser and enjoy the error-free browsing experience.

How to reset the dns cache on macos

What are DNS servers?
DNS servers, or domain name servers, are what make it possible for your internet-connected device to look up a website by its domain name (URL) and receive an IP address in return. Without the IP address of the website you are trying to visit, your device cannot download the contents of that website and your connection will not work.

Why do DNS settings need to be reset?
Every time you use our IPVanish Mac app to connect to a VPN server, our automated app changes your DNS settings to use our private DNS servers. We do this so that your online activity is kept secure. After you disconnect from IPVanish, our app should reset your DNS settings back to the DNS settings issued by your ISP. But sometimes, your ISP’s DNS settings fail to get reset on the Mac, so you have to do it manually from within our app. See the guide below to find out how to reset the DNS settings for your Mac.

Resetting Your DNS Settings For Mac
To reset your DNS settings for Mac, click “IPVanish” at the top of the menu bar (It’s right next to the Apple logo icon), then click on “Preferences.” Once the “Preferences” window appears, click on “Connection” at the top and click the “Fix OpenVPN DNS” button as shown below:

If you are having any trouble connecting to the Internet, please double-check to make sure that the kill switch is not enabled.

Updated on August 31, 2020 by Aman

Resetting the DNS cache is an ideal step to take when the name server is not responding properly on your mac. Resetting DNS is also the right way of letting your system know of any DNS change. This also helps you to registered any changes that you’ve made to /etc/hosts file without the need of rebooting your system.

However, most of the users do not know how the entire process of resetting and flushing DNS cache in mac works. In this guide today, we’ll guide you through this process. Applying them correctly will help you flush the DNS cache in macOS Catalina or Big Sur. So without any further delay, let’s look right into how to reset and flush DNS cache in macOS Catalina/Big Sur.

How to reset the dns cache on macos

How to Reset and Flush DNS Cache in macOS Catalina / Big Sur

  1. To start with, go to Spotlight Search on your system
  2. From there, type in Terminal and open it
    How to reset the dns cache on macos
  3. Then, type in the given line of code into Terminal and hit return:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    How to reset the dns cache on macos
  4. Upon hitting return, it will ask you for a password. Simply type down your Mac OS user password and press return
  5. With that, you’ll have reset and flush the DNS Cache.

Even if the entire process runs successfully, you won’t receive any confirmation message or such. To see if the process was a success, you can try and run a dig or nslookup on a website that you want. That said, we hope reading the article above has equipped you with some bit of information. Please let us know by commenting down below if you have any further queries regarding the same.

Also, check out our iPhone Tips and Tricks, PC tips and tricks, and Android Tips and Tricks if you’ve got queries for it or want help. Thank you!

When troubleshooting network and Web connectivity, in addition to tackling browser caches and configurations, you might also consider refreshing your DNS cache.

The Domain Name System (DNS) is a hierarchical network that resolves text-based URLs such as “www.cnet.com” to the servers’ IP addresses that your computer uses for communication. While loading a single Web page or other Web-based resource, your computer may contact numerous URLs to load different components (a Web page, images on it, an application hosted on it, scripts, etc.), so a robust DNS service is a vital part of having a smooth Internet connection.

Even though a fast DNS service will optimize a connection, redundant queries to it will take time to complete. Therefore, based on your DNS server’s configuration OS X will cache its DNS query results for a predetermined amount of time to allow quicker access to the results of recent DNS lookups. This time is usually relatively short — between a few minutes to a few hours — but this time depends on the DNS server being used; some may be configured to update the cache at far greater intervals such as a day or longer.

While for the most part the cache should optimize connections and keep your Internet connections running smoothly, there are times when it becomes corrupted or contains out-of-date information and doesn’t properly resolve a needed Web resource. Problems with the cache can also lead to a slower browsing experience.

Therefore, if you are experiencing browsing problems, then along with other routines like clearing your browser’s cache and troubleshooting network connections, your router settings, and browser plug-ins, you might also consider clearing the cache. Apple has recently outlined how to do this in a small knowledge base article, since the methods for doing this have changed in recent releases of OS X.

The classic method of clearing the DNS cache is to run the following command in the Terminal:

sudo dscacheutil -flushcache

However, in OS X Lion and Mountain Lion, Apple has changed the method for caching DNS queries, which unlinks it from the “dscacheutil” command, so if you run this in newer versions of OS X, you may get an error that states, “Unable to get details from the cache node.” In these versions of OS X, Apple has changed the caching routines done by the mDNSResponder process (the core process responsible for DNS resolution) so they are kept in memory by the process as long as it maintains a connection to the DNS network. Therefore, to clear the cache, you just need to send the mDNSResponder process a hang-up command to have it reinitialize its configuration without being fully shut down and restarted. To do this, you can run the following command in the Terminal:

sudo killall -HUP mDNSResponder

You can send the SIGHUP signal to the mDNSResponder process in Activity Monitor as well as via the Terminal. Screenshot by Topher Kessler/CNET

In addition to the killall command in the Terminal, you can also do this in Activity Monitor by the following process:

  1. Open Activity Monitor (in the /Applications/Utilities/ folder).
  2. In the main Activity Monitor window is not present, press Command-1 to show it.
  3. Locate and select the mDNSResponder process (you can search for it to make this easier).
  4. Choose Send Signal To Process from the View menu.
  5. Select Hangup from the menu that appears (it should be the first option that is already selected).
  6. Click the Send button.

When you do this, you may see another mDNSResponder process appear for a few seconds in Activity Monitor as the system reinitializes the process, and once this disappears, the DNS cache should be cleared.

Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

  • Home
  • Tutorials & Tech Support Guides
  • Windows 10 Tutorials
  • How to Clear or Flush the DNS Cache in Windows

How to Clear or Flush the DNS Cache in Windows

Lawrence Abrams
  • February 5, 2019
  • Read 73,331 times

If you are not able to connect to a particular site and its IP addresses is not resolving properly, it could be a problem with the DNS servers that you are connecting to or an incorrect DNS entry cached in the Windows DNS cache.

If you are having this problem, before you change your DNS servers, you should first you should first try to clear your DNS cache and see if that fixes your problem.

To clear, or flush, the DNS cache in Windows, you can perform the following steps:

    Right-click on the Start Button or press the Windows+X keys on your keyboard. When you do this, a menu will open that contains either Windows PowerShell (Admin) or Command Prompt (Admin). When you see one of these options, click on it and allow the program to run when Windows asks you for permission.

Now that your DNS cache has been cleared, or flushed, you can attempt to connect to the site again. If the problem still persists, then you may want to contact your ISP or change your DNS servers to Google’s 8.8.8.8 service of Cloudflare’s 1.1.1.1 DNS service.

Users who read this also read:

How to Find & View the Files Installed by a Chrome Extension

Whether it be because you suspect a Chrome extension is malicious, you want to create a backup of a favorite and discontinued extension, or you just want to see how the extension works, knowing how to find and view the files installed by a Chrome extension can be useful.

How to Export a Registry Key in Windows

When making a change to the Registry, it is recommended that you first create a export of the entries that you are about to modify. This allows you to save the information to a Registry file, or .reg file, so that if a problem occurs you can import the original settings back into the Registry.

How to Open a Windows Command Prompt

The Windows Command Prompt is a Windows shell that allows you to execute command by typing them in and pressing enter on the keyboard. This article will provide two methods that you can use to launch the Command Prompt in Windows.

How to see hidden files in Windows

By default Windows hides certain files from being seen with Windows Explorer or My Computer. This is done to protect these files, which are usually system files, from accidentally being modified or deleted by the user. Unfortunately viruses, spyware, and hijackers often hide there files in this way making it hard to find them and then delete them.

PHP Code

  1. Home
  2. Networking
  3. How to Flush DNS Cache Locally in Windows, macOS, & Linux

DNS cache can be corrupted for a number of different reasons, including network attacks or viruses. When that happens, IP address mapping becomes corrupted for certain popular websites.

For example, instead of going to www.facebook.com, your browser may redirect you to an IP address of a malicious website that an attacker inserted in your computer’s DNS records. Or, you may get a large number of 404 errors.

Clearing DNS cache deletes all saved DNS lookup information. Your computer then gets updated data from DNS servers next time it sends a lookup request. Learn how to flush DNS on in Windows, MacOS, & Linux below.

How to reset the dns cache on macos

What is DNS Cache?

Linux, Windows, and macOS save name resolution information in the form of DNS cache. This speeds up project load times since the cache contains IP addresses for the queried domains. Instead of having to reroute to DNS servers, the system answers queries from the cache.

The DNS cache contains the following information:

  • Resource data
  • Record type
  • Record name
  • TTL (time to live)
  • Class
  • Resource data length

How to Flush DNS in Windows

Clearing DNS cache is an easy and quick process. The procedure is the same for almost all Windows systems. Foe the example below, we will be using Windows 10.

To flush DNS on your Windows machine:

1. Load the Command Prompt as an administrator. Open the Start Menu and start typing command prompt until you see it in the results.

How to reset the dns cache on macos

2. Type ipconfig /flushdns when the prompt loads and hit Enter on the keyboard.

3. The process should take only a few seconds. You should see the DNS Resolver Cache confirmation message when it’s done:How to reset the dns cache on macos

The DNS Cache database on your computer is now clear. You should get the correct and updated IP mapping from DNS servers next time your machine sends a DNS query.

How To Flush DNS Cache on Mac

There are a few different commands to use for flushing DNS cache on OS X and macOS depending on the version you are running.

As the procedure is the same on all versions, this article details how to clear DNS on macOS Mojave (10.14) and then list the commands for other versions in a table.

Flush DNS on macOS Mojave (version 10.14)

To clear DNS cache on macOS Mojave, use the Terminal application:

  1. Run terminal.app using your preferred method. You can launch the app from Applications -> Utilities or press Command + Space to launch Spotlight and search for Terminal.
  2. Type in sudo killall -HUP mDNSResponder and hit Return on your keyboard.
  3. Enter the administrator password for the account in question and hit Return. How to reset the dns cache on macos

There is no notification when the process finishes. However, you can append another command to change that.

Note: If you want to hear an audio notification after the DNS flush is complete, type say some text after the first command. For example:

Flush DNS Commands on Older macOS and Mac OS X Versions

The table below lists the commands for clearing the DNS cache on most macOS and Mac OS X versions. You can copy and paste them directly from the table into your terminal.

Mac OS X or macOS version Terminal Command
Mojave (version 10.14)
High Sierra (version 10.13)
Sierra (version 10.12)
Mountain Lion (version 10.8)
Lion (version 10.7)
sudo killall -HUP mDNSResponder
El Capitan (version 10.11)
Mavericks (version 10.9)
sudo dscacheutil -flushcache

How to Flush DNS Cache in Linux

Linux distributions are a bit different from Windows and Mac machines. Each Linux distribution might use a different DNS service. Some distributions, like Ubuntu, don’t have a default DNS service at all.

It depends on which service you have on your distribution and whether it is enabled by default. Some of them are NCSD (Name Service Caching Daemon), dnsmasq, and BIND (Berkely Internet Name Domain).

For every distribution, you need to launch a terminal window. Press Ctrl+Alt+T on your keyboard and use the corresponding command to clear the DNS cache for the service your Linux system is running.

Flush Local NCSD DNS Cache

Use this command to clear NCSD DNS cache on your Linux machine:

Enter your password if necessary. The process stops and then starts the NCSD service within seconds.

Flush Local dnsmasq DNS Cache

Use this command to clear the dnsmasq DNS cache on your Linux machine:

Enter your password again, if the terminal asks you to. You will see the response when the service stops and starts again.

Flush Local BIND DNS Cache

If you use BIND for DNS service, there are a few commands you can use to flush its DNS cache. You may need to enter your password to finish the process.

Note: BIND also allows you to target specific domains when performing a DNS flush. Just append flushname and the domain name to the sudo rndc command. For example:

You have now learned how to clear or flush DNS cache on Windows, Linux and macOS systems.

The Internet we use today would not be the same without the immense work that Domain Name Systems do. We, as users, may not be aware of how many processes occur before we see a webpage or receive an email, and that’s why it’s important to flush DNS.

Need to reset and clear DNS cache in macOS High Sierra? Some Mac users may need to occasionally reset their local DNS cache, typically because the Mac DNS settings have changed, or a particular name server or domain is cached and they need to flush existing DNS cache.

While it’s most often web developers, systems administrators, and network admins that fiddle with DNS and have to reset and clear their DNS caches, sometimes other Mac users need to clear the DNS caches as well.

In macOS High Sierra, you can reset DNS cache by targeting the mDNSResponder process via the command line available in Terminal app. This is similar to clearing DNS cache in macOS Sierra and El Capitan, though the process to reset DNS cache has changed many times throughout the history of the Mac OS and Mac OS X operating system.

How to Reset DNS Cache in MacOS High Sierra

Note that resetting and flushing DNS cache will likely interrupt any active internet activity or usage.

    Launch the Terminal application, it is found within the /Applications/Utilities/ folder on a Mac

At the command line, enter the following syntax:

sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset | say

Hit the Return key and then enter the administrator password, then hit return again

  • Wait a moment, when you see the text “macOS DNS Cache Reset” appear in Terminal the DNS cache reset has been successful
  • Exit Terminal
  • You may need to quit and relaunch certain internet connected applications for the changes to take effect, though most web browsers can suffice with a simple refresh.

    If the above approach doesn’t work for whatever reason, you can break the command syntax down into smaller components:

    sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset

    This applies for macOS High Sierra, which is versioned as Mac OS 10.13.x. Users interested in learning how to reset DNS cache in prior versions of MacOS can learn how to do so for Sierra, El Capitan, Yosemite, and earlier versions of Mac OS X if desired.

    How to reset the dns cache on macos

    MacOS users may occasionally need to flush DNS cache on their Macs in order to access certain websites, domains, or for troubleshooting purposes. Flushing DNS cache is particularly common with web developers and network admins, but it’s used with some regularity by other advanced users too. This guide will walk through how to flush DNS cache in MacOS Big Sur and MacOS Catalina.

    If you’re unable to access a website that you visited recently, then of course the first thing you’d check is whether you have a working internet connection. But if you’re only facing connectivity issues on that particular website, then it could be a DNS error, and this is an example when clearing out DNS cache can be helpful.

    Your Mac stores the IP addresses of web servers that contain pages that you’ve recently visited. However, if this IP address changes prior to the entry in your DNS cache updates, you won’t be able to access the site without resetting your DNS cache. Flushing the DNS cache on your Mac removes all the invalid entries and forces the system to recollect those addresses the next time you visit the website.

    How to Flush DNS Cache in macOS Catalina & Big Sur

    Before you go ahead with the following procedure, make sure that your Mac is running macOS Catalina or later, as clearing DNS cache on older versions of macOS varies slightly. Now, without further ado, let’s take a look at the necessary steps.

      We’ll be using Terminal to flush the DNS cache on your machine. You can open Terminal using Spotlight search. Click on the “magnifying glass” icon located at the top-right corner of your desktop to access Spotlight search. Alternatively, you can open Spotlight by pressing Command + Space bar.

    How to reset the dns cache on macos
    Next, type “Terminal” in the search field and open the app from the search results.

    How to reset the dns cache on macos
    Now, type the following the following command in terminal.
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

    How to reset the dns cache on macos
    Hit the Return key and you’ll now be prompted to enter the macOS user password. Type in your password and press Return again.

    How to reset the dns cache on macos

    Close the Terminal window when finished.

    That’s pretty much all there is to it. You’ve successfully cleared and reset the DNS cache on your macOS machine.

    It’s worth noting that you won’t get a “successful” message after you’ve typed in the command. Just know that it’s done and you can confirm it by opening the website you weren’t able to access before.

    It’s good to clear DNS cache every now and then, as occasionally, they could get corrupted due to technical glitches. Similarly, your Wi-Fi router has a DNS cache as well. This is why most people recommend rebooting the router as a troubleshooting step, as it flushes the DNS cache as well.

    If your Mac is running an older version of macOS, you might want to learn how to reset DNS cache in macOS High Sierra, or flushing the DNS cache in macOS Sierra and so on. The procedure is similar and involves the Terminal, except for the fact that you’d be typing in a slightly different command.

    We hope you were able to correct whatever network issues you were experiencing, or you’re able to access all the websites again after flushing the DNS cache on your Mac. And if you’re having general internet connectivity problems, you may want to try troubleshooting steps to resolve Wi-Fi connectivity issues on your Mac as well.

    If you know of another approach to flushing DNS cache on the latest macOS releases, or you have any particular insight, opinions, or advice, share in the comments!

    Are you facing internet issue in macos Big Sur and tried many solution to fix it? Some browsers and devices store website location data in your system for quicker access to the DNS Cache. DNS Cache needs to be flushed to remove stored website location details. Here are some of the common ways to flush your DNS cache.

    How to reset the dns cache on macos

    DNS, or a Domain Name System, is primarily what resolves website names into their respective IP addresses. So, if you are encountering an issue on your Mac where the name server is not resolving properly, or if you want a DNS change to be noticed by your system, you might have to reset and flush the DNS cache in macOS Catalina. This can also come in handy if you have made edits to your /etc/hosts file, and you want the changes to register without having to reboot your Mac. So, if you want to reset and flush the DNS cache on your Mac os Big Sur, follow the below steps to know how to do it.

    Reset and Flush/Clear DNS Cache in macOS Big Sur

    The process to reset and flush or clear DNS cache in macOS Big Sur is actually very easy. All it requires is for you to enter one command in the Terminal, and you’re done. Well, technically, it’s two commands in one line. If you want to flush DNS cache on a Mac, simply follow the steps below:

    1. Launch Terminal, and type below command first.

    2. Then it will ask to enter a password. Enter your Mac login password and hit Enter.

    3. If everything goes right then you have successfully reset, and flushed the DNS cache on macOS Big Sur. If you were encountering any issues with name servers, and such, they should now get resolved. You can try and do a “dig“, or an “nslookup” on a website you want, to see if your DNS issues have resolved.

    Reset and Flush DNS Cache DNS Issues [Fixed]

    You can reset and clear DNS cache in macOS Big Sur to fix most DNS issues that you might be facing. The method mentioned in the article works for Mac OS Big Sur 15, and even on macOS Big Sur. If you face any issues with the commands I mentioned, feel free to let me know in the comments section down below.