Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I know that on Windows I can issue ipconfig /displaydns and I see the local DNS's cache content.

How can I list the DNS's cache content in Linux?

I would like to get as much as cross-distro solution as possible.

share|improve this question
As far as I am aware, there is no DNS cache maintained on the client in Linux (resolver) unless the system is using local caching only dns service on the client. – Nikhil Mulley Jan 7 '12 at 18:55
You always have the /etc/hosts file which may contain entries generated by DNS blacklisting services. – user13742 Jan 7 '12 at 19:08

2 Answers 2

nscd is the Name Service Caching Daemon. This is the utility that Linux, Solaris, and other use to cache name service lookups. Name Service in this case is a generic term, not strictly limited to host resolution, but also users, groups, etc.

I don't know of a way to see the actual contents of the cache, though you can display statistics with /usr/sbin/nscd -g.

That can at least show you how efficient your cache is, though not exactly what it's resolving.

You may have other options if you're using an alternate caching tool, like DNSMASQ.

share|improve this answer

On Linux (and probably most Unix), there is no OS-level DNS caching unless nscd is installed and running. Even then, the DNS caching feature of nscd is disabled by default in Debian at least, simply because it is broken.

The practical upshot is that your linux system most probably does not do any OS-level DNS caching.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.