How to Display the Contents of Your DNS Cache

Download ArticleDownload Article

You can display the contents of your Domain Name System ("DNS") cache by using the Command Prompt app on PCs or the Terminal app on Macs. It can then be flushed through a series of commands, or by an Airplane Mode reset on mobile. DNS caches are responsible for cataloging the sites you visit, but a DNS error can prevent you from being able to view these sites. Displaying and flushing the cache will help fix these errors.

Method 1
Method 1 of 3:

Flushing the DNS Cache on a Phone or Tablet

Download Article
  1. How.com.vn English: Step 1 Close all apps to prepare to flush your DNS cache.
    You can't actually view the DNS cache on mobile, but you can flush the cache and thereby fix any DNS or "timing out" errors you have encountered.
    • Make sure your browsers in particular are closed.
  2. Step 2 Open the "Settings" menu.
    Scroll until you find the "Wi-Fi" menu.
    • For an Android, find the "Wireless and Networks" menu in "Settings".
    Advertisement
  3. Step 3 Select the "Wi-Fi" tab, then swipe the "Wi-Fi" switch to the left.
    Wait until your data indicator appears in the upper left-hand corner of the phone.
    • If you have an Android, tap the "Wi-Fi" switch to turn the wifi off.
  4. How.com.vn English: Step 4 Swipe your phone's wifi switch back on.
    Wait until the wifi icon appears, then return to the "Settings" menu.
  5. Step 5 Turn "Airplane Mode" on, then off again.
    Find "Airplane Mode" at the top of your Settings menu on iPhone. Be sure to wait a few moments (for the wifi indicator in the upper left-hand corner to disappear) before turning Airplane Mode back off again This will reset your network settings, thereby enabling the DNS cache to flush.
    • For Android, select "More" in the Settings menu to access the Airplane Mode setting toggle.
  6. Step 6 Hold the "lock screen" button down, then swipe the "Slide to Power Off" button to the right.
    This will turn off your phone and flush your DNS cache. Leave your phone off for at least 15 seconds.
    • For Android, you need to hold down the "Power" button, then tap "Power off" in the resulting menu.
  7. Step 7 Hold down the "lock screen" button until the screen lights up.
    This will turn your phone back on.
  8. How.com.vn English: Step 8 Confirm that your DNS cache flush worked.
    Use your phone's browser to visit any site where you encountered a DNS error. You should now be able to access the site!
    • Loading your frequently-used sites for the first time after a DNS flush will take longer than usual, since your DNS cache is being updated.
  9. Advertisement
Method 2
Method 2 of 3:

Viewing the DNS Cache on a PC

Download Article
  1. Step 1 Open the Start menu and click on "All Apps".
    • For earlier operating systems, replace clicking "All Apps" with clicking "All Programs" and then selecting "Accessories".
  2. Step 2 Click "Windows System".
  3. Step 3 Right-click the "Command Prompt" app and select "Run as Administrator".
    This should open "Command Prompt" with full access, allowing you to enter system commands.
  4. Step 4 Type "ipconfig /displaydns" without the quotation marks.
    Double-check your typing, then hit Enter to view the cache.[1]
  5. Step 5 Look over the DNS cache by scrolling through the "Command Prompt" interface.
    You can use the results of your search to view the IP addresses of frequently-visited sites, or you can flush your DNS cache.
    • The DNS cache also stores your web browsing history - even if you clear it from your browser.
  6. Step 6 Flush your cache by typing in "ipconfig /flushdns".
    Don't include the quotation marks. If you're encountering DNS errors in your browser, flushing your cache will fix this problem. Flushing can also help your computer run faster by keeping your website data up-to-date.[2]
  7. How.com.vn English: Step 7 Confirm that your DNS cache flush worked.
    Open a browser and visit a site where you previously encountered a DNS error. You will now be able to access the site!
    • Loading sites after a DNS flush will often take longer than usual.
  8. Advertisement
Method 3
Method 3 of 3:

Viewing the DNS Cache on a Mac

Download Article
  1. Step 1 Open "Spotlight".
    Spotlight's icon is a magnifying glass located in the top right corner of your screen.
  2. Step 2 Search for "terminal" and open the Terminal app.
    Terminal lets you access system information--such as your DNS cache--through typed commands.
  3. Step 3 Type "sudo discoveryutil udnscachestats" into Terminal.
    Don't include the quotation marks. Press Return when you're done.
    • The "sudo" part of the command sets up the rest of the command for "root privilege", which allows you to view sensitive system information.
    • The "discoveryutil" part of the command request the DNS information from your system.
    • The "udnscachestats" part of the command displays one of two sections of your DNS cache.
  4. How.com.vn English: Step 4 Enter your Administrator password into Terminal.
    This should be the password you use to log in. Press Return when you finish typing. Terminal should display your Unicast DNS cache.[3]
    • The Unicast DNS (UDNS) cache translates website addresses (such as Facebook) into IP addresses for your computer to use during future searches.
    • With Unicast, your address sends out one IP address request to one server per site, regardless of how many servers exist. If that server becomes unresponsive, you will encounter a DNS error.
  5. How.com.vn English: Step 5 Look over the Unicast DNS cache by scrolling through the Terminal.
    You can use the results of your search to view the IP addresses of frequently-visited sites. If you encountered a DNS error, the UDNS cache is the most likely location of the problem.
    • You can also use the UDNS cache to check your recent site history. You will need to check the Multicast DNS cache as well for a complete report.
  6. How.com.vn English: Step 6 Close and reopen Terminal.
    This will help you avoid command errors when checking the next section of your DNS cache.
  7. Step 7 Type "sudo discoveryutil mdnscachestats" into Terminal.
    Don't include the quotation marks. Press Return when you're done.
    • The "sudo" part of the command sets up the rest of the command for "root privilege", which allows you to view sensitive system information.
    • The "discoveryutil" part of the command request the DNS information from your system.
    • The "mdnscachestats" part of the command displays your Multicast DNS cache.
  8. How.com.vn English: Step 8 Enter your Administrator password into Terminal.
    This should be the password you use to log in. Press Return when you finish typing. Terminal should display your Multicast DNS cache.
    • The Multicast DNS (MDNS) cache also translates website addresses (such as Facebook) into IP addresses for your computer to use during future searches.
    • With Multicast, your address sends out multiple IP address requests to multiple servers per site. If one server becomes unresponsive, you still have multiple connections to other servers, meaning you're much less likely to encounter a DNS error on a Multicast network than on a Unicast network.
  9. How.com.vn English: Step 9 Look over the Multicast DNS cache by scrolling.
    You can use the results of your search to view the IP addresses of frequently-visited sites.
    • You can also use the MDNS cache to check your recent site history. Checking the MDNS cache in conjunction with the UDNS cache will give you a full history report.
  10. How.com.vn English: Step 10 Flush your DNS cache(s).
    Type "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; say cache flushed" into Terminal. Hit Return to finalize the flush. This will reset your saved website data and clear any DNS errors you may encounter. This command is appropriate for the the latest version of OS X (10.11).[4]
    • This command flushes both cache sections (UDNS and MDNS). Flushing both sections resolves any current errors and prevents future errors from occurring, so you should always flush both for consistency. Flushing the cache will not harm your computer.
    • The Terminal commands to flush the DNS cache vary between OS X versions. Find out what version you are running by going to the Apple menu and selecting "About This Mac".
    • For OS X 10.10.4 and up type "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; say cache flushed".
    • For OS X 10.10 to 10.10.3 users should type "sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches; say flushed".
    • For OS X 10.7 to 10.9 type "sudo killall -HUP mDNSResponder".
    • For OS X 10.5 to 10.6 type "sudo dscacheutil -flushcache"
    • For OS X 10.3 to 10.4 type "lookupd -flushcache".
  11. How.com.vn English: Step 11 Confirm that your DNS cache flush worked.
    Use your browser of choice to visit a site on which you encountered a DNS error. You should now be able to access the site!
    • Loading your frequently-used sites for the first time after a DNS flush will take longer than usual, since your DNS cache is being updated.
  12. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How can I read/view/display my DNS cache record before flushing it? All I can find is how to flush and how to look at statistics.
    How.com.vn English: Arc7urus
    Arc7urus
    Community Answer
    In Windows, from the command line: ipconfig /displaydns. There is no local DNS caching on a default Linux configuration. You will need to install and configure specific services (like nscd) to enable local DNS caching.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      • Turning on and off Airplane Mode and then restarting any tablet or mobile phone should always flush the DNS cache.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • You should always back up your computer and double-check all of your commands for accuracy before entering them into Command Prompt or Terminal.
      • Be wary of viewing or resetting the DNS cache on a work or shared computer. Always be sure to ask for permission first.
      Advertisement

      About This Article

      How.com.vn English: Jack Lloyd
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for How.com.vn. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 301,890 times.
      How helpful is this?
      Co-authors: 18
      Updated: August 4, 2021
      Views: 301,890
      Thanks to all authors for creating a page that has been read 301,890 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement