# Bind9 cacheing only server, Help Please

## Vallentha

Hi ive been at it  for a week now trying to fathom out how to setup bind9 as a simple DNS cache in order that my 2 windows pc's can use my gentoo linux box to access the net along with squid proxy (this works fine). id be gratefull if someone could show me there /etc/bind/named.conf & /etc/resolv.conf files and let me know if there are any other files that need editing.

Thanks in hope

Chris

----------

## devon

Just out of curiousity, why are you using BIND9? A lot of people who use a caching-only server seem to prefer djbdns.

----------

## Vallentha

bind9 worked quite nicely on my last suse installation with the default settings but im dammed if i can get it working now. + I may need to switch to full dns in the future.

Chris

----------

## xming

not really caching only, but I use this on my home network with one zone

/etc/resolv.conf

```

domain xxxxxxx.xxx

nameserver 127.0.0.1

```

named.conf

```

options {

        directory "/var/bind";

        pid-file "/var/run/named/named.pid";

        forwarders {ns.yourisp.com, ns.yourisp.com; };

};

acl internal {

        192.168.0.0/16;

        };

acl me {

        127.0.0.1/32;

        };

zone "." IN {

        type hint;

        file "named.ca";

};

zone "localhost" IN {

        type master;

        file "pri/localhost";

        allow-update { none; };

        notify no;

};

zone "127.in-addr.arpa" IN {

        type master;

        file "pri/127";

        allow-update { none; };

        notify no;

};

zone "xxxxxxxxx.xxx" {

        type master;

        allow-query {

                me;

                internal;

                };

        file "pri/xxxxxxxxx.xxx";

        };

zone "0.168.192.in-addr.arpa" {

        type master;

        allow-query {

                me;

                internal;

                };

        file "rev/192.168.0";

        };

```

for caching only you do not need the last 2 zones

----------

## -=Blade=-

DNS is teh evil!

Have a read of this HowTo: http://www.ibiblio.org/pub/Linux/docs/howto/DNS-HOWTO

Really all you do need to do is point your resolv.conf to 127.0.0.1 and have the named.conf as a simple cache server as demonstrated above.  But you should learn more about Bind when things go wrong (and they will).

Have a look at djbdns as well, it's more complicated to initally setup but has some interesting time saving ideas.

----------

## Vallentha

Thanks all

That worked a treat on one machine, now to find out where ive bungled on the other one

Chris  :Rolling Eyes: 

----------

## acidreign

This setup was covered at the Gentoo Server Project Wiki, Check it out.

http://www.subverted.net/wakka/wakka.php?wakka=CachingOnlyNameServerWithBind

----------

