Draco - DNS config files


/var/named/mk_files

This script rebuilds all of the required files from data in the /etc/hosts file.

#! /bin/sh
#
# Script to feed hosts file to h2n. First we make an options file.
cat > /tmp/h2n.tmp << EOF
-d home.spade.com
-n 172.16.167
-m 20:draco.home.spade.com
EOF

# Now we run h2n
./h2n -f /tmp/h2n.tmp

# And now we make a few additions to named.boot
cat >> named.boot << EOF
options forward-only
forwarders 204.156.128.1 204.156.128.10 204.156.128.20
EOF

/usr/sbin/named.reload


/etc/hosts

I do all changes to the zone files by changing /etc/hosts, and then running a script (h2n) to create the required files. This won't work if I were to be the primary server for more than one domain.
# For loopbacking.
127.0.0.1	localhost

172.16.167.26	versailles.home.spade.com versailles ipx	# ipx machine
172.16.167.27	dungeon.home.spade.com dungeon 			# [no smtp] win95 machine
172.16.167.28	castle.home.spade.com castle 			# [no smtp] 
172.16.167.30	draco.home.spade.com draco castle-q		# gateway

# End of hosts.

/etc/named.boot

This file is the file that tells named (the dns server daemon) where the rest of its control files are located. I have made /etc/named.boot a symbolic link to /var/named/named/boot, so that all of the control files are located in the same place.

Note that I have set 'options forward-only' and a selection of forwarders. This is what really gets diald started, whenever a request is seen for the IP address of any forign host.

directory /var/named

primary	0.0.127.IN-ADDR.ARPA db.127.0.0
primary	home.spade.com db.home
primary 167.16.172.IN-ADDR.ARPA db.172.16.167
cache	. db.cache
forwarders 204.156.128.1 204.156.128.10 204.156.128.20
options forward-only


/var/named/db.home

@ IN  SOA draco.home.spade.com. root.draco.home.spade.com. ( 19 10800 3600 604800 86400 )
  IN  NS  draco.home.spade.com.

localhost            IN  A     127.0.0.1
draco                IN  A     172.16.167.30
castle-q             IN  CNAME draco.home.spade.com.
draco                IN  MX    10 draco.home.spade.com.
                     IN  MX    20 draco.home.spade.com.
versailles           IN  A     172.16.167.26
ipx                  IN  CNAME versailles.home.spade.com.
versailles           IN  MX    10 versailles.home.spade.com.
                     IN  MX    20 draco.home.spade.com.
castle               IN  A     172.16.167.28
castle               IN  MX    20 draco.home.spade.com.
dungeon              IN  A     172.16.167.27
dungeon              IN  MX    20 draco.home.spade.com.

/var/named/db.172.16.167

@ IN  SOA draco.home.spade.com. root.draco.home.spade.com. ( 5 10800 3600 604800 86400 )
  IN  NS  draco.home.spade.com.

26.167.16.172.IN-ADDR.ARPA.   	IN  PTR   versailles.home.spade.com.
27.167.16.172.IN-ADDR.ARPA.   	IN  PTR   dungeon.home.spade.com.
28.167.16.172.IN-ADDR.ARPA.   	IN  PTR   castle.home.spade.com.
30.167.16.172.IN-ADDR.ARPA.   	IN  PTR   draco.home.spade.com.



Index, Back On to Sendmail
Copyright ©, 1997, Ben Spade. Permission is given to copy or link to this document, as long as this notice remains intact.