Linux – How to read the local DNS cache contents

cachednslinux

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.

Best Answer

Prior to systemd, there was almost no OS-level DNS caching

Prior to systemd there was no OS-level DNS caching on Linux (and probably most Unix), unless nscd or dnsmasq was installed and running.

Even then, the DNS caching feature of nscd was disabled by default in Debian at least, simply because it is broken.

As for dnsmasq, the caching seems to occur in RAM by default.

Related Question