Viewing the cache

Make sure the following variable is set in your named.conf so that rndc knows where to dump the data

options {
        ...
        #Make sure the path below is writable
        dump-file       "/var/tmp/named.db";
        ...
};

Note that if you are running in a chrooted environment, the directory root will be something like /var/named/chroot/

Run the following command as root

# rndc dumpdb

View the file with your favorite editor

;
; Start view _default
;
;
; Cache dump of view '_default'
;
$DATE 20080327201925
; authanswer
.                       425153  IN NS   A.ROOT-SERVERS.NET.
                        425153  IN NS   B.ROOT-SERVERS.NET.
                        425153  IN NS   C.ROOT-SERVERS.NET.
                        425153  IN NS   D.ROOT-SERVERS.NET.
                        425153  IN NS   E.ROOT-SERVERS.NET.
                        425153  IN NS   F.ROOT-SERVERS.NET.
                        425153  IN NS   G.ROOT-SERVERS.NET.
                        425153  IN NS   H.ROOT-SERVERS.NET.
                        425153  IN NS   I.ROOT-SERVERS.NET.
                        425153  IN NS   J.ROOT-SERVERS.NET.
                        425153  IN NS   K.ROOT-SERVERS.NET.
                        425153  IN NS   L.ROOT-SERVERS.NET.
                        425153  IN NS   M.ROOT-SERVERS.NET.
; glue
com.                    79553   NS      A.GTLD-SERVERS.NET.
                        79553   NS      B.GTLD-SERVERS.NET.
                        79553   NS      C.GTLD-SERVERS.NET.
                        79553   NS      D.GTLD-SERVERS.NET.
                        79553   NS      E.GTLD-SERVERS.NET.
                        79553   NS      F.GTLD-SERVERS.NET.
                        79553   NS      G.GTLD-SERVERS.NET.
                        79553   NS      H.GTLD-SERVERS.NET.
                        79553   NS      I.GTLD-SERVERS.NET.
                        79553   NS      J.GTLD-SERVERS.NET.
                        79553   NS      K.GTLD-SERVERS.NET.
                        79553   NS      L.GTLD-SERVERS.NET.
                        79553   NS      M.GTLD-SERVERS.NET.
; glue
google.com.             79554   NS      ns1.google.com.
                        79554   NS      ns2.google.com.
                        79554   NS      ns3.google.com.
                        79554   NS      ns4.google.com.
; glue
l.google.com.           86283   NS      a.l.google.com.
                        86283   NS      b.l.google.com.
                        86283   NS      c.l.google.com.
                        86283   NS      d.l.google.com.
                        86283   NS      e.l.google.com.
                        86283   NS      f.l.google.com.
                        86283   NS      g.l.google.com.
; glue
a.l.google.com.         86283   A       209.85.139.9
; glue
b.l.google.com.         86283   A       64.233.179.9
; glue
c.l.google.com.         86283   A       64.233.161.9
; glue
d.l.google.com.         86283   A       66.249.93.9
; glue
e.l.google.com.         86283   A       209.85.137.9
; glue
f.l.google.com.         86283   A       72.14.235.9
; glue
g.l.google.com.         86283   A       64.233.167.9
; authanswer
www.l.google.com.       183     A       64.233.167.99
                        183     A       64.233.167.104
                        183     A       64.233.167.147
; glue
ns1.google.com.         79554   A       216.239.32.10
; glue
ns2.google.com.         79554   A       216.239.34.10
; glue
ns3.google.com.         79554   A       216.239.36.10
; glue
ns4.google.com.         79554   A       216.239.38.10
; authanswer
www.google.com.         511554  CNAME   www.l.google.com.
; glue
a3.nstld.com.           172789  A       192.5.6.32
; glue
c3.nstld.com.           172789  A       192.26.92.32
; glue
d3.nstld.com.           172789  A       192.31.80.32
; glue
e3.nstld.com.           172789  A       192.12.94.32
; glue
g3.nstld.com.           172789  A       192.42.93.32
; glue
h3.nstld.com.           172789  A       192.54.112.32
; glue
l3.nstld.com.           172789  A       192.41.162.32
; glue
m3.nstld.com.           172789  A       192.55.83.32
; glue
edu.                    172789  NS      a3.nstld.com.
                        172789  NS      c3.nstld.com.
                        172789  NS      d3.nstld.com.
                        172789  NS      e3.nstld.com.
                        172789  NS      g3.nstld.com.
                        172789  NS      h3.nstld.com.
                        172789  NS      l3.nstld.com.
                        172789  NS      m3.nstld.com.
; authauthority
oakland.edu.            3592    NS      ns1.oakland.edu.
                        3592    NS      ns2.oakland.edu.
                        3592    NS      dns1.merit.net.
                        3592    NS      dns2.merit.net.
                        3592    NS      dns3.merit.net.
; glue
NS1.oakland.edu.        172792  A       141.210.2.2
; glue
NS2.oakland.edu.        172792  A       141.210.2.3
; authanswer
www.oakland.edu.        3592    A       141.210.12.15
; glue
YALE-SERVER.UCHICAGO.edu. 172789 A      128.135.249.140
; authauthority
yale.edu.               10789   NS      serv1.net.yale.edu.
                        10789   NS      serv2.net.yale.edu.
                        10789   NS      serv3.net.yale.edu.
                        10789   NS      serv4.net.yale.edu.
                        10789   NS      yale-server.uchicago.edu.
; authanswer
elsinore.cis.yale.edu.  10789   A       130.132.51.8
; glue
SERV1.NET.yale.edu.     172789  A       130.132.1.9
; glue
SERV2.NET.yale.edu.     172789  A       130.132.1.10
; glue
SERV3.NET.yale.edu.     172789  A       130.132.1.11
; glue
SERV4.NET.yale.edu.     172789  A       130.132.89.9
; authanswer
www.yale.edu.           10789   CNAME   elsinore.cis.yale.edu.
; glue