Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I installed a Forwarding DNS server on Centos 5.10 and it is resolving addresses e.g google.com. When I stopped named (service named stop) and tried to dig (dig @localhost A google.com) there was a failure to resolve the address. I checked and see the caching daemon nscd is running.

Does this mean the server is not caching at all? How can I get it to cache?

named.conf

     options
   {
    // Those options should be used carefully because they disable port
    // randomization
// query-source    port 53; 
// query-source-v6 port 53;

// Put files that named is allowed to write in the data/ directory:
    listen-on port 53 {127.0.0.1; 10.0.0.4;};
    directory "/var/named"; // the default
    dump-file       "/var/named/chroot/var/named/data/cache_dump.db";
    statistics-file     "/var/named/chroot/var/named/data/named_stats.txt";
    memstatistics-file  "/var/named/chroot/var/named/data/named_mem_stats.txt";
   // allow-query {localhost; 192.168.0.0/24; 10.0.0.0/8;};
    recursion yes;
    //allow-query  { localhost; 10.0.0.0/8;};
    allow-query     { localhost; any; };
    allow-query-cache    { localhost; any; };
    forward only;  
    forwarders {8.8.8.8; 8.8.4.4;};

    dnssec-enable yes;
    // dnssec-lookaside auto;

    /* Path to ISC DLV key */
    // bindkeys-file "/etc/named.iscdlv.key";

    // managed-keys-directory "/var/named/dynamic";

}; logging {

    channel default_debug {
            file "data/named.run";
            severity dynamic;
    };  

}; **

share|improve this question

1 Answer 1

DNS caching on Linux (via nscd) is traditionally disabled by default. Check /etc/nscd.conf if you want to enable it. Be warned, it might create more problems for you. I personally have never relied on it for DNS. If you want DNS resolution to keep working when/if Bind crashes, AND you still have network connectivity, it's better to just specify more servers in /etc/resolv.conf

The reason dig @127.0.0.1 fails to work is that it consults the DNS server directly through port 53. It does not use the NSS functions.

share|improve this answer

Your Answer

 
discard

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.