[TriLUG] Help with caching dns server

Aaron Joyner aaron at joyner.ws
Tue Sep 16 14:23:46 EDT 2008


The easiest way to do this (with a traditional DNS server, not
counting dnsmasq, which I know basically nothing about) is to install
your distributions 'bind9' or 'caching-dns' server package, and point
your local workstations at it's IP address.  That'll get you 90% of
the way there.  For the remainder, you'll need to pick a local domain
to use.  It *could* be something externally resolvable, but not
messing up the external resolution of that domain name is beyond the
scope of this email.  You then simply need to edit /etc/named.conf (or
where ever your distribution has the named.conf file, consult your
package manager), and add a zone entry:

zone "mydomain.local" {
  type master;
  file "db.mydomain.local";
}

Then you'll need to create a local zone file for mydomain.local.  It
should be created in what ever directory the "options" section of the
named.conf defines with the "directory" keyword.  The zone file should
have contents similar to this:
$TTL 900
@       IN      SOA     ns.mydomain.local. my.email.address. (
                        200809160 ; serial, todays date + todays serial #
                        8H    ; refresh, seconds
                        2H    ; retry, seconds
                        4W    ; expire, seconds
                        900 )   ; minimum, seconds
;
                NS      ns    ; Inet Address of name server

ns      A  1.1.1.1
www     A  1.1.1.1
laptop1 A  1.1.1.2
laptop2 A  1.1.1.3

Then at your local shell prompt as root, 'rndc reload'.
Congratulations, you're now a DNS administrator!

Aaron S. Joyner


On Tue, Sep 16, 2008 at 1:54 PM, Roy Vestal <rvestal at trilug.org> wrote:
>
> We have a few machines at the house (a desktop, 2 laptops, etc) that I
> want to use a local dns server vs the time-warner dns server. I was
> hoping to add to it, the local IP's of the web server and then add cname
> (or something similar) to the dns server so that when the machines
> grabbed dhcp, the dns would supply those so I *wouldn't* have to update
> /etc/hosts everytime.
>
> :)
>
> Aaron Joyner wrote:
> > If you want to use the local IP for local resolution... /etc/hosts is your
> > friend.  If you've got something more complicated in mind, please provide
> > more details.
> >
> > Aaron S. Joyner
> >
> >
> > On Mon, Sep 15, 2008 at 4:37 PM, Roy Vestal <rvestal at trilug.org> wrote:
> >
> >
> >> Hey guys. I'm trying to figure out how to add the local IP address of my
> >> webserver to the dns server i just built. I'm using centos 5. The DNS
> >> server works fine for external entries.
> >>
> >> My webserver hosts mutliple virtual dirs with apache.
> >>
> >> TIA
> >> --
> >> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> >> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions
> >>
> >>
>
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions



More information about the TriLUG mailing list