[CentOS] DNS wizard

Sam Drinkard sam at wa4phy.net
Thu Dec 29 21:00:47 UTC 2005


On Thu, 2005-12-29 at 15:35 -0500, Jim Perrin wrote:

> On 12/29/05, Sam Drinkard <sam at wa4phy.net> wrote:
> >            Do we have anyone here who is a bind/dns wizard?  I've been under the impression my dns setup which I've used for so many years on a bsd machine is now considered lame.  If there is someone who would not mind taking a look at my configuration to see where I'm missing something, or where the difference lies between bind 9 and previous bind 8 configs?  I'd prefer to do this off list via direct e-mail.  The zone is very small, and the files are small too..
> 
> I don't consider myself an expert, but I'd be willing to help. I would
> prefer to do it on-list if it's at all possible for a couple reasons.
> 
> 1. It may help others who have questions about bind but haven't asked yet.
> 2. It will provide (assuming this is a productive thread) a reference
> to link people to in the future.
> 3. Help from multiple people can be offered, so you get the best
> overall advice via discussion style suggestion/revision. There's
> probably something I'll miss that another person might pick up on. (
> Someone else has done it, and done it better)
> 
> The only real downside is that your network topography is moderately
> exposed. This can be mitigated by cleansing the files of domain names
> etc, or it may be a completely internal home network and won't matter.
> 
> my $0.02.
> 
> 
> --
> Jim Perrin
> System Architect - UIT
> Ft Gordon & US Army Signal Center
> _______________________________________________


Ok.. I don't have a problem doing it on list.  Just thought it might be
more appropriate off list, but I agree, there may be others it might
help.  I'll start out by just throwing the whole mess in here since they
are relatively short files.  Not a home network, but a single server in
a co-lo site.    Here we go...

First, the config file, which is from bind8 of the old BSD machine which
worked without problems, and was not considered lame, and I, being the
lazy type, just used the same configuration files throughout.  My
upstream DNS are listed in the zone file, but there are some problems
with them also, according to dns reports.


// $Id: named.conf,v 1.5 1998/12/23 06:06:13 dillon Exp $
//
// Refer to the named(8) man page for details.  If you are ever going
// to setup a primary server, make sure you've understood the hairy
// details of how DNS is working.  Even with simple mistakes, you can
// break connectivity for affected parties, or cause huge amount of
// useless Internet traffic.

options {
        directory "/var/named";

// In addition to the "forwarders" clause, you can force your name
// server to never initiate queries of its own, but always ask its
// forwarders only, by enabling the following line:
//
//      forward only;

// If you've got a DNS server around at your upstream provider, enter
// its IP address here, and enable the line below.  This will make you
// benefit from its cache, thus reduce overall DNS traffic in the
Internet.


        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;

        /*
         * If running in a sandbox, you may have to specify a different
         * location for the dumpfile.
         */
        // dump-file "s/named_dump.db";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
};

// Note: the following will be supported in a future release.
/*
host { any; } {
        topology {
                127.0.0.0/8;
        };
};
*/

// Setting up secondaries is way easier and the rough picture for this
// is explained below.
//
// If you enable a local name server, don't forget to enter 127.0.0.1
// into your /etc/resolv.conf so this server will be queried first.
// Also, make sure to enable it in /etc/rc.conf.

zone "." IN {
        type hint;
        file "named.ca";
};

zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "localhost.rev";
};

zone "wa4phy.net" {
        type master;
        file "wa4phynet";
};

zone "158.104.216.in-addr.arpa" {
        type master;
        file "wa4phy.rev";
};


Next, the zone file, which is called "wa4phynet"

$TTL 3600
@       IN      SOA     wa4phy.net. root.wa4phy.net. (
                        2005112501      ; Serial, todays date + todays
serial #
                        8H              ; Refresh, seconds
                        2H              ; retry, seconds
                        1W              ; expire, seconds
                        1D )            ; minimum, seconds
@        IN     NS      216.104.158.222
@        IN     NS      216.104.128.37
@        IN     NS      216.104.128.38

wa4phy.net.             A       216.104.158.222
vortex.wa4phy.net.      A       216.104.158.222
ns.wa4phy.net.          A       216.104.158.222
localhost               A       127.0.0.1
                        MX      10 wa4phy.net.  ;Primary Mail Exchanger
                        MX      20 smtp7.bagger.usbn.net. ;Secondary MX

www                     CNAME   wa4phy.net.
ftp                     CNAME   wa4phy.net.


Next the reverse zone

$TTL 3600
@               IN      SOA     wa4phy.net. root.wa4phy.net. (
                                2005112501      ; Serial
                                28800           ; Refresh
                                7200            ; Retry
                                604800          ; Expire
                                86400 )         ; Minimum TTL
@               IN      NS      wa4phy.net.

222     PTR     wa4phy.net.

And last, the localhost.rev file

@       IN      SOA             wa4phy.net. root.vortex.wa4phy.net. (
                                2005112501      ;Serial
                                3600    ; Refresh
                                 900    ; Retry
                                3600000 ; Expire
                                3600 )  ; minimum
        IN      NS              wa4phy.net.
1       IN      PTR             localhost.wa4phy.net.


I'm sure the formatting is not going to be right from the looks of
things, but maybe it's close.




Snowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20051229/99d57a91/attachment.html>


More information about the CentOS mailing list