real simple DNS requirement.

Shawn_Evans at oxy.com Shawn_Evans at oxy.com
Thu Sep 7 20:50:05 UTC 2000



>i manage a small network of 30-40 computers.
>this private network is NOT connected to the internet.
>
>i want to provide a DNS service on one of my linux boxes.
>this will be easier than managing 40 hosts files.
>
>reading up on DNS, the whole thing seems VERY complicated.
>
>all i want to do is match a NAME to an IP.
>e.g.
>
>blah     20.30.40.50
>la         20.30.40.51
>di         20.30.40.52
>da        20.30.40.53
>
>so whats the EASIEST way of achieving this ?
>
>can 'named' be this simple ?
>
>please give me some pointers.
>
>many thanks.



Yes it can be easy, I would have sent this directly to you, but you chose to
hide.  If there is anything wrong here, im sure someone will gladly point
out my faults.. ;) 

Hope it helps.. :)





Have you compiled 8.2.2p5 yet?   If not, download it, follow the install
instructions..

Short version for install, from the src dir:
make stdlinks
make clean
make depend
make all
make install

cd /usr/local/etc/namedb

Make a dir in here, call it old, move everything in this dir into the old
dir just for backups sake, now
put the latest version of root.cache file in here, you can get it from
FTP.RS.INTERNIC.NET/domain/named.root
and then vi (whatever editor) named.conf, it will look something like this;

Note: Each file I show here has ------------------ at the begennnig and
end...

named.conf:
------------------------
options { 
       directory "/usr/local/etc/namedb"; 
        statistics-file "/var/log/named.stats";
};
logging {
        channel queries {
        file "/var/log/named.queries" versions 1 size 10M; };
        category queries { queries; };
};
zone "." {
        type hint;
        file "named.root";
};
zone "0.0.127.in-addr.arpa" {
        type master;
        file "db.127.0.0";
};
// your.zone can be whatever you want to name it, if your 
// domain was booga101.com I would call this "booga101.com"
zone "booga101.com" in {
        type master;
        file "db.booga101.com";
};
// This is your reverse lookup file, if my IP was 20.30.40.* here I would
put "30.20.in-addr.arpa"
// which is just the numbers in reverse excluding the last digit.
zone "30.20.in-addr.arpa" in {
        type master;
        file "db.20.30.40";
};
------------------------


Thats it for your name.conf file, now you need to make the other files...
You need db.127.0.0, db.booga101.com, and db.20.30.40

db.127.0.0:
------------------------
$TTL 86400
0.0.127.in-addr.arpa. in soa yourmachine.yourdomain.com.
root.yourmachine.yourdomain.com. (
 2000090701    ; serial  [yyyyMMddNN]
      43200    ; refresh [12h]
       3600    ; retry   [ 1h]
     691200    ; expire  [ 8d]
      86400)   ; minimum [ 1d]

0.0.127.in-addr.arpa.		in	ns
yourdnsmachine1.booga101.com.
0.0.127.in-addr.arpa.		in	ns
yourdnsmachine2.booga101.com.

1.0.0.127.in-addr.arpa.		in	ptr	localhost.booga101.com.
------------------------


db.your.zone:
------------------------
$TTL 1800
booga101.com. in soa yourdnsmachine1.booga101.com.
root.yourdnsmachine1.booga101.com. (
 2000090701    ; serial  [yyyyMMddNN]
       1800    ; refresh [15m]
        900    ; retry   [15m]
     691200    ; expire  [ 8d]
      86400)   ; minimum [ 1d]

localhost.booga101.com.		in	a	127.0.0.1
booga101.com.			in	ns
yourdnsmachine1.booga101.com.
booga101.com.			in	ns
yourdnsmachine2.booga101.com.

; Note the yourdomain.com.  if you add this, you must rember to add the "."
; at the end or it will break. =)
blah.booga101.com.		in	a	20.30.40.50
la.booga101.com.		in	a	20.30.40.51
di.booga101.com.		in	a	20.30.40.52
da.booga101.com.		in	a	20.30.40.53
; This will make bulwinkle resolve to da
bulwinkle.booga101.com.	in	cname	da.booga101.com.
------------------------


db.20.30.40
------------------------
$TTL 86400
30.20.in-addr.arpa. in soa yourdnsmachine1.booga101.com.
root.yourdnsmachine1.booga101.com. (
 2000090701    ; serial  [yyyyMMddNN]
       1800    ; refresh [15m]
        900    ; retry   [15m]
     691200    ; expire  [ 8d]
      86400)   ; minimum [ 1d]

booga101.com.			in	ns
yourdnsmachine1.booga101.com.
booga101.com.			in	ns
yourdnsmachine2.booga101.com.

; Again, notice the yourdomain.com. you must put the "." at the end if
; you add in .yourdomain.com.
50.40.30.20.in-addr.arpa.      in ptr   blah.booga101.com.
51.40.30.20.in-addr.arpa.      in ptr   la.booga101.com.
52.40.30.20.in-addr.arpa.      in ptr   di.booga101.com.
53.40.30.20.in-addr.arpa.      in ptr   da.booga101.com.
------------------------

Now you need to vi /etc/resolv.conf;
------------------------
domain booga101.com
nameserver 127.0.0.1
------------------------

At this point, you have in /usr/local/etc/namedb the following files;
named.conf
db.127.0.0
db.your.zone
db.20.30.40

Depending on how named runs on your machine you may need to make a symbolic
link pointing to named.conf, 

ln -s /usr/local/etc/namedb/named.conf
/path/to/where/your/os/wants/it/named.conf

Other than that at this point, if you run ndc start, it should boot up.  if
you have 2 telnet sessions open, and you tail -f /var/log/messages you will
see the logs of named, and it should boot with no errors, if so, then your
good to go, if errors, then you gota work them out..  most are easy to deal
with.. 

You will also need a start file of some type..

Here is one that works for Solaris..
/etc/rc2.d/S99named
-------------------------
#!/bin/sh
#
case $1 in
'start')
        if [ -x /usr/local/sbin/ndc -a -f /etc/named.conf ]
                then
                        /usr/local/sbin/ndc start
        fi
        ;;
'stop')
                /usr/local/sbin/ndc stop
        ;;
'restart')
                /usr/local/sbin/ndc restart
        ;;
*)
        echo "usage: /etc/init.d/named {start|stop|restart}"
        ;;
esac
--------------------------

---
-   Shawn L. Evans, mailto:shawn_evans at oxy.com   -
-  Phone: 1-918-610-1897 Mobile: 1-918-361-7601  -
-      Text Page: 8008056238 at airmessage.net      -
-             Pager:  1-800-805-6238             -




More information about the bind-users mailing list