Display DNS cache

In windows, you can view your DNS cache by typing "ipconfig /displaydns". When trying to figure out how to do this on a Mac, I found the command "dscacheutil -cachedump" to be useful, however it's not showing me the exact domains like windows does. I actually want to see what names were resolved, like www.google.com, www.yahoo.com, etc. Is there a way to see this data, or have they changed something in the version of OSX that I am using that prevents this? I am on 10.6.8 . Please see the output I get below from the example command:


sudo dscacheutil -cachedump -entries user



DirectoryService Cache Overview:

AAAA Queries - Disabled (link-local IPv6 addresses)

Cache Size - 28



Entry count by category:

Group - 21

Service - 1

User - 6



Cache entries (ordered as stored in the cache):



Category Best Before Last Access Hits Refs TTL Neg DS Node

---------- ------------------ ------------------ -------- ------ -------- ----- ---------

User 09/29/11 19:31:41 09/29/11 18:31:41 2 1 3600 /Local/Default

Key: pw_gecos:Location Daemon

Key: pw_name:_locationd

Key: pw_uid:205



User 09/29/11 19:32:20 09/29/11 18:59:11 7 1 3600 /Local/Default

Key: pw_gecos:(i removed this to protect my name)

Key: pw_name:(same here)



User 09/29/11 19:59:36 09/29/11 18:59:36 0 1 3600 /Local/Default

Key: pw_gecos:Spotlight

Key: pw_name:spotlight

Key: pw_name:_spotlight

Key: pw_uid:89



User 09/29/11 20:00:23 09/29/11 19:00:34 3 1 3600 /Local/Default

Key: pw_name:root



User 09/29/11 19:43:54 09/29/11 19:00:09 12 1 3600 /Local/Default

Key: pw_uid:0



User 09/29/11 19:27:20 09/29/11 19:00:34 125 1 3600 /Local/Default

Key: pw_uid:40645



This is fine, bug where are the actual domains that have been resolved? Is there more to the command that I need to type? Do we have to dig down to the indivivual entries somehow? Has the feature I'm looking for been removed in the latest release of Snow Leopard?


Thanks for any help.

MacBook Pro, Mac OS X (10.6.8)

Posted on Sep 29, 2011 7:31 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 29, 2011 8:28 PM

DNS cache information is not managed by Directory Services, contrary to popular opinion on this site. It's managed by mDNSResponder, and the man page contains the answer to your question:



A SIGINFO signal will dump a snapshot summary of the internal state to /var/log/system.log:


% sudo killall -INFO mDNSResponder

3 replies

Sep 29, 2011 8:22 PM in response to synapsis2112

Some additional info...


Even if I run this..

sudo dscacheutil -cachedump -entries host


I don't get the output I;m looking for, I see no entries at all. This is even after going to a website in a browser and doing a host lookup on command line, you would expect something to be cahced.



DirectoryService Cache Overview:

AAAA Queries - Disabled (link-local IPv6 addresses)

Cache Size - 27



Entry count by category:

Group - 22

Service - 1

User - 4



Cache entries (ordered as stored in the cache):



Category Best Before Last Access Hits Refs TTL Neg DS Node

---------- ------------------ ------------------ -------- ------ -------- ----- ---------

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Display DNS cache

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.