• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / Display DNS cache on Windows

Display DNS cache on Windows

It is possible on Windows to display the DNS cache from the command line. This can be useful for diagnosing DNS issues where an invalid or out of date DNS record might be cached. This post looks at how to displayed cached DNS records on Windows, and a post from Wednesday looked at how to flush the DNS cache on Windows.

To display records currently in the DNS cache, open up a command line and enter the following command:

ipconfig /displaydns

A completely empty DNS cache, with only a “localhost” setting in your local hosts file will show something like this:

Windows IP Configuration

1.0.0.127.in-addr.arpa
----------------------------------------
Record Name . . . . . : 1.0.0.127.in-addr.arpa.
Record Type . . . . . : 12
Time To Live  . . . . : 173129
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record  . . . . . : localhost

localhost
----------------------------------------
Record Name . . . . . : localhost
Record Type . . . . . : 1
Time To Live  . . . . : 173129
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 127.0.0.1

After look at the homepage of this website with a clean DNS cache, it would show something like this:

Windows IP Configuration

www.electrictoolbox.com
----------------------------------------
Record Name . . . . . : www.electrictoolbox.com
Record Type . . . . . : 5
Time To Live  . . . . : 420
Data Length . . . . . : 4
Section . . . . . . . : Answer
CNAME Record  . . . . : electrictoolbox.com

1.0.0.127.in-addr.arpa
----------------------------------------
Record Name . . . . . : 1.0.0.127.in-addr.arpa.
Record Type . . . . . : 12
Time To Live  . . . . : 173178
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record  . . . . . : localhost

www.google-analytics.com
----------------------------------------
Record Name . . . . . : www.google-analytics.com
Record Type . . . . . : 5
Time To Live  . . . . : 104
Data Length . . . . . : 4
Section . . . . . . . : Answer
CNAME Record  . . . . : www-google-analytics.l.google.com

pagead2.googlesyndication.com
----------------------------------------
Record Name . . . . . : pagead2.googlesyndication.com
Record Type . . . . . : 5
Time To Live  . . . . : 236
Data Length . . . . . : 4
Section . . . . . . . : Answer
CNAME Record  . . . . : pagead.l.google.com

toolbarqueries.google.co.nz
----------------------------------------
Record Name . . . . . : toolbarqueries.google.co.nz
Record Type . . . . . : 5
Time To Live  . . . . : 155
Data Length . . . . . : 4
Section . . . . . . . : Answer
CNAME Record  . . . . : toolbarqueries.google.com

localhost
----------------------------------------
Record Name . . . . . : localhost
Record Type . . . . . : 1
Time To Live  . . . . : 173178
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 127.0.0.1

And finally, if you have entries in your Windows hosts file, these will also show up in the DNS cache. For example, I run an Apache webserver locally and access them in a web browser with .local domain names e.g. www.electrictoolbox.com An example entry from my hosts file looks like this:

192.168.1.15    www.electrictoolbox.local

and the associated records in an ipconfig /displaydns would look like this:

15.1.168.192.in-addr.arpa
----------------------------------------
Record Name . . . . . : 15.1.168.192.in-addr.arpa.
Record Type . . . . . : 12
Time To Live  . . . . : 172534
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record  . . . . . : www.electrictoolbox.local

www.electrictoolbox.local
----------------------------------------
Record Name . . . . . : www.electrictoolbox.local
Record Type . . . . . : 1
Time To Live  . . . . : 172534
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 192.168.1.15

So that’s how to use ipconfig to display the current DNS cache on Windows. Also refer to my earlier post about how to flush the DNS cache on Windows.

Check Out These Related posts:

  1. Reverse Mapping Checking – Possible Break-in Attempt Error with SSH
  2. NordVPN vs Private Internet Access (PIA)
  3. How Do I Know If My VPN Is Working?
  4. NordVPN vs ExpressVPN

Filed Under: Windows

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap